diff options
Diffstat (limited to 'src/lib/include/gnunet_dbus_lib_interface.h')
-rw-r--r-- | src/lib/include/gnunet_dbus_lib_interface.h | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/src/lib/include/gnunet_dbus_lib_interface.h b/src/lib/include/gnunet_dbus_lib_interface.h new file mode 100644 index 0000000..83cd598 --- /dev/null +++ b/src/lib/include/gnunet_dbus_lib_interface.h | |||
@@ -0,0 +1,104 @@ | |||
1 | #ifndef GNUNET_DBUS_LIB_INTERFACE_H | ||
2 | #define GNUNET_DBUS_LIB_INTERFACE_H | ||
3 | |||
4 | #include <stdbool.h> | ||
5 | |||
6 | /** | ||
7 | * Represents a DBus interface. An interface consists of a set of methods and | ||
8 | * signals. | ||
9 | */ | ||
10 | struct GNUNET_DBUS_Interface; | ||
11 | |||
12 | #include "gnunet_dbus_lib_object.h" | ||
13 | #include "gnunet_dbus_lib_method.h" | ||
14 | #include "gnunet_dbus_lib_method_context.h" | ||
15 | #include "gnunet_dbus_lib_signal.h" | ||
16 | |||
17 | struct GNUNET_DBUS_InterfaceIterator | ||
18 | { | ||
19 | /* linked list */ | ||
20 | struct GNUNET_DBUS_InterfaceIterator *next; | ||
21 | struct GNUNET_DBUS_InterfaceIterator *prev; | ||
22 | |||
23 | struct GNUNET_DBUS_Interface *interface; | ||
24 | }; | ||
25 | |||
26 | /** | ||
27 | * Create a DBus interface with the given name. After populating this interface | ||
28 | * with methods and signals it can be added to an object with | ||
29 | * GNUNET_DBUS_object_add_interface. | ||
30 | */ | ||
31 | struct GNUNET_DBUS_Interface * | ||
32 | GNUNET_DBUS_interface_create ( | ||
33 | const char *name); | ||
34 | |||
35 | /** | ||
36 | * Increase the reference count of this GNUNET_DBUS_Interface by one. | ||
37 | */ | ||
38 | void | ||
39 | GNUNET_DBUS_interface_ref ( | ||
40 | struct GNUNET_DBUS_Interface *interface); | ||
41 | |||
42 | /** | ||
43 | * Decrease the reference count of this GNUNET_DBUS_Interface by one. | ||
44 | */ | ||
45 | void | ||
46 | GNUNET_DBUS_interface_unref ( | ||
47 | struct GNUNET_DBUS_Interface *interface); | ||
48 | |||
49 | /** | ||
50 | * Add a method to this interface. This will increase the reference count of | ||
51 | * the GNUNET_DBUS_Method by one. | ||
52 | */ | ||
53 | void | ||
54 | GNUNET_DBUS_interface_add_method ( | ||
55 | struct GNUNET_DBUS_Interface *interface, | ||
56 | struct GNUNET_DBUS_Method *method); | ||
57 | |||
58 | /** | ||
59 | * Add a signal to this interface. This will increase the reference count of | ||
60 | * the GNUNET_DBUS_Signal by one. | ||
61 | */ | ||
62 | void | ||
63 | GNUNET_DBUS_interface_add_signal ( | ||
64 | struct GNUNET_DBUS_Interface *interface, | ||
65 | struct GNUNET_DBUS_Signal *signal); | ||
66 | |||
67 | /** | ||
68 | * Get the name of this GNUNET_DBUS_Interface. | ||
69 | */ | ||
70 | const char * | ||
71 | GNUNET_DBUS_interface_get_name ( | ||
72 | const struct GNUNET_DBUS_Interface *interface); | ||
73 | |||
74 | /** | ||
75 | * Iterate over the methods of this GNUNET_DBUS_Interface. | ||
76 | */ | ||
77 | const struct GNUNET_DBUS_MethodIterator * | ||
78 | GNUNET_DBUS_interface_iterate_methods ( | ||
79 | const struct GNUNET_DBUS_Interface *interface); | ||
80 | |||
81 | /** | ||
82 | * Iterate over the signals of this GNUNET_DBUS_Interface. | ||
83 | */ | ||
84 | const struct GNUNET_DBUS_SignalIterator * | ||
85 | GNUNET_DBUS_interface_iterate_signals ( | ||
86 | const struct GNUNET_DBUS_Interface *interface); | ||
87 | |||
88 | /** | ||
89 | * Returns the org.freedesktop.DBus.Introspectable interface. | ||
90 | */ | ||
91 | struct GNUNET_DBUS_Interface * | ||
92 | GNUNET_DBUS_interface_introspectable (); | ||
93 | |||
94 | /** | ||
95 | * Return the position in the given linked-list of the GNUNET_DBUS_Interface | ||
96 | * with the given name. Returns NULL if the interface could not be found. | ||
97 | */ | ||
98 | const struct GNUNET_DBUS_InterfaceIterator * | ||
99 | GNUNET_DBUS_interface_find ( | ||
100 | const struct GNUNET_DBUS_InterfaceIterator *int_it, | ||
101 | const char *name); | ||
102 | |||
103 | #endif | ||
104 | |||