summaryrefslogtreecommitdiff
path: root/src/lib/eldbus/eldbus_introspection.h
diff options
context:
space:
mode:
authorGuilherme Lepsch <lepsch@expertisesolutions.com.br>2015-01-09 14:20:14 -0200
committerCedric BAIL <cedric@osg.samsung.com>2015-12-10 12:02:30 -0800
commit10fa1b5b4b2454437c00a9b8931bb3f9ddb9e99c (patch)
treeb4238f5f83b55463ad2e88e97dc968f2a607a668 /src/lib/eldbus/eldbus_introspection.h
parent48b22214493958fc852f101009b0e8a88aa77e05 (diff)
eldbus: add efl.model implementation.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/eldbus/eldbus_introspection.h')
-rw-r--r--src/lib/eldbus/eldbus_introspection.h124
1 files changed, 124 insertions, 0 deletions
diff --git a/src/lib/eldbus/eldbus_introspection.h b/src/lib/eldbus/eldbus_introspection.h
new file mode 100644
index 0000000..4f37460
--- /dev/null
+++ b/src/lib/eldbus/eldbus_introspection.h
@@ -0,0 +1,124 @@
1#ifndef _ELDBUS_INTROSPECTION_INTROSPECTION_H
2#define _ELDBUS_INTROSPECTION_INTROSPECTION_H
3
4#include <Eina.h>
5
6// DTD conversion form: http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd
7
8typedef struct _Eldbus_Introspection_Node Eldbus_Introspection_Node;
9typedef struct _Eldbus_Introspection_Interface Eldbus_Introspection_Interface;
10typedef struct _Eldbus_Introspection_Method Eldbus_Introspection_Method;
11typedef struct _Eldbus_Introspection_Signal Eldbus_Introspection_Signal;
12typedef struct _Eldbus_Introspection_Argument Eldbus_Introspection_Argument;
13typedef struct _Eldbus_Introspection_Property Eldbus_Introspection_Property;
14typedef struct _Eldbus_Introspection_Annotation Eldbus_Introspection_Annotation;
15
16typedef enum
17{
18 ELDBUS_INTROSPECTION_ARGUMENT_DIRECTION_NONE = 0,
19 ELDBUS_INTROSPECTION_ARGUMENT_DIRECTION_IN,
20 ELDBUS_INTROSPECTION_ARGUMENT_DIRECTION_OUT,
21
22} Eldbus_Introspection_Argument_Direction;
23
24typedef enum
25{
26 ELDBUS_INTROSPECTION_PROPERTY_ACCESS_READ,
27 ELDBUS_INTROSPECTION_PROPERTY_ACCESS_WRITE,
28 ELDBUS_INTROSPECTION_PROPERTY_ACCESS_READWRITE,
29} Eldbus_Introspection_Property_Access;
30
31struct _Eldbus_Introspection_Node
32{
33 Eina_Stringshare *name; // optional
34 Eina_List *nodes;
35 Eina_List *interfaces;
36};
37
38struct _Eldbus_Introspection_Interface
39{
40 Eina_Stringshare *name;
41 Eina_List *methods;
42 Eina_List *signals;
43 Eina_List *properties;
44 Eina_List *annotations;
45};
46
47struct _Eldbus_Introspection_Method
48{
49 Eina_Stringshare *name;
50 Eina_List *arguments;
51 Eina_List *annotations;
52};
53
54struct _Eldbus_Introspection_Signal
55{
56 Eina_Stringshare *name;
57 Eina_List *arguments;
58 Eina_List *annotations;
59};
60
61struct _Eldbus_Introspection_Argument
62{
63 Eina_Stringshare *name; // optional
64 Eina_Stringshare *type;
65 Eldbus_Introspection_Argument_Direction direction;
66};
67
68struct _Eldbus_Introspection_Property
69{
70 Eina_Stringshare *name;
71 Eina_Stringshare *type;
72 Eldbus_Introspection_Property_Access access;
73 Eina_List *annotations;
74};
75
76struct _Eldbus_Introspection_Annotation
77{
78 Eina_Stringshare *name;
79 Eina_Stringshare *value;
80};
81
82/**
83 * @brief Parses the introspection xml abstracting it to an object tree
84 *
85 * @param xml The introspection xml
86 * @return The introspection object tree
87 */
88EAPI Eldbus_Introspection_Node *eldbus_introspection_parse(const char *xml);
89
90/**
91 * @brief Frees the introspection object tree
92 *
93 * @param node The root node of introspection tree
94 */
95EAPI void eldbus_introspection_node_free(Eldbus_Introspection_Node *node);
96
97/**
98 * @brief Finds an interface by name
99 *
100 * @param interfaces The list of interfaces of type @c Eldbus_Introspection_Interface
101 * @param name The interfaces's name to search for
102 * @return Returns the interface found or @c NULL if not
103 */
104EAPI Eldbus_Introspection_Interface *eldbus_introspection_interface_find(Eina_List *interfaces, const char *name);
105
106/**
107 * @brief Finds a property by name
108 *
109 * @param properties The list of properties of type @c Eldbus_Introspection_Property
110 * @param name The properties's name to search for
111 * @return Returns the property found or @c NULL if not
112 */
113EAPI Eldbus_Introspection_Property *eldbus_introspection_property_find(Eina_List *properties, const char *name);
114
115/**
116 * @brief Finds an argument by name
117 *
118 * @param arguments The list of arguments of type @c Eldbus_Introspection_Property
119 * @param name The arguments's name to search for
120 * @return Returns the argument found or @c NULL if not
121 */
122EAPI Eldbus_Introspection_Argument *eldbus_introspection_argument_find(Eina_List *arguments, const char *name);
123
124#endif