00001
00025 #ifndef _GAIM_POUNCE_H_
00026 #define _GAIM_POUNCE_H_
00027
00028 typedef struct _GaimPounce GaimPounce;
00029
00030 #include <glib.h>
00031 #include "account.h"
00032
00036 typedef enum
00037 {
00038 GAIM_POUNCE_NONE = 0x00,
00039 GAIM_POUNCE_SIGNON = 0x01,
00040 GAIM_POUNCE_SIGNOFF = 0x02,
00041 GAIM_POUNCE_AWAY = 0x04,
00042 GAIM_POUNCE_AWAY_RETURN = 0x08,
00043 GAIM_POUNCE_IDLE = 0x10,
00044 GAIM_POUNCE_IDLE_RETURN = 0x20,
00045 GAIM_POUNCE_TYPING = 0x40,
00046 GAIM_POUNCE_TYPING_STOPPED = 0x80
00048 } GaimPounceEvent;
00049
00051 typedef void (*GaimPounceCb)(GaimPounce *, GaimPounceEvent, void *);
00052
00061 struct _GaimPounce
00062 {
00063 char *ui_type;
00065 GaimPounceEvent events;
00066 GaimAccount *pouncer;
00068 char *pouncee;
00070 GHashTable *actions;
00072 gboolean save;
00074 void *data;
00075 };
00076
00077 #ifdef __cplusplus
00078 extern "C" {
00079 #endif
00080
00081
00083
00096 GaimPounce *gaim_pounce_new(const char *ui_type, GaimAccount *pouncer,
00097 const char *pouncee, GaimPounceEvent event);
00098
00104 void gaim_pounce_destroy(GaimPounce *pounce);
00105
00111 void gaim_pounce_destroy_all_by_account(GaimAccount *account);
00112
00119 void gaim_pounce_set_events(GaimPounce *pounce, GaimPounceEvent events);
00120
00127 void gaim_pounce_set_pouncer(GaimPounce *pounce, GaimAccount *pouncer);
00128
00135 void gaim_pounce_set_pouncee(GaimPounce *pounce, const char *pouncee);
00136
00143 void gaim_pounce_set_save(GaimPounce *pounce, gboolean save);
00144
00151 void gaim_pounce_action_register(GaimPounce *pounce, const char *name);
00152
00160 void gaim_pounce_action_set_enabled(GaimPounce *pounce, const char *action,
00161 gboolean enabled);
00162
00173 void gaim_pounce_action_set_attribute(GaimPounce *pounce, const char *action,
00174 const char *attr, const char *value);
00175
00182 void gaim_pounce_set_data(GaimPounce *pounce, void *data);
00183
00191 GaimPounceEvent gaim_pounce_get_events(const GaimPounce *pounce);
00192
00200 GaimAccount *gaim_pounce_get_pouncer(const GaimPounce *pounce);
00201
00209 const char *gaim_pounce_get_pouncee(const GaimPounce *pounce);
00210
00219 gboolean gaim_pounce_get_save(const GaimPounce *pounce);
00220
00229 gboolean gaim_pounce_action_is_enabled(const GaimPounce *pounce,
00230 const char *action);
00231
00241 const char *gaim_pounce_action_get_attribute(const GaimPounce *pounce,
00242 const char *action,
00243 const char *attr);
00244
00252 void *gaim_pounce_get_data(const GaimPounce *pounce);
00253
00261 void gaim_pounce_execute(const GaimAccount *pouncer, const char *pouncee,
00262 GaimPounceEvent events);
00263
00266
00268
00280 GaimPounce *gaim_find_pounce(const GaimAccount *pouncer,
00281 const char *pouncee, GaimPounceEvent events);
00282
00283
00289 gboolean gaim_pounces_load(void);
00290
00294 void gaim_pounces_sync(void);
00295
00304 void gaim_pounces_register_handler(const char *ui, GaimPounceCb cb,
00305 void (*new_pounce)(GaimPounce *pounce),
00306 void (*free_pounce)(GaimPounce *pounce));
00307
00313 void gaim_pounces_unregister_handler(const char *ui);
00314
00320 GList *gaim_pounces_get_all(void);
00321
00327 void *gaim_pounces_get_handle(void);
00328
00332 void gaim_pounces_init(void);
00333
00337 void gaim_pounces_uninit(void);
00338
00341 #ifdef __cplusplus
00342 }
00343 #endif
00344
00345 #endif