Mon, 21 Aug 2006 05:25:44 +0000
[gaim-migrate @ 16944]
Rename GaimProxyConnectInfo to GaimProxyConnectData, and change the
variables from connect_info to connect_data. Sorry, but I wanted
to get this right before it becomes permanent.
| 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 | ||
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
34 | |
| 5437 | 35 | /** |
|
12242
e7fc1748eb56
[gaim-migrate @ 14544]
Richard Laager <rlaager@pidgin.im>
parents:
12220
diff
changeset
|
36 | * Notification close callbacks. |
|
e7fc1748eb56
[gaim-migrate @ 14544]
Richard Laager <rlaager@pidgin.im>
parents:
12220
diff
changeset
|
37 | */ |
|
e7fc1748eb56
[gaim-migrate @ 14544]
Richard Laager <rlaager@pidgin.im>
parents:
12220
diff
changeset
|
38 | typedef void (*GaimNotifyCloseCallback) (gpointer user_data); |
|
e7fc1748eb56
[gaim-migrate @ 14544]
Richard Laager <rlaager@pidgin.im>
parents:
12220
diff
changeset
|
39 | |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
40 | |
|
12242
e7fc1748eb56
[gaim-migrate @ 14544]
Richard Laager <rlaager@pidgin.im>
parents:
12220
diff
changeset
|
41 | /** |
| 5437 | 42 | * Notification types. |
| 43 | */ | |
| 44 | typedef enum | |
| 45 | { | |
|
10439
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
46 | GAIM_NOTIFY_MESSAGE = 0, /**< Message notification. */ |
|
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
47 | GAIM_NOTIFY_EMAIL, /**< Single e-mail notification. */ |
|
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
48 | GAIM_NOTIFY_EMAILS, /**< Multiple e-mail notification. */ |
|
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
49 | GAIM_NOTIFY_FORMATTED, /**< Formatted text. */ |
|
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
50 | GAIM_NOTIFY_SEARCHRESULTS, /**< Buddy search results. */ |
|
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
51 | GAIM_NOTIFY_USERINFO, /**< Formatted userinfo text. */ |
|
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
52 | GAIM_NOTIFY_URI /**< URI notification or display. */ |
| 5437 | 53 | |
| 54 | } GaimNotifyType; | |
| 55 | ||
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
56 | |
| 5437 | 57 | /** |
| 58 | * Notification message types. | |
| 59 | */ | |
| 60 | typedef enum | |
| 61 | { | |
| 62 | GAIM_NOTIFY_MSG_ERROR = 0, /**< Error notification. */ | |
| 63 | GAIM_NOTIFY_MSG_WARNING, /**< Warning notification. */ | |
| 64 | GAIM_NOTIFY_MSG_INFO /**< Information notification. */ | |
| 65 | ||
| 66 | } GaimNotifyMsgType; | |
| 67 | ||
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
68 | |
| 5437 | 69 | /** |
| 11359 | 70 | * The types of buttons |
| 71 | */ | |
| 72 | typedef enum | |
| 73 | { | |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
74 | GAIM_NOTIFY_BUTTON_LABELED = 0, /**< special use, see _button_add_labeled */ |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
75 | GAIM_NOTIFY_BUTTON_CONTINUE = 1, |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
76 | GAIM_NOTIFY_BUTTON_ADD, |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
77 | GAIM_NOTIFY_BUTTON_INFO, |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
78 | GAIM_NOTIFY_BUTTON_IM, |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
79 | GAIM_NOTIFY_BUTTON_JOIN, |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
80 | GAIM_NOTIFY_BUTTON_INVITE |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
81 | } GaimNotifySearchButtonType; |
| 11359 | 82 | |
| 83 | ||
| 84 | /** | |
| 85 | * Search results object. | |
| 86 | */ | |
| 87 | typedef struct | |
| 88 | { | |
| 89 | GList *columns; /**< List of the search column objects. */ | |
| 90 | GList *rows; /**< List of rows in the result. */ | |
| 91 | GList *buttons; /**< List of buttons to display. */ | |
| 92 | ||
| 93 | } GaimNotifySearchResults; | |
| 94 | ||
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
95 | |
| 11359 | 96 | /** |
| 97 | * Single column of a search result. | |
| 98 | */ | |
| 99 | typedef struct | |
| 100 | { | |
| 101 | char *title; /**< Title of the column. */ | |
| 102 | ||
| 103 | } GaimNotifySearchColumn; | |
| 104 | ||
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
105 | |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
106 | /** |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
107 | * Callback for a button in a search result. |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
108 | * |
| 13641 | 109 | * @param c the GaimConnection passed to gaim_notify_searchresults |
| 110 | * @param row the contents of the selected row | |
| 111 | * @param user_data User defined data. | |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
112 | */ |
| 13641 | 113 | typedef void (*GaimNotifySearchResultsCallback)(GaimConnection *c, GList *row, |
| 114 | gpointer user_data); | |
| 11359 | 115 | |
| 116 | ||
| 117 | /** | |
| 118 | * Definition of a button. | |
| 119 | */ | |
| 120 | typedef struct | |
| 121 | { | |
| 122 | GaimNotifySearchButtonType type; | |
| 123 | GaimNotifySearchResultsCallback callback; /**< Function to be called when clicked. */ | |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
124 | char *label; /**< only for GAIM_NOTIFY_BUTTON_LABELED */ |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
125 | } GaimNotifySearchButton; |
| 11359 | 126 | |
| 127 | ||
| 128 | /** | |
| 5437 | 129 | * Notification UI operations. |
| 130 | */ | |
| 131 | typedef struct | |
| 132 | { | |
| 133 | void *(*notify_message)(GaimNotifyMsgType type, const char *title, | |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
134 | const char *primary, const char *secondary); |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
135 | |
|
12647
b00d9913117e
[gaim-migrate @ 14985]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12625
diff
changeset
|
136 | void *(*notify_email)(GaimConnection *gc, |
|
b00d9913117e
[gaim-migrate @ 14985]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12625
diff
changeset
|
137 | const char *subject, const char *from, |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
138 | const char *to, const char *url); |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
139 | |
|
12647
b00d9913117e
[gaim-migrate @ 14985]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12625
diff
changeset
|
140 | void *(*notify_emails)(GaimConnection *gc, |
|
b00d9913117e
[gaim-migrate @ 14985]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12625
diff
changeset
|
141 | size_t count, gboolean detailed, |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
142 | const char **subjects, const char **froms, |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
143 | const char **tos, const char **urls); |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
144 | |
|
6381
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
145 | void *(*notify_formatted)(const char *title, const char *primary, |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
146 | const char *secondary, const char *text); |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
147 | |
|
10439
5868d8f55fb1
[gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents:
10240
diff
changeset
|
148 | void *(*notify_searchresults)(GaimConnection *gc, const char *title, |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
149 | const char *primary, const char *secondary, |
| 13641 | 150 | GaimNotifySearchResults *results, gpointer user_data); |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
151 | |
| 11359 | 152 | void (*notify_searchresults_new_rows)(GaimConnection *gc, |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
153 | GaimNotifySearchResults *results, |
| 13641 | 154 | void *data); |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
155 | |
| 9797 | 156 | void *(*notify_userinfo)(GaimConnection *gc, const char *who, |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
157 | const char *text); |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
158 | |
|
10240
09342bc554d9
[gaim-migrate @ 11377]
Herman Bloggs <herman@bluedigits.com>
parents:
10209
diff
changeset
|
159 | void *(*notify_uri)(const char *uri); |
| 5437 | 160 | |
|
5476
6f863ea68018
[gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents:
5437
diff
changeset
|
161 | void (*close_notify)(GaimNotifyType type, void *ui_handle); |
| 5437 | 162 | |
| 163 | } GaimNotifyUiOps; | |
| 164 | ||
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
165 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
166 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
167 | extern "C" { |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
168 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
169 | |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
170 | |
| 5437 | 171 | /**************************************************************************/ |
| 11359 | 172 | /** Search results notification API */ |
| 173 | /**************************************************************************/ | |
| 174 | /*@{*/ | |
| 175 | ||
| 176 | /** | |
| 177 | * Displays results from a buddy search. This can be, for example, | |
| 178 | * a window with a list of all found buddies, where you are given the | |
| 179 | * option of adding buddies to your buddy list. | |
| 180 | * | |
| 181 | * @param gc The GaimConnection handle associated with the information. | |
| 182 | * @param title The title of the message. If this is NULL, the title | |
|
12259
23c20f8ffbef
[gaim-migrate @ 14561]
Richard Laager <rlaager@pidgin.im>
parents:
12257
diff
changeset
|
183 | * will be "Search Results." |
| 11359 | 184 | * @param primary The main point of the message. |
| 185 | * @param secondary The secondary information. | |
| 186 | * @param results The GaimNotifySearchResults instance. | |
| 187 | * @param cb The callback to call when the user closes | |
| 188 | * the notification. | |
| 13641 | 189 | * @param user_data The data to pass to the close callback and any other |
| 190 | * callback associated with a button. | |
| 11359 | 191 | * |
| 192 | * @return A UI-specific handle. | |
| 193 | */ | |
| 194 | void *gaim_notify_searchresults(GaimConnection *gc, const char *title, | |
| 195 | const char *primary, const char *secondary, | |
|
12242
e7fc1748eb56
[gaim-migrate @ 14544]
Richard Laager <rlaager@pidgin.im>
parents:
12220
diff
changeset
|
196 | GaimNotifySearchResults *results, GaimNotifyCloseCallback cb, |
| 12220 | 197 | gpointer user_data); |
| 11359 | 198 | |
| 199 | void gaim_notify_searchresults_free(GaimNotifySearchResults *results); | |
| 200 | ||
| 201 | /** | |
| 202 | * Replace old rows with the new. Reuse an existing window. | |
| 203 | * | |
| 204 | * @param gc The GaimConnection structure. | |
| 205 | * @param results The GaimNotifySearchResults structure. | |
| 206 | * @param data Data returned by the gaim_notify_searchresults(). | |
| 207 | */ | |
| 208 | void gaim_notify_searchresults_new_rows(GaimConnection *gc, | |
| 209 | GaimNotifySearchResults *results, | |
| 13641 | 210 | void *data); |
| 11359 | 211 | |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
212 | |
| 11359 | 213 | /** |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
214 | * Adds a stock button that will be displayed in the search results dialog. |
| 11359 | 215 | * |
| 216 | * @param results The search results object. | |
| 217 | * @param type Type of the button. (TODO: Only one button of a given type can be displayed.) | |
| 218 | * @param cb Function that will be called on the click event. | |
| 219 | */ | |
| 220 | void gaim_notify_searchresults_button_add(GaimNotifySearchResults *results, | |
| 221 | GaimNotifySearchButtonType type, | |
| 222 | GaimNotifySearchResultsCallback cb); | |
| 223 | ||
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
224 | |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
225 | /** |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
226 | * Adds a plain labelled button that will be displayed in the search results dialog. |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
227 | * |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
228 | * @param results The search results object |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
229 | * @param label The label to display |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
230 | * @param cb Function that will be called on the click event |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
231 | */ |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
232 | void gaim_notify_searchresults_button_add_labeled(GaimNotifySearchResults *results, |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
233 | const char *label, |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
234 | GaimNotifySearchResultsCallback cb); |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
235 | |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12323
diff
changeset
|
236 | |
| 11359 | 237 | /** |
| 238 | * Returns a newly created search results object. | |
| 239 | * | |
| 240 | * @return The new search results object. | |
| 241 | */ | |
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
12259
diff
changeset
|
242 | GaimNotifySearchResults *gaim_notify_searchresults_new(void); |
| 11359 | 243 | |
| 244 | /** | |
| 245 | * Returns a newly created search result column object. | |
| 246 | * | |
| 247 | * @param title Title of the column. NOTE: Title will get g_strdup()ed. | |
| 248 | * | |
| 249 | * @return The new search column object. | |
| 250 | */ | |
| 251 | GaimNotifySearchColumn *gaim_notify_searchresults_column_new(const char *title); | |
| 252 | ||
| 253 | /** | |
| 254 | * Adds a new column to the search result object. | |
| 255 | * | |
| 256 | * @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
|
257 | * @param column The column that will be added to the result object. |
| 11359 | 258 | */ |
| 259 | void gaim_notify_searchresults_column_add(GaimNotifySearchResults *results, | |
| 260 | GaimNotifySearchColumn *column); | |
| 261 | ||
| 262 | /** | |
| 263 | * Adds a new row of the results to the search results object. | |
| 264 | * | |
| 265 | * @param results The search results object. | |
| 266 | * @param row The row of the results. | |
| 267 | */ | |
| 268 | void gaim_notify_searchresults_row_add(GaimNotifySearchResults *results, | |
| 269 | GList *row); | |
| 270 | ||
| 271 | /** | |
| 272 | * Returns a number of the rows in the search results object. | |
| 273 | * | |
| 274 | * @param results The search results object. | |
| 275 | * | |
| 12257 | 276 | * @return Number of the result rows. |
| 11359 | 277 | */ |
| 12257 | 278 | guint gaim_notify_searchresults_get_rows_count(GaimNotifySearchResults *results); |
| 11359 | 279 | |
| 280 | /** | |
| 281 | * Returns a number of the columns in the search results object. | |
| 282 | * | |
| 283 | * @param results The search results object. | |
| 284 | * | |
| 12257 | 285 | * @return Number of the columns. |
| 11359 | 286 | */ |
| 12257 | 287 | guint gaim_notify_searchresults_get_columns_count(GaimNotifySearchResults *results); |
| 11359 | 288 | |
| 289 | /** | |
| 290 | * Returns a row of the results from the search results object. | |
| 291 | * | |
| 292 | * @param results The search results object. | |
| 293 | * @param row_id Index of the row to be returned. | |
| 294 | * | |
| 295 | * @return Row of the results. | |
| 296 | */ | |
| 297 | GList *gaim_notify_searchresults_row_get(GaimNotifySearchResults *results, | |
| 298 | unsigned int row_id); | |
| 299 | ||
| 300 | /** | |
| 301 | * Returns a title of the search results object's column. | |
| 302 | * | |
| 303 | * @param results The search results object. | |
| 304 | * @param column_id Index of the column. | |
| 305 | * | |
| 306 | * @return Title of the column. | |
| 307 | */ | |
| 308 | char *gaim_notify_searchresults_column_get_title(GaimNotifySearchResults *results, | |
| 309 | unsigned int column_id); | |
| 310 | ||
| 311 | /*@}*/ | |
| 312 | ||
| 313 | /**************************************************************************/ | |
| 5437 | 314 | /** @name Notification API */ |
| 315 | /**************************************************************************/ | |
| 316 | /*@{*/ | |
| 317 | ||
| 318 | /** | |
| 319 | * Displays a notification message to the user. | |
| 320 | * | |
| 321 | * @param handle The plugin or connection handle. | |
| 322 | * @param type The notification type. | |
| 323 | * @param title The title of the message. | |
| 324 | * @param primary The main point of the message. | |
| 325 | * @param secondary The secondary information. | |
| 326 | * @param cb The callback to call when the user closes | |
| 327 | * the notification. | |
| 328 | * @param user_data The data to pass to the callback. | |
| 329 | * | |
| 330 | * @return A UI-specific handle. | |
| 331 | */ | |
|
6356
27990c4f9a9f
[gaim-migrate @ 6855]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
332 | void *gaim_notify_message(void *handle, GaimNotifyMsgType type, |
| 5437 | 333 | const char *title, const char *primary, |
|
12242
e7fc1748eb56
[gaim-migrate @ 14544]
Richard Laager <rlaager@pidgin.im>
parents:
12220
diff
changeset
|
334 | const char *secondary, GaimNotifyCloseCallback cb, |
| 12220 | 335 | gpointer user_data); |
| 5437 | 336 | |
| 337 | /** | |
| 338 | * Displays a single e-mail notification to the user. | |
| 339 | * | |
| 340 | * @param handle The plugin or connection handle. | |
| 341 | * @param subject The subject of the e-mail. | |
| 342 | * @param from The from address. | |
| 343 | * @param to The destination address. | |
| 344 | * @param url The URL where the message can be read. | |
| 345 | * @param cb The callback to call when the user closes | |
| 346 | * the notification. | |
| 347 | * @param user_data The data to pass to the callback. | |
| 348 | * | |
| 349 | * @return A UI-specific handle. | |
| 350 | */ | |
| 351 | void *gaim_notify_email(void *handle, const char *subject, | |
| 352 | const char *from, const char *to, | |
|
12242
e7fc1748eb56
[gaim-migrate @ 14544]
Richard Laager <rlaager@pidgin.im>
parents:
12220
diff
changeset
|
353 | const char *url, GaimNotifyCloseCallback cb, |
| 12220 | 354 | gpointer user_data); |
| 5437 | 355 | |
| 356 | /** | |
| 357 | * Displays a notification for multiple e-mails to the user. | |
| 358 | * | |
| 359 | * @param handle The plugin or connection handle. | |
| 360 | * @param count The number of e-mails. | |
|
5522
faa69c8f503d
[gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents:
5497
diff
changeset
|
361 | * @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
|
362 | * arrays. |
| 5437 | 363 | * @param subjects The array of subjects. |
| 364 | * @param froms The array of from addresses. | |
| 365 | * @param tos The array of destination addresses. | |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6467
diff
changeset
|
366 | * @param urls The URLs where the messages can be read. |
| 5437 | 367 | * @param cb The callback to call when the user closes |
| 368 | * the notification. | |
| 369 | * @param user_data The data to pass to the callback. | |
| 370 | * | |
| 371 | * @return A UI-specific handle. | |
| 372 | */ | |
|
5522
faa69c8f503d
[gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents:
5497
diff
changeset
|
373 | void *gaim_notify_emails(void *handle, size_t count, gboolean detailed, |
| 5437 | 374 | const char **subjects, const char **froms, |
| 375 | const char **tos, const char **urls, | |
|
12242
e7fc1748eb56
[gaim-migrate @ 14544]
Richard Laager <rlaager@pidgin.im>
parents:
12220
diff
changeset
|
376 | GaimNotifyCloseCallback cb, gpointer user_data); |
| 5437 | 377 | |
| 378 | /** | |
|
6381
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
379 | * Displays a notification with formatted text. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
380 | * |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
381 | * 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
|
382 | * IMs may send. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
383 | * |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
384 | * @param handle The plugin or connection handle. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
385 | * @param title The title of the message. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
386 | * @param primary The main point of the message. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
387 | * @param secondary The secondary information. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
388 | * @param text The formatted text. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
389 | * @param cb The callback to call when the user closes |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
390 | * the notification. |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6467
diff
changeset
|
391 | * @param user_data The data to pass to the callback. |
|
6381
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
392 | * |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
393 | * @return A UI-specific handle. |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
394 | */ |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
395 | void *gaim_notify_formatted(void *handle, const char *title, |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
396 | const char *primary, const char *secondary, |
|
12242
e7fc1748eb56
[gaim-migrate @ 14544]
Richard Laager <rlaager@pidgin.im>
parents:
12220
diff
changeset
|
397 | const char *text, GaimNotifyCloseCallback cb, gpointer user_data); |
|
6381
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
398 | |
|
53203c44c731
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6356
diff
changeset
|
399 | /** |
|
9800
1115830011b8
[gaim-migrate @ 10668]
Mark Doliner <markdoliner@pidgin.im>
parents:
9797
diff
changeset
|
400 | * Displays user information with formatted text, passing information giving |
|
1115830011b8
[gaim-migrate @ 10668]
Mark Doliner <markdoliner@pidgin.im>
parents:
9797
diff
changeset
|
401 | * the connection and username from which the user information came. |
| 9797 | 402 | * |
| 403 | * The text is essentially a stripped-down format of HTML, the same that | |
| 404 | * IMs may send. | |
| 405 | * | |
|
11533
f58436975d44
[gaim-migrate @ 13782]
Richard Laager <rlaager@pidgin.im>
parents:
11531
diff
changeset
|
406 | * @param gc The GaimConnection handle associated with the information. |
|
f58436975d44
[gaim-migrate @ 13782]
Richard Laager <rlaager@pidgin.im>
parents:
11531
diff
changeset
|
407 | * @param who The username associated with the information. |
| 9797 | 408 | * @param text The formatted text. |
| 409 | * @param cb The callback to call when the user closes | |
| 410 | * the notification. | |
| 411 | * @param user_data The data to pass to the callback. | |
| 412 | * | |
| 413 | * @return A UI-specific handle. | |
| 414 | */ | |
| 415 | void *gaim_notify_userinfo(GaimConnection *gc, const char *who, | |
|
12242
e7fc1748eb56
[gaim-migrate @ 14544]
Richard Laager <rlaager@pidgin.im>
parents:
12220
diff
changeset
|
416 | const char *text, GaimNotifyCloseCallback cb, |
| 12220 | 417 | gpointer user_data); |
| 9797 | 418 | |
| 419 | /** | |
|
6465
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
420 | * Opens a URI or somehow presents it to the user. |
|
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
421 | * |
|
10240
09342bc554d9
[gaim-migrate @ 11377]
Herman Bloggs <herman@bluedigits.com>
parents:
10209
diff
changeset
|
422 | * @param handle The plugin or connection handle. |
|
09342bc554d9
[gaim-migrate @ 11377]
Herman Bloggs <herman@bluedigits.com>
parents:
10209
diff
changeset
|
423 | * @param uri The URI to display or go to. |
|
6465
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
424 | * |
|
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
425 | * @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
|
426 | * 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
|
427 | * similar. |
|
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
428 | */ |
|
10240
09342bc554d9
[gaim-migrate @ 11377]
Herman Bloggs <herman@bluedigits.com>
parents:
10209
diff
changeset
|
429 | void *gaim_notify_uri(void *handle, const char *uri); |
|
6465
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
430 | |
|
bd201d637ff4
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
431 | /** |
| 5437 | 432 | * Closes a notification. |
| 433 | * | |
| 434 | * This should be used only by the UI operation functions and part of the | |
| 435 | * core. | |
| 436 | * | |
|
5476
6f863ea68018
[gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents:
5437
diff
changeset
|
437 | * @param type The notification type. |
|
6f863ea68018
[gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents:
5437
diff
changeset
|
438 | * @param ui_handle The notification UI handle. |
| 5437 | 439 | */ |
|
5476
6f863ea68018
[gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents:
5437
diff
changeset
|
440 | void gaim_notify_close(GaimNotifyType type, void *ui_handle); |
| 5437 | 441 | |
| 442 | /** | |
| 443 | * Closes all notifications registered with the specified handle. | |
| 444 | * | |
| 445 | * @param handle The handle. | |
| 446 | */ | |
| 447 | void gaim_notify_close_with_handle(void *handle); | |
| 448 | ||
| 449 | /** | |
| 450 | * A wrapper for gaim_notify_message that displays an information message. | |
| 451 | */ | |
| 452 | #define gaim_notify_info(handle, title, primary, secondary) \ | |
| 453 | gaim_notify_message((handle), GAIM_NOTIFY_MSG_INFO, (title), \ | |
| 454 | (primary), (secondary), NULL, NULL) | |
| 455 | ||
| 456 | /** | |
| 457 | * A wrapper for gaim_notify_message that displays a warning message. | |
| 458 | */ | |
| 459 | #define gaim_notify_warning(handle, title, primary, secondary) \ | |
| 460 | gaim_notify_message((handle), GAIM_NOTIFY_MSG_WARNING, (title), \ | |
| 461 | (primary), (secondary), NULL, NULL) | |
| 462 | ||
| 463 | /** | |
| 464 | * A wrapper for gaim_notify_message that displays an error message. | |
| 465 | */ | |
| 466 | #define gaim_notify_error(handle, title, primary, secondary) \ | |
| 467 | gaim_notify_message((handle), GAIM_NOTIFY_MSG_ERROR, (title), \ | |
| 468 | (primary), (secondary), NULL, NULL) | |
| 469 | ||
| 470 | /*@}*/ | |
| 471 | ||
| 472 | /**************************************************************************/ | |
| 10566 | 473 | /** @name UI Registration Functions */ |
| 5437 | 474 | /**************************************************************************/ |
| 475 | /*@{*/ | |
| 476 | ||
| 477 | /** | |
| 478 | * Sets the UI operations structure to be used when displaying a | |
| 479 | * notification. | |
| 480 | * | |
| 481 | * @param ops The UI operations structure. | |
| 482 | */ | |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
483 | void gaim_notify_set_ui_ops(GaimNotifyUiOps *ops); |
| 5437 | 484 | |
| 485 | /** | |
| 486 | * Returns the UI operations structure to be used when displaying a | |
| 487 | * notification. | |
| 488 | * | |
|
6467
754d318cac4a
[gaim-migrate @ 6976]
Christian Hammond <chipx86@chipx86.com>
parents:
6465
diff
changeset
|
489 | * @return The UI operations structure. |
| 5437 | 490 | */ |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
491 | GaimNotifyUiOps *gaim_notify_get_ui_ops(void); |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
492 | |
|
5497
da3c08f3af25
[gaim-migrate @ 5893]
Mark Doliner <markdoliner@pidgin.im>
parents:
5476
diff
changeset
|
493 | /*@}*/ |
| 5437 | 494 | |
| 12129 | 495 | /**************************************************************************/ |
| 496 | /** @name Notify Subsystem */ | |
| 497 | /**************************************************************************/ | |
| 498 | /*@{*/ | |
| 499 | ||
| 500 | /** | |
| 501 | * Returns the notify subsystem handle. | |
| 502 | * | |
| 503 | * @return The notify subsystem handle. | |
| 504 | */ | |
| 505 | void *gaim_notify_get_handle(void); | |
| 506 | ||
| 507 | /** | |
| 508 | * Initializes the notify subsystem. | |
| 509 | */ | |
| 510 | void gaim_notify_init(void); | |
| 511 | ||
| 512 | /** | |
| 513 | * Uninitializes the notify subsystem. | |
| 514 | */ | |
| 515 | void gaim_notify_uninit(void); | |
| 516 | ||
| 517 | /*@}*/ | |
| 518 | ||
| 519 | ||
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
520 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
521 | } |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
522 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5522
diff
changeset
|
523 | |
| 5437 | 524 | #endif /* _GAIM_NOTIFY_H_ */ |