Debian Codegraph @

lib/wp/metadata.h

raw
1 /* WirePlumber
2 *
3 * Copyright © 2020 Collabora Ltd.
4 * @author Raghavendra Rao <[email protected]>
5 *
6 * SPDX-License-Identifier: MIT
7 */
8
9 #ifndef __WIREPLUMBER_METADATA_H__
10 #define __WIREPLUMBER_METADATA_H__
11
12 #include "global-proxy.h"
13
14 G_BEGIN_DECLS
15
16 /*!
17 * \brief The WpMetadataItem GType
18 * \ingroup wpmetadata
19 */
20 #define WP_TYPE_METADATA_ITEM (wp_metadata_item_get_type ())
21 WP_API
22 GType wp_metadata_item_get_type (void);
23
24 typedef struct _WpMetadataItem WpMetadataItem;
25
26 WP_API
27 WpMetadataItem *wp_metadata_item_ref (WpMetadataItem *self);
28
29 WP_API
30 void wp_metadata_item_unref (WpMetadataItem *self);
31
32 WP_API
33 guint32 wp_metadata_item_get_subject (WpMetadataItem * self);
34
35 WP_API
36 const gchar * wp_metadata_item_get_key (WpMetadataItem * self);
37
38 WP_API
39 const gchar * wp_metadata_item_get_value_type (WpMetadataItem * self);
40
41 WP_API
42 const gchar * wp_metadata_item_get_value (WpMetadataItem * self);
43
44 G_DEFINE_AUTOPTR_CLEANUP_FUNC (WpMetadataItem, wp_metadata_item_unref)
45
46 /*!
47 * \brief An extension of WpProxyFeatures for WpMetadata objects
48 * \ingroup wpmetadata
49 */
50 typedef enum { /*< flags >*/
51 /*! caches metadata locally */
52 WP_METADATA_FEATURE_DATA = (WP_PROXY_FEATURE_CUSTOM_START << 0),
53 } WpMetadataFeatures;
54
55 /*!
56 * \brief The WpMetadata GType
57 * \ingroup wpmetadata
58 */
59 #define WP_TYPE_METADATA (wp_metadata_get_type ())
60
61 WP_API
62 G_DECLARE_DERIVABLE_TYPE (WpMetadata, wp_metadata, WP, METADATA, WpGlobalProxy)
63
64 struct _WpMetadataClass
65 {
66 WpGlobalProxyClass parent_class;
67
68 /*< private >*/
69 WP_PADDING(4)
70 };
71
72 WP_API
73 WpIterator * wp_metadata_new_iterator (WpMetadata * self, guint32 subject);
74
75 WP_API
76 const gchar * wp_metadata_find (WpMetadata * self, guint32 subject,
77 const gchar * key, const gchar ** type);
78
79 WP_API
80 void wp_metadata_set (WpMetadata * self, guint32 subject,
81 const gchar * key, const gchar * type, const gchar * value);
82
83 WP_API
84 void wp_metadata_clear (WpMetadata * self);
85
86 /*!
87 * \brief The WpImplMetadata GType
88 * \ingroup wpmetadata
89 */
90 #define WP_TYPE_IMPL_METADATA (wp_impl_metadata_get_type ())
91
92 WP_API
93 G_DECLARE_FINAL_TYPE (WpImplMetadata, wp_impl_metadata, WP, IMPL_METADATA, WpMetadata)
94
95 WP_API
96 WpImplMetadata * wp_impl_metadata_new (WpCore * core);
97
98 WP_API
99 WpImplMetadata * wp_impl_metadata_new_full (WpCore * core, const gchar *name,
100 WpProperties *properties);
101
102 G_END_DECLS
103
104 #endif