Mercurial > pidgin
comparison src/notify.h @ 9797:62eb9fe24692
[gaim-migrate @ 10665]
"This patch adds gaim_notify_userinfo() and a notify_userinfo() UI
callback. gaim_notify_userinfo() is much like
gaim_notify_formatted() except that it always takes a
GaimConnection* as its handle and has an
additional argument, const char* who.
gaim_gtk_notify_userinfo() currently passes all the information
except the GaimConnection* and the const char* who to
gaim_gtk_notify_formatted(). This could be changed in the future
to, for example, have a standardized window title which would
note the account and/or user associated with the information.
This is needed because some UIs (Adium, for example) don't want
to present the information in a standalone window - they want to
associate the information with a particular contact / buddy and
display it with that object's other information. Previously,
gaim_notify_formatted() was not useful for this purpose as it could
not be determined what user's info it was; gaim_notify_userinfo()
makes this possible.
This patch modifies notify.c and notify.h for the new function,
modifies gtknotify.c to register the ui op and pass calls to it on the
gaim_gtk_notify_formatted, and modifies all prpls except SILC
(which I don't understand well enough to modify, but there's no
actual harm in leaving it as gaim_notify_formatted() for now) to
use gaim_notify_userinfo() and pass their gc and username when
calling the function." -- Evan Schoenberg
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Fri, 20 Aug 2004 22:05:18 +0000 |
parents | fa6395637e2c |
children | cc68a8c6e741 |
comparison
equal
deleted
inserted
replaced
9796:68574cef02e2 | 9797:62eb9fe24692 |
---|---|
26 #define _GAIM_NOTIFY_H_ | 26 #define _GAIM_NOTIFY_H_ |
27 | 27 |
28 #include <stdlib.h> | 28 #include <stdlib.h> |
29 #include <glib-object.h> | 29 #include <glib-object.h> |
30 #include <glib.h> | 30 #include <glib.h> |
31 | |
32 #include "connection.h" | |
31 | 33 |
32 /** | 34 /** |
33 * Notification types. | 35 * Notification types. |
34 */ | 36 */ |
35 typedef enum | 37 typedef enum |
36 { | 38 { |
37 GAIM_NOTIFY_MESSAGE = 0, /**< Message notification. */ | 39 GAIM_NOTIFY_MESSAGE = 0, /**< Message notification. */ |
38 GAIM_NOTIFY_EMAIL, /**< Single e-mail notification. */ | 40 GAIM_NOTIFY_EMAIL, /**< Single e-mail notification. */ |
39 GAIM_NOTIFY_EMAILS, /**< Multiple e-mail notification. */ | 41 GAIM_NOTIFY_EMAILS, /**< Multiple e-mail notification. */ |
40 GAIM_NOTIFY_FORMATTED, /**< Formatted text. */ | 42 GAIM_NOTIFY_FORMATTED, /**< Formatted text. */ |
43 GAIM_NOTIFY_USERINFO, /**< Formatted userinfo text. */ | |
41 GAIM_NOTIFY_URI /**< URI notification or display. */ | 44 GAIM_NOTIFY_URI /**< URI notification or display. */ |
42 | 45 |
43 } GaimNotifyType; | 46 } GaimNotifyType; |
44 | 47 |
45 /** | 48 /** |
69 const char **tos, const char **urls, | 72 const char **tos, const char **urls, |
70 GCallback cb, void *user_data); | 73 GCallback cb, void *user_data); |
71 void *(*notify_formatted)(const char *title, const char *primary, | 74 void *(*notify_formatted)(const char *title, const char *primary, |
72 const char *secondary, const char *text, | 75 const char *secondary, const char *text, |
73 GCallback cb, void *user_data); | 76 GCallback cb, void *user_data); |
77 void *(*notify_userinfo)(GaimConnection *gc, const char *who, | |
78 const char *title, const char *primary, | |
79 const char *secondary, const char *text, | |
80 GCallback cb, void *user_data); | |
74 void *(*notify_uri)(const char *uri); | 81 void *(*notify_uri)(const char *uri); |
75 | 82 |
76 void (*close_notify)(GaimNotifyType type, void *ui_handle); | 83 void (*close_notify)(GaimNotifyType type, void *ui_handle); |
77 | 84 |
78 } GaimNotifyUiOps; | 85 } GaimNotifyUiOps; |
167 void *gaim_notify_formatted(void *handle, const char *title, | 174 void *gaim_notify_formatted(void *handle, const char *title, |
168 const char *primary, const char *secondary, | 175 const char *primary, const char *secondary, |
169 const char *text, GCallback cb, void *user_data); | 176 const char *text, GCallback cb, void *user_data); |
170 | 177 |
171 /** | 178 /** |
179 * Displays user information with formatted text, passing information giving | |
180 * the connection and username from which the user information came. | |
181 * | |
182 * The text is essentially a stripped-down format of HTML, the same that | |
183 * IMs may send. | |
184 * | |
185 * @param gc The GaimConnection handle associated with the information. | |
186 * @param who The username associated with the information. | |
187 * @param title The title of the message. | |
188 * @param primary The main point of the message. | |
189 * @param secondary The secondary information. | |
190 * @param text The formatted text. | |
191 * @param cb The callback to call when the user closes | |
192 * the notification. | |
193 * @param user_data The data to pass to the callback. | |
194 * | |
195 * @return A UI-specific handle. | |
196 */ | |
197 void *gaim_notify_userinfo(GaimConnection *gc, const char *who, | |
198 const char *title, const char *primary, | |
199 const char *secondary, const char *text, | |
200 GCallback cb, void *user_data); | |
201 | |
202 /** | |
172 * Opens a URI or somehow presents it to the user. | 203 * Opens a URI or somehow presents it to the user. |
173 * | 204 * |
174 * @param handle The plugin or connection handle. | 205 * @param handle The plugin or connection handle. |
175 * @param uri The URI to display or go to. | 206 * @param uri The URI to display or go to. |
176 * | 207 * |