pounce.h
Go to the documentation of this file.
1 
6 /* purple
7  *
8  * Purple is the legal property of its developers, whose names are too numerous
9  * to list here. Please refer to the COPYRIGHT file distributed with this
10  * source distribution.
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25  */
26 #ifndef _PURPLE_POUNCE_H_
27 #define _PURPLE_POUNCE_H_
28 
29 typedef struct _PurplePounce PurplePounce;
30 
31 #include <glib.h>
32 #include "account.h"
33 
37 typedef enum
38 {
52 
53 typedef enum
54 {
58 
60 typedef void (*PurplePounceCb)(PurplePounce *, PurplePounceEvent, void *);
61 
71 {
72  char *ui_type;
78  char *pouncee;
80  GHashTable *actions;
82  gboolean save;
84  void *data;
85 };
86 
87 #ifdef __cplusplus
88 extern "C" {
89 #endif
90 
91 /**************************************************************************/
93 /**************************************************************************/
107 PurplePounce *purple_pounce_new(const char *ui_type, PurpleAccount *pouncer,
108  const char *pouncee, PurplePounceEvent event,
110 
116 void purple_pounce_destroy(PurplePounce *pounce);
117 
124 
133 
141 
149 
157 
164 void purple_pounce_set_pouncee(PurplePounce *pounce, const char *pouncee);
165 
172 void purple_pounce_set_save(PurplePounce *pounce, gboolean save);
173 
180 void purple_pounce_action_register(PurplePounce *pounce, const char *name);
181 
189 void purple_pounce_action_set_enabled(PurplePounce *pounce, const char *action,
190  gboolean enabled);
191 
202 void purple_pounce_action_set_attribute(PurplePounce *pounce, const char *action,
203  const char *attr, const char *value);
204 
211 void purple_pounce_set_data(PurplePounce *pounce, void *data);
212 
221 
230 
239 
247 const char *purple_pounce_get_pouncee(const PurplePounce *pounce);
248 
257 gboolean purple_pounce_get_save(const PurplePounce *pounce);
258 
267 gboolean purple_pounce_action_is_enabled(const PurplePounce *pounce,
268  const char *action);
269 
279 const char *purple_pounce_action_get_attribute(const PurplePounce *pounce,
280  const char *action,
281  const char *attr);
282 
290 void *purple_pounce_get_data(const PurplePounce *pounce);
291 
299 void purple_pounce_execute(const PurpleAccount *pouncer, const char *pouncee,
300  PurplePounceEvent events);
301 
304 /**************************************************************************/
306 /**************************************************************************/
319  const char *pouncee, PurplePounceEvent events);
320 
321 
327 gboolean purple_pounces_load(void);
328 
337 void purple_pounces_register_handler(const char *ui, PurplePounceCb cb,
338  void (*new_pounce)(PurplePounce *pounce),
339  void (*free_pounce)(PurplePounce *pounce));
340 
346 void purple_pounces_unregister_handler(const char *ui);
347 
353 GList *purple_pounces_get_all(void);
354 
364 GList *purple_pounces_get_all_for_ui(const char *ui);
365 
371 void *purple_pounces_get_handle(void);
372 
376 void purple_pounces_init(void);
377 
381 void purple_pounces_uninit(void);
382 
385 #ifdef __cplusplus
386 }
387 #endif
388 
389 #endif /* _PURPLE_POUNCE_H_ */