comparison libpurple/pounce.h @ 32819:2c6510167895 default tip

propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24) to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 02 Jun 2012 02:30:49 +0000
parents 98520ee78f12
children
comparison
equal deleted inserted replaced
32818:01ff09d4a463 32819:2c6510167895
57 } PurplePounceOption; 57 } PurplePounceOption;
58 58
59 /** A pounce callback. */ 59 /** A pounce callback. */
60 typedef void (*PurplePounceCb)(PurplePounce *, PurplePounceEvent, void *); 60 typedef void (*PurplePounceCb)(PurplePounce *, PurplePounceEvent, void *);
61 61
62 /** 62 G_BEGIN_DECLS
63 * A buddy pounce structure.
64 *
65 * Buddy pounces are actions triggered by a buddy-related event. For
66 * example, a sound can be played or an IM window opened when a buddy
67 * signs on or returns from away. Such responses are handled in the
68 * UI. The events themselves are done in the core.
69 */
70 struct _PurplePounce
71 {
72 char *ui_type; /**< The type of UI. */
73
74 PurplePounceEvent events; /**< The event(s) to pounce on. */
75 PurplePounceOption options; /**< The pounce options */
76 PurpleAccount *pouncer; /**< The user who is pouncing. */
77
78 char *pouncee; /**< The buddy to pounce on. */
79
80 GHashTable *actions; /**< The registered actions. */
81
82 gboolean save; /**< Whether or not the pounce should
83 be saved after activation. */
84 void *data; /**< Pounce-specific data. */
85 };
86
87 #ifdef __cplusplus
88 extern "C" {
89 #endif
90 63
91 /**************************************************************************/ 64 /**************************************************************************/
92 /** @name Buddy Pounce API */ 65 /** @name Buddy Pounce API */
93 /**************************************************************************/ 66 /**************************************************************************/
94 /*@{*/ 67 /*@{*/
124 97
125 /** 98 /**
126 * Destroys all buddy pounces for a buddy 99 * Destroys all buddy pounces for a buddy
127 * 100 *
128 * @param buddy The buddy whose pounces are to be removed 101 * @param buddy The buddy whose pounces are to be removed
129 *
130 * @since 2.8.0
131 */ 102 */
132 void purple_pounce_destroy_all_by_buddy(PurpleBuddy *buddy); 103 void purple_pounce_destroy_all_by_buddy(PurpleBuddy *buddy);
133 104
134 /** 105 /**
135 * Sets the events a pounce should watch for. 106 * Sets the events a pounce should watch for.
357 * 328 *
358 * @param ui The ID of the UI using the core. 329 * @param ui The ID of the UI using the core.
359 * 330 *
360 * @return The list of buddy pounces. The list should be freed by 331 * @return The list of buddy pounces. The list should be freed by
361 * the caller when it's no longer used. 332 * the caller when it's no longer used.
362 * @since 2.1.0
363 */ 333 */
364 GList *purple_pounces_get_all_for_ui(const char *ui); 334 GList *purple_pounces_get_all_for_ui(const char *ui);
365 335
366 /** 336 /**
367 * Returns the buddy pounce subsystem handle. 337 * Returns the buddy pounce subsystem handle.
380 */ 350 */
381 void purple_pounces_uninit(void); 351 void purple_pounces_uninit(void);
382 352
383 /*@}*/ 353 /*@}*/
384 354
385 #ifdef __cplusplus 355 G_END_DECLS
386 }
387 #endif
388 356
389 #endif /* _PURPLE_POUNCE_H_ */ 357 #endif /* _PURPLE_POUNCE_H_ */