Tue, 20 Sep 2005 22:08:40 +0000
[gaim-migrate @ 13820]
Compiles against GTK < 2.4
| 5437 | 1 | /** |
| 2 | * @file notify.h Notification API | |
| 3 | * @ingroup core | |
| 4 | * | |
| 5 | * gaim | |
| 6 | * | |
| 8046 | 7 | * Gaim is the legal property of its developers, whose names are too numerous |
| 8 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 | * source distribution. | |
|
6465
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
10 | * |
| 5437 | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | */ | |
| 25 | #ifndef _GAIM_NOTIFY_H_ | |
| 26 | #define _GAIM_NOTIFY_H_ | |
| 27 | ||
| 28 | #include <stdlib.h> | |
| 29 | #include <glib-object.h> | |
| 30 | #include <glib.h> | |
| 31 | ||
| 9797 | 32 | #include "connection.h" |
| 33 | ||
| 5437 | 34 | /** |
| 35 | * Notification types. | |
| 36 | */ | |
| 37 | typedef enum | |
| 38 | { | |
|
10439
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
39 | GAIM_NOTIFY_MESSAGE = 0, /**< Message notification. */ |
|
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
40 | GAIM_NOTIFY_EMAIL, /**< Single e-mail notification. */ |
|
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
41 | GAIM_NOTIFY_EMAILS, /**< Multiple e-mail notification. */ |
|
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
42 | GAIM_NOTIFY_FORMATTED, /**< Formatted text. */ |
|
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
43 | GAIM_NOTIFY_SEARCHRESULTS, /**< Buddy search results. */ |
|
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
44 | GAIM_NOTIFY_USERINFO, /**< Formatted userinfo text. */ |
|
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
45 | GAIM_NOTIFY_URI /**< URI notification or display. */ |
| 5437 | 46 | |
| 47 | } GaimNotifyType; | |
| 48 | ||
| 49 | /** | |
| 50 | * Notification message types. | |
| 51 | */ | |
| 52 | typedef enum | |
| 53 | { | |
| 54 | GAIM_NOTIFY_MSG_ERROR = 0, /**< Error notification. */ | |
| 55 | GAIM_NOTIFY_MSG_WARNING, /**< Warning notification. */ | |
| 56 | GAIM_NOTIFY_MSG_INFO /**< Information notification. */ | |
| 57 | ||
| 58 | } GaimNotifyMsgType; | |
| 59 | ||
| 60 | /** | |
| 11359 | 61 | * The types of buttons |
| 62 | */ | |
| 63 | typedef enum | |
| 64 | { | |
| 65 | GAIM_NOTIFY_BUTTON_CONTINUE = 0, | |
| 66 | GAIM_NOTIFY_BUTTON_ADD_BUDDY | |
| 67 | ||
| 68 | } GaimNotifySearchButtonType; | |
| 69 | ||
| 70 | /** | |
| 71 | * Search results object. | |
| 72 | */ | |
| 73 | typedef struct | |
| 74 | { | |
| 75 | GList *columns; /**< List of the search column objects. */ | |
| 76 | GList *rows; /**< List of rows in the result. */ | |
| 77 | GList *buttons; /**< List of buttons to display. */ | |
| 78 | ||
| 79 | } GaimNotifySearchResults; | |
| 80 | ||
| 81 | /** | |
| 82 | * Single column of a search result. | |
| 83 | */ | |
| 84 | typedef struct | |
| 85 | { | |
| 86 | char *title; /**< Title of the column. */ | |
| 87 | ||
| 88 | } GaimNotifySearchColumn; | |
| 89 | ||
| 90 | typedef void (*GaimNotifySearchResultsCallback)(GaimConnection *, GList *); | |
| 91 | ||
| 92 | ||
| 93 | /** | |
| 94 | * Definition of a button. | |
| 95 | */ | |
| 96 | typedef struct | |
| 97 | { | |
| 98 | GaimNotifySearchButtonType type; | |
| 99 | GaimNotifySearchResultsCallback callback; /**< Function to be called when clicked. */ | |
| 100 | ||
| 101 | } GaimNotifySearchButton; | |
| 102 | ||
| 103 | /** | |
| 5437 | 104 | * Notification UI operations. |
| 105 | */ | |
| 106 | typedef struct | |
| 107 | { | |
| 108 | void *(*notify_message)(GaimNotifyMsgType type, const char *title, | |
| 109 | const char *primary, const char *secondary, | |
| 110 | GCallback cb, void *user_data); | |
| 111 | void *(*notify_email)(const char *subject, const char *from, | |
| 112 | const char *to, const char *url, | |
| 113 | GCallback cb, void *user_data); | |
|
5522
faa69c8f503d
[gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents:
5497
diff
changeset
|
114 | void *(*notify_emails)(size_t count, gboolean detailed, |
|
faa69c8f503d
[gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents:
5497
diff
changeset
|
115 | const char **subjects, const char **froms, |
|
faa69c8f503d
[gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents:
5497
diff
changeset
|
116 | const char **tos, const char **urls, |
|
faa69c8f503d
[gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents:
5497
diff
changeset
|
117 | GCallback cb, void *user_data); |
|
6381
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
118 | void *(*notify_formatted)(const char *title, const char *primary, |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
119 | const char *secondary, const char *text, |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
120 | GCallback cb, void *user_data); |
|
10439
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
121 | void *(*notify_searchresults)(GaimConnection *gc, const char *title, |
|
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
122 | const char *primary, const char *secondary, |
| 11359 | 123 | GaimNotifySearchResults *results, GCallback cb, |
|
10439
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
124 | void *user_data); |
| 11359 | 125 | void (*notify_searchresults_new_rows)(GaimConnection *gc, |
| 126 | GaimNotifySearchResults *results, | |
| 127 | void *data, void *user_data); | |
| 9797 | 128 | void *(*notify_userinfo)(GaimConnection *gc, const char *who, |
|
11533
f58436975d44
[gaim-migrate @ 13782]
Richard Laager <rlaager@pidgin.im>
parents:
11531
diff
changeset
|
129 | const char *text, |
| 9797 | 130 | GCallback cb, void *user_data); |
|
10240
09342bc554d9
[gaim-migrate @ 11377]
Herman Bloggs <herman@bluedigits.com>
parents:
10209
diff
changeset
|
131 | void *(*notify_uri)(const char *uri); |
| 5437 | 132 | |
|
5476
6f863ea68018
[gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents:
5437
diff
changeset
|
133 | void (*close_notify)(GaimNotifyType type, void *ui_handle); |
| 5437 | 134 | |
| 135 | } GaimNotifyUiOps; | |
| 136 | ||
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
137 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
138 | extern "C" { |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
139 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
140 | |
| 5437 | 141 | /**************************************************************************/ |
| 11359 | 142 | /** Search results notification API */ |
| 143 | /**************************************************************************/ | |
| 144 | /*@{*/ | |
| 145 | ||
| 146 | /** | |
| 147 | * Displays results from a buddy search. This can be, for example, | |
| 148 | * a window with a list of all found buddies, where you are given the | |
| 149 | * option of adding buddies to your buddy list. | |
| 150 | * | |
| 151 | * @param gc The GaimConnection handle associated with the information. | |
| 152 | * @param title The title of the message. If this is NULL, the title | |
| 153 | * will be "Search Results." | |
| 154 | * @param primary The main point of the message. | |
| 155 | * @param secondary The secondary information. | |
| 156 | * @param results The GaimNotifySearchResults instance. | |
| 157 | * @param cb The callback to call when the user closes | |
| 158 | * the notification. | |
| 159 | * @param user_data The data to pass to the callback. | |
| 160 | * | |
| 161 | * @return A UI-specific handle. | |
| 162 | */ | |
| 163 | void *gaim_notify_searchresults(GaimConnection *gc, const char *title, | |
| 164 | const char *primary, const char *secondary, | |
| 165 | GaimNotifySearchResults *results, GCallback cb, | |
| 166 | void *user_data); | |
| 167 | ||
| 168 | void gaim_notify_searchresults_free(GaimNotifySearchResults *results); | |
| 169 | ||
| 170 | /** | |
| 171 | * Replace old rows with the new. Reuse an existing window. | |
| 172 | * | |
| 173 | * @param gc The GaimConnection structure. | |
| 174 | * @param results The GaimNotifySearchResults structure. | |
| 175 | * @param data Data returned by the gaim_notify_searchresults(). | |
| 176 | * @param user_data User defined data. | |
| 177 | */ | |
| 178 | void gaim_notify_searchresults_new_rows(GaimConnection *gc, | |
| 179 | GaimNotifySearchResults *results, | |
| 180 | void *data, void *user_data); | |
| 181 | ||
| 182 | /** | |
| 183 | * Adds a button that will be displayed in the search results dialog. | |
| 184 | * | |
| 185 | * @param results The search results object. | |
| 186 | * @param type Type of the button. (TODO: Only one button of a given type can be displayed.) | |
| 187 | * @param cb Function that will be called on the click event. | |
| 188 | */ | |
| 189 | void gaim_notify_searchresults_button_add(GaimNotifySearchResults *results, | |
| 190 | GaimNotifySearchButtonType type, | |
| 191 | GaimNotifySearchResultsCallback cb); | |
| 192 | ||
| 193 | /** | |
| 194 | * Returns a newly created search results object. | |
| 195 | * | |
| 196 | * @return The new search results object. | |
| 197 | */ | |
| 198 | GaimNotifySearchResults *gaim_notify_searchresults_new(); | |
| 199 | ||
| 200 | /** | |
| 201 | * Returns a newly created search result column object. | |
| 202 | * | |
| 203 | * @param title Title of the column. NOTE: Title will get g_strdup()ed. | |
| 204 | * | |
| 205 | * @return The new search column object. | |
| 206 | */ | |
| 207 | GaimNotifySearchColumn *gaim_notify_searchresults_column_new(const char *title); | |
| 208 | ||
| 209 | /** | |
| 210 | * Adds a new column to the search result object. | |
| 211 | * | |
| 212 | * @param results The result object to which the column will be added. | |
|
11501
a8fc92026134
[gaim-migrate @ 13746]
Richard Laager <rlaager@pidgin.im>
parents:
11359
diff
changeset
|
213 | * @param column The column that will be added to the result object. |
| 11359 | 214 | */ |
| 215 | void gaim_notify_searchresults_column_add(GaimNotifySearchResults *results, | |
| 216 | GaimNotifySearchColumn *column); | |
| 217 | ||
| 218 | /** | |
| 219 | * Adds a new row of the results to the search results object. | |
| 220 | * | |
| 221 | * @param results The search results object. | |
| 222 | * @param row The row of the results. | |
| 223 | */ | |
| 224 | void gaim_notify_searchresults_row_add(GaimNotifySearchResults *results, | |
| 225 | GList *row); | |
| 226 | ||
| 227 | /** | |
| 228 | * Returns a number of the rows in the search results object. | |
| 229 | * | |
| 230 | * @param results The search results object. | |
| 231 | * | |
| 232 | * @return Number of the result rows. Or -1 if an error occurrs. | |
| 233 | */ | |
| 234 | int gaim_notify_searchresults_get_rows_count(GaimNotifySearchResults *results); | |
| 235 | ||
| 236 | /** | |
| 237 | * Returns a number of the columns in the search results object. | |
| 238 | * | |
| 239 | * @param results The search results object. | |
| 240 | * | |
| 241 | * @return Number of the columns. Or -1 if an error occurrs. | |
| 242 | */ | |
| 243 | int gaim_notify_searchresults_get_columns_count(GaimNotifySearchResults *results); | |
| 244 | ||
| 245 | /** | |
| 246 | * Returns a row of the results from the search results object. | |
| 247 | * | |
| 248 | * @param results The search results object. | |
| 249 | * @param row_id Index of the row to be returned. | |
| 250 | * | |
| 251 | * @return Row of the results. | |
| 252 | */ | |
| 253 | GList *gaim_notify_searchresults_row_get(GaimNotifySearchResults *results, | |
| 254 | unsigned int row_id); | |
| 255 | ||
| 256 | /** | |
| 257 | * Returns a title of the search results object's column. | |
| 258 | * | |
| 259 | * @param results The search results object. | |
| 260 | * @param column_id Index of the column. | |
| 261 | * | |
| 262 | * @return Title of the column. | |
| 263 | */ | |
| 264 | char *gaim_notify_searchresults_column_get_title(GaimNotifySearchResults *results, | |
| 265 | unsigned int column_id); | |
| 266 | ||
| 267 | /*@}*/ | |
| 268 | ||
| 269 | /**************************************************************************/ | |
| 5437 | 270 | /** @name Notification API */ |
| 271 | /**************************************************************************/ | |
| 272 | /*@{*/ | |
| 273 | ||
| 274 | /** | |
| 275 | * Displays a notification message to the user. | |
| 276 | * | |
| 277 | * @param handle The plugin or connection handle. | |
| 278 | * @param type The notification type. | |
| 279 | * @param title The title of the message. | |
| 280 | * @param primary The main point of the message. | |
| 281 | * @param secondary The secondary information. | |
| 282 | * @param cb The callback to call when the user closes | |
| 283 | * the notification. | |
| 284 | * @param user_data The data to pass to the callback. | |
| 285 | * | |
| 286 | * @return A UI-specific handle. | |
| 287 | */ | |
|
6356
27990c4f9a9f
[gaim-migrate @ 6855]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
288 | void *gaim_notify_message(void *handle, GaimNotifyMsgType type, |
| 5437 | 289 | const char *title, const char *primary, |
| 290 | const char *secondary, GCallback cb, | |
| 291 | void *user_data); | |
| 292 | ||
| 293 | /** | |
| 294 | * Displays a single e-mail notification to the user. | |
| 295 | * | |
| 296 | * @param handle The plugin or connection handle. | |
| 297 | * @param subject The subject of the e-mail. | |
| 298 | * @param from The from address. | |
| 299 | * @param to The destination address. | |
| 300 | * @param url The URL where the message can be read. | |
| 301 | * @param cb The callback to call when the user closes | |
| 302 | * the notification. | |
| 303 | * @param user_data The data to pass to the callback. | |
| 304 | * | |
| 305 | * @return A UI-specific handle. | |
| 306 | */ | |
| 307 | void *gaim_notify_email(void *handle, const char *subject, | |
| 308 | const char *from, const char *to, | |
| 309 | const char *url, GCallback cb, | |
| 310 | void *user_data); | |
| 311 | ||
| 312 | /** | |
| 313 | * Displays a notification for multiple e-mails to the user. | |
| 314 | * | |
| 315 | * @param handle The plugin or connection handle. | |
| 316 | * @param count The number of e-mails. | |
|
5522
faa69c8f503d
[gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents:
5497
diff
changeset
|
317 | * @param detailed @c TRUE if there is information for each e-mail in the |
|
faa69c8f503d
[gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents:
5497
diff
changeset
|
318 | * arrays. |
| 5437 | 319 | * @param subjects The array of subjects. |
| 320 | * @param froms The array of from addresses. | |
| 321 | * @param tos The array of destination addresses. | |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6467
diff
changeset
|
322 | * @param urls The URLs where the messages can be read. |
| 5437 | 323 | * @param cb The callback to call when the user closes |
| 324 | * the notification. | |
| 325 | * @param user_data The data to pass to the callback. | |
| 326 | * | |
| 327 | * @return A UI-specific handle. | |
| 328 | */ | |
|
5522
faa69c8f503d
[gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents:
5497
diff
changeset
|
329 | void *gaim_notify_emails(void *handle, size_t count, gboolean detailed, |
| 5437 | 330 | const char **subjects, const char **froms, |
| 331 | const char **tos, const char **urls, | |
| 332 | GCallback cb, void *user_data); | |
| 333 | ||
| 334 | /** | |
|
6381
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
335 | * Displays a notification with formatted text. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
336 | * |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
337 | * The text is essentially a stripped-down format of HTML, the same that |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
338 | * IMs may send. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
339 | * |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
340 | * @param handle The plugin or connection handle. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
341 | * @param title The title of the message. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
342 | * @param primary The main point of the message. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
343 | * @param secondary The secondary information. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
344 | * @param text The formatted text. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
345 | * @param cb The callback to call when the user closes |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
346 | * the notification. |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6467
diff
changeset
|
347 | * @param user_data The data to pass to the callback. |
|
6381
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
348 | * |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
349 | * @return A UI-specific handle. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
350 | */ |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
351 | void *gaim_notify_formatted(void *handle, const char *title, |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
352 | const char *primary, const char *secondary, |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
353 | const char *text, GCallback cb, void *user_data); |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
354 | |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
355 | /** |
|
9800
1115830011b8
[gaim-migrate @ 10668]
Mark Doliner <markdoliner@pidgin.im>
parents:
9797
diff
changeset
|
356 | * Displays user information with formatted text, passing information giving |
|
1115830011b8
[gaim-migrate @ 10668]
Mark Doliner <markdoliner@pidgin.im>
parents:
9797
diff
changeset
|
357 | * the connection and username from which the user information came. |
| 9797 | 358 | * |
| 359 | * The text is essentially a stripped-down format of HTML, the same that | |
| 360 | * IMs may send. | |
| 361 | * | |
|
11533
f58436975d44
[gaim-migrate @ 13782]
Richard Laager <rlaager@pidgin.im>
parents:
11531
diff
changeset
|
362 | * @param gc The GaimConnection handle associated with the information. |
|
f58436975d44
[gaim-migrate @ 13782]
Richard Laager <rlaager@pidgin.im>
parents:
11531
diff
changeset
|
363 | * @param who The username associated with the information. |
| 9797 | 364 | * @param text The formatted text. |
| 365 | * @param cb The callback to call when the user closes | |
| 366 | * the notification. | |
| 367 | * @param user_data The data to pass to the callback. | |
| 368 | * | |
| 369 | * @return A UI-specific handle. | |
| 370 | */ | |
| 371 | void *gaim_notify_userinfo(GaimConnection *gc, const char *who, | |
|
11531
63c017cfd8d2
[gaim-migrate @ 13780]
Luke Schierer <lschiere@pidgin.im>
parents:
11501
diff
changeset
|
372 | const char *text, GCallback cb, |
|
63c017cfd8d2
[gaim-migrate @ 13780]
Luke Schierer <lschiere@pidgin.im>
parents:
11501
diff
changeset
|
373 | void *user_data); |
| 9797 | 374 | |
| 375 | /** | |
|
6465
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
376 | * Opens a URI or somehow presents it to the user. |
|
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
377 | * |
|
10240
09342bc554d9
[gaim-migrate @ 11377]
Herman Bloggs <herman@bluedigits.com>
parents:
10209
diff
changeset
|
378 | * @param handle The plugin or connection handle. |
|
09342bc554d9
[gaim-migrate @ 11377]
Herman Bloggs <herman@bluedigits.com>
parents:
10209
diff
changeset
|
379 | * @param uri The URI to display or go to. |
|
6465
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
380 | * |
|
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
381 | * @return A UI-specific handle, if any. This may only be presented if |
|
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
382 | * the UI code displays a dialog instead of a webpage, or something |
|
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
383 | * similar. |
|
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
384 | */ |
|
10240
09342bc554d9
[gaim-migrate @ 11377]
Herman Bloggs <herman@bluedigits.com>
parents:
10209
diff
changeset
|
385 | void *gaim_notify_uri(void *handle, const char *uri); |
|
6465
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
386 | |
|
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
387 | /** |
| 5437 | 388 | * Closes a notification. |
| 389 | * | |
| 390 | * This should be used only by the UI operation functions and part of the | |
| 391 | * core. | |
| 392 | * | |
|
5476
6f863ea68018
[gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents:
5437
diff
changeset
|
393 | * @param type The notification type. |
|
6f863ea68018
[gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents:
5437
diff
changeset
|
394 | * @param ui_handle The notification UI handle. |
| 5437 | 395 | */ |
|
5476
6f863ea68018
[gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents:
5437
diff
changeset
|
396 | void gaim_notify_close(GaimNotifyType type, void *ui_handle); |
| 5437 | 397 | |
| 398 | /** | |
| 399 | * Closes all notifications registered with the specified handle. | |
| 400 | * | |
| 401 | * @param handle The handle. | |
| 402 | */ | |
| 403 | void gaim_notify_close_with_handle(void *handle); | |
| 404 | ||
| 405 | /** | |
| 406 | * A wrapper for gaim_notify_message that displays an information message. | |
| 407 | */ | |
| 408 | #define gaim_notify_info(handle, title, primary, secondary) \ | |
| 409 | gaim_notify_message((handle), GAIM_NOTIFY_MSG_INFO, (title), \ | |
| 410 | (primary), (secondary), NULL, NULL) | |
| 411 | ||
| 412 | /** | |
| 413 | * A wrapper for gaim_notify_message that displays a warning message. | |
| 414 | */ | |
| 415 | #define gaim_notify_warning(handle, title, primary, secondary) \ | |
| 416 | gaim_notify_message((handle), GAIM_NOTIFY_MSG_WARNING, (title), \ | |
| 417 | (primary), (secondary), NULL, NULL) | |
| 418 | ||
| 419 | /** | |
| 420 | * A wrapper for gaim_notify_message that displays an error message. | |
| 421 | */ | |
| 422 | #define gaim_notify_error(handle, title, primary, secondary) \ | |
| 423 | gaim_notify_message((handle), GAIM_NOTIFY_MSG_ERROR, (title), \ | |
| 424 | (primary), (secondary), NULL, NULL) | |
| 425 | ||
| 426 | /*@}*/ | |
| 427 | ||
| 428 | /**************************************************************************/ | |
| 10566 | 429 | /** @name UI Registration Functions */ |
| 5437 | 430 | /**************************************************************************/ |
| 431 | /*@{*/ | |
| 432 | ||
| 433 | /** | |
| 434 | * Sets the UI operations structure to be used when displaying a | |
| 435 | * notification. | |
| 436 | * | |
| 437 | * @param ops The UI operations structure. | |
| 438 | */ | |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
439 | void gaim_notify_set_ui_ops(GaimNotifyUiOps *ops); |
| 5437 | 440 | |
| 441 | /** | |
| 442 | * Returns the UI operations structure to be used when displaying a | |
| 443 | * notification. | |
| 444 | * | |
|
6467
754d318cac4a
[gaim-migrate @ 6976]
Christian Hammond <chipx86@chipx86.com>
parents:
6465
diff
changeset
|
445 | * @return The UI operations structure. |
| 5437 | 446 | */ |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
447 | GaimNotifyUiOps *gaim_notify_get_ui_ops(void); |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
448 | |
|
5497
da3c08f3af25
[gaim-migrate @ 5893]
Mark Doliner <markdoliner@pidgin.im>
parents:
5476
diff
changeset
|
449 | /*@}*/ |
| 5437 | 450 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
451 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
452 | } |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
453 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
454 | |
| 5437 | 455 | #endif /* _GAIM_NOTIFY_H_ */ |