libpurple/core.h

branch
soc.2013.gobjectification.plugins
changeset 37040
91119588bc3a
parent 37035
e85ed7f4d6e3
parent 35397
31fa3a1aeff5
child 37046
f1e49cf5896f
equal deleted inserted replaced
37039:7d964cdccbb5 37040:91119588bc3a
39 39
40 #include <glib.h> 40 #include <glib.h>
41 41
42 typedef struct PurpleCore PurpleCore; 42 typedef struct PurpleCore PurpleCore;
43 43
44 /** Callbacks that fire at different points of the initialization and teardown 44 /**
45 * of libpurple, along with a hook to return descriptive information about the 45 * PurpleCoreUiOps:
46 * UI. 46 *
47 * Callbacks that fire at different points of the initialization and teardown
48 * of libpurple, along with a hook to return descriptive information about the
49 * UI.
47 */ 50 */
48 typedef struct 51 typedef struct
49 { 52 {
50 /** Called just after the preferences subsystem is initialized; the UI 53 /** Called just after the preferences subsystem is initialized; the UI
51 * could use this callback to add some preferences it needs to be in 54 * could use this callback to add some preferences it needs to be in
81 } PurpleCoreUiOps; 84 } PurpleCoreUiOps;
82 85
83 G_BEGIN_DECLS 86 G_BEGIN_DECLS
84 87
85 /** 88 /**
86 * Initializes the core of purple. 89 * purple_core_init:
87 *
88 * This will setup preferences for all the core subsystems.
89 *
90 * @ui: The ID of the UI using the core. This should be a 90 * @ui: The ID of the UI using the core. This should be a
91 * unique ID, registered with the purple team. 91 * unique ID, registered with the purple team.
92 * 92 *
93 * Initializes the core of purple.
94 *
95 * This will setup preferences for all the core subsystems.
96 *
93 * Returns: %TRUE if successful, or %FALSE otherwise. 97 * Returns: %TRUE if successful, or %FALSE otherwise.
94 */ 98 */
95 gboolean purple_core_init(const char *ui); 99 gboolean purple_core_init(const char *ui);
96 100
97 /** 101 /**
102 * purple_core_quit:
103 *
98 * Quits the core of purple, which, depending on the UI, may quit the 104 * Quits the core of purple, which, depending on the UI, may quit the
99 * application using the purple core. 105 * application using the purple core.
100 */ 106 */
101 void purple_core_quit(void); 107 void purple_core_quit(void);
102 108
103 /** 109 /**
110 * purple_core_quit_cb:
111 *
104 * <p> 112 * <p>
105 * Calls purple_core_quit(). This can be used as the function 113 * Calls purple_core_quit(). This can be used as the function
106 * passed to purple_timeout_add() when you want to shutdown Purple 114 * passed to purple_timeout_add() when you want to shutdown Purple
107 * in a specified amount of time. When shutting down Purple 115 * in a specified amount of time. When shutting down Purple
108 * from a plugin, you must use this instead of purple_core_quit(); 116 * from a plugin, you must use this instead of purple_core_quit();
120 * </p> 128 * </p>
121 */ 129 */
122 gboolean purple_core_quit_cb(gpointer unused); 130 gboolean purple_core_quit_cb(gpointer unused);
123 131
124 /** 132 /**
133 * purple_core_get_version:
134 *
125 * Returns the version of the core library. 135 * Returns the version of the core library.
126 * 136 *
127 * Returns: The version of the core library. 137 * Returns: The version of the core library.
128 */ 138 */
129 const char *purple_core_get_version(void); 139 const char *purple_core_get_version(void);
130 140
131 /** 141 /**
142 * purple_core_get_ui:
143 *
132 * Returns the ID of the UI that is using the core, as passed to 144 * Returns the ID of the UI that is using the core, as passed to
133 * purple_core_init(). 145 * purple_core_init().
134 * 146 *
135 * Returns: The ID of the UI that is currently using the core. 147 * Returns: The ID of the UI that is currently using the core.
136 */ 148 */
137 const char *purple_core_get_ui(void); 149 const char *purple_core_get_ui(void);
138 150
139 /** 151 /**
152 * purple_get_core:
153 *
140 * Returns a handle to the purple core. 154 * Returns a handle to the purple core.
141 * 155 *
142 * This is used to connect to @ref core-signals "core signals". 156 * This is used to connect to @ref core-signals "core signals".
143 */ 157 */
144 PurpleCore *purple_get_core(void); 158 PurpleCore *purple_get_core(void);
145 159
146 /** 160 /**
161 * purple_core_set_ui_ops:
162 * @ops: A UI ops structure for the core.
163 *
147 * Sets the UI ops for the core. 164 * Sets the UI ops for the core.
148 *
149 * @ops: A UI ops structure for the core.
150 */ 165 */
151 void purple_core_set_ui_ops(PurpleCoreUiOps *ops); 166 void purple_core_set_ui_ops(PurpleCoreUiOps *ops);
152 167
153 /** 168 /**
169 * purple_core_get_ui_ops:
170 *
154 * Returns the UI ops for the core. 171 * Returns the UI ops for the core.
155 * 172 *
156 * Returns: The core's UI ops structure. 173 * Returns: The core's UI ops structure.
157 */ 174 */
158 PurpleCoreUiOps *purple_core_get_ui_ops(void); 175 PurpleCoreUiOps *purple_core_get_ui_ops(void);
159 176
160 /** 177 /**
178 * purple_core_ensure_single_instance:
179 *
161 * Ensures that only one instance is running. If libpurple is built with D-Bus 180 * Ensures that only one instance is running. If libpurple is built with D-Bus
162 * support, this checks if another process owns the libpurple bus name and if 181 * support, this checks if another process owns the libpurple bus name and if
163 * so whether that process is using the same configuration directory as this 182 * so whether that process is using the same configuration directory as this
164 * process. 183 * process.
165 * 184 *
167 * %FALSE if there is another instance running. 186 * %FALSE if there is another instance running.
168 */ 187 */
169 gboolean purple_core_ensure_single_instance(void); 188 gboolean purple_core_ensure_single_instance(void);
170 189
171 /** 190 /**
191 * purple_core_get_ui_info:
192 *
172 * Returns a hash table containing various information about the UI. The 193 * Returns a hash table containing various information about the UI. The
173 * following well-known entries may be in the table (along with any others the 194 * following well-known entries may be in the table (along with any others the
174 * UI might choose to include): 195 * UI might choose to include):
175 * 196 *
176 * <dl> 197 * <dl>

mercurial