00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _PURPLE_NOTIFY_H_
00028 #define _PURPLE_NOTIFY_H_
00029
00030 #include <stdlib.h>
00031 #include <glib-object.h>
00032 #include <glib.h>
00033
00034 typedef struct _PurpleNotifyUserInfoEntry PurpleNotifyUserInfoEntry;
00035 typedef struct _PurpleNotifyUserInfo PurpleNotifyUserInfo;
00036
00037 #include "connection.h"
00038
00042 typedef void (*PurpleNotifyCloseCallback) (gpointer user_data);
00043
00044
00048 typedef enum
00049 {
00050 PURPLE_NOTIFY_MESSAGE = 0,
00051 PURPLE_NOTIFY_EMAIL,
00052 PURPLE_NOTIFY_EMAILS,
00053 PURPLE_NOTIFY_FORMATTED,
00054 PURPLE_NOTIFY_SEARCHRESULTS,
00055 PURPLE_NOTIFY_USERINFO,
00056 PURPLE_NOTIFY_URI
00058 } PurpleNotifyType;
00059
00060
00064 typedef enum
00065 {
00066 PURPLE_NOTIFY_MSG_ERROR = 0,
00067 PURPLE_NOTIFY_MSG_WARNING,
00068 PURPLE_NOTIFY_MSG_INFO
00070 } PurpleNotifyMsgType;
00071
00072
00076 typedef enum
00077 {
00078 PURPLE_NOTIFY_BUTTON_LABELED = 0,
00079 PURPLE_NOTIFY_BUTTON_CONTINUE = 1,
00080 PURPLE_NOTIFY_BUTTON_ADD,
00081 PURPLE_NOTIFY_BUTTON_INFO,
00082 PURPLE_NOTIFY_BUTTON_IM,
00083 PURPLE_NOTIFY_BUTTON_JOIN,
00084 PURPLE_NOTIFY_BUTTON_INVITE
00085 } PurpleNotifySearchButtonType;
00086
00087
00091 typedef struct
00092 {
00093 GList *columns;
00094 GList *rows;
00095 GList *buttons;
00097 } PurpleNotifySearchResults;
00098
00102 typedef enum
00103 {
00104 PURPLE_NOTIFY_USER_INFO_ENTRY_PAIR = 0,
00105 PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK,
00106 PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER
00107 } PurpleNotifyUserInfoEntryType;
00108
00112 typedef struct
00113 {
00114 char *title;
00116 } PurpleNotifySearchColumn;
00117
00118
00126 typedef void (*PurpleNotifySearchResultsCallback)(PurpleConnection *c, GList *row,
00127 gpointer user_data);
00128
00129
00133 typedef struct
00134 {
00135 PurpleNotifySearchButtonType type;
00136 PurpleNotifySearchResultsCallback callback;
00137 char *label;
00138 } PurpleNotifySearchButton;
00139
00140
00144 typedef struct
00145 {
00146 void *(*notify_message)(PurpleNotifyMsgType type, const char *title,
00147 const char *primary, const char *secondary);
00148
00149 void *(*notify_email)(PurpleConnection *gc,
00150 const char *subject, const char *from,
00151 const char *to, const char *url);
00152
00153 void *(*notify_emails)(PurpleConnection *gc,
00154 size_t count, gboolean detailed,
00155 const char **subjects, const char **froms,
00156 const char **tos, const char **urls);
00157
00158 void *(*notify_formatted)(const char *title, const char *primary,
00159 const char *secondary, const char *text);
00160
00161 void *(*notify_searchresults)(PurpleConnection *gc, const char *title,
00162 const char *primary, const char *secondary,
00163 PurpleNotifySearchResults *results, gpointer user_data);
00164
00165 void (*notify_searchresults_new_rows)(PurpleConnection *gc,
00166 PurpleNotifySearchResults *results,
00167 void *data);
00168
00169 void *(*notify_userinfo)(PurpleConnection *gc, const char *who,
00170 PurpleNotifyUserInfo *user_info);
00171
00172 void *(*notify_uri)(const char *uri);
00173
00174 void (*close_notify)(PurpleNotifyType type, void *ui_handle);
00175
00176 void (*_purple_reserved1)(void);
00177 void (*_purple_reserved2)(void);
00178 void (*_purple_reserved3)(void);
00179 void (*_purple_reserved4)(void);
00180 } PurpleNotifyUiOps;
00181
00182
00183 #ifdef __cplusplus
00184 extern "C" {
00185 #endif
00186
00187
00188
00190
00211 void *purple_notify_searchresults(PurpleConnection *gc, const char *title,
00212 const char *primary, const char *secondary,
00213 PurpleNotifySearchResults *results, PurpleNotifyCloseCallback cb,
00214 gpointer user_data);
00215
00221 void purple_notify_searchresults_free(PurpleNotifySearchResults *results);
00222
00230 void purple_notify_searchresults_new_rows(PurpleConnection *gc,
00231 PurpleNotifySearchResults *results,
00232 void *data);
00233
00234
00242 void purple_notify_searchresults_button_add(PurpleNotifySearchResults *results,
00243 PurpleNotifySearchButtonType type,
00244 PurpleNotifySearchResultsCallback cb);
00245
00246
00254 void purple_notify_searchresults_button_add_labeled(PurpleNotifySearchResults *results,
00255 const char *label,
00256 PurpleNotifySearchResultsCallback cb);
00257
00258
00264 PurpleNotifySearchResults *purple_notify_searchresults_new(void);
00265
00273 PurpleNotifySearchColumn *purple_notify_searchresults_column_new(const char *title);
00274
00281 void purple_notify_searchresults_column_add(PurpleNotifySearchResults *results,
00282 PurpleNotifySearchColumn *column);
00283
00290 void purple_notify_searchresults_row_add(PurpleNotifySearchResults *results,
00291 GList *row);
00292 #ifndef PURPLE_DISABLE_DEPRECATED
00293
00310 guint purple_notify_searchresults_get_rows_count(PurpleNotifySearchResults *results);
00311 #endif
00312
00313 #ifndef PURPLE_DISABLE_DEPRECATED
00314
00331 guint purple_notify_searchresults_get_columns_count(PurpleNotifySearchResults *results);
00332 #endif
00333
00334 #ifndef PURPLE_DISABLE_DEPRECATED
00335
00353 GList *purple_notify_searchresults_row_get(PurpleNotifySearchResults *results,
00354 unsigned int row_id);
00355 #endif
00356
00357 #ifndef PURPLE_DISABLE_DEPRECATED
00358
00374 char *purple_notify_searchresults_column_get_title(PurpleNotifySearchResults *results,
00375 unsigned int column_id);
00376 #endif
00377
00380
00382
00399 void *purple_notify_message(void *handle, PurpleNotifyMsgType type,
00400 const char *title, const char *primary,
00401 const char *secondary, PurpleNotifyCloseCallback cb,
00402 gpointer user_data);
00403
00418 void *purple_notify_email(void *handle, const char *subject,
00419 const char *from, const char *to,
00420 const char *url, PurpleNotifyCloseCallback cb,
00421 gpointer user_data);
00422
00440 void *purple_notify_emails(void *handle, size_t count, gboolean detailed,
00441 const char **subjects, const char **froms,
00442 const char **tos, const char **urls,
00443 PurpleNotifyCloseCallback cb, gpointer user_data);
00444
00462 void *purple_notify_formatted(void *handle, const char *title,
00463 const char *primary, const char *secondary,
00464 const char *text, PurpleNotifyCloseCallback cb, gpointer user_data);
00465
00482 void *purple_notify_userinfo(PurpleConnection *gc, const char *who,
00483 PurpleNotifyUserInfo *user_info, PurpleNotifyCloseCallback cb,
00484 gpointer user_data);
00485
00491 PurpleNotifyUserInfo *purple_notify_user_info_new(void);
00492
00498 void purple_notify_user_info_destroy(PurpleNotifyUserInfo *user_info);
00499
00513 GList *purple_notify_user_info_get_entries(PurpleNotifyUserInfo *user_info);
00514
00521 char *purple_notify_user_info_get_text_with_newline(PurpleNotifyUserInfo *user_info, const char *newline);
00522
00534 void purple_notify_user_info_add_pair(PurpleNotifyUserInfo *user_info, const char *label, const char *value);
00535
00546 void purple_notify_user_info_prepend_pair(PurpleNotifyUserInfo *user_info, const char *label, const char *value);
00547
00554 void purple_notify_user_info_remove_entry(PurpleNotifyUserInfo *user_info, PurpleNotifyUserInfoEntry *user_info_entry);
00570 PurpleNotifyUserInfoEntry *purple_notify_user_info_entry_new(const char *label, const char *value);
00571
00577 void purple_notify_user_info_add_section_break(PurpleNotifyUserInfo *user_info);
00578
00585 void purple_notify_user_info_add_section_header(PurpleNotifyUserInfo *user_info, const char *label);
00586
00590 void purple_notify_user_info_remove_last_item(PurpleNotifyUserInfo *user_info);
00591
00599 const gchar *purple_notify_user_info_entry_get_label(PurpleNotifyUserInfoEntry *user_info_entry);
00600
00607 void purple_notify_user_info_entry_set_label(PurpleNotifyUserInfoEntry *user_info_entry, const char *label);
00608
00616 const gchar *purple_notify_user_info_entry_get_value(PurpleNotifyUserInfoEntry *user_info_entry);
00617
00624 void purple_notify_user_info_entry_set_value(PurpleNotifyUserInfoEntry *user_info_entry, const char *value);
00625
00626
00634 PurpleNotifyUserInfoEntryType purple_notify_user_info_entry_get_type(PurpleNotifyUserInfoEntry *user_info_entry);
00635
00642 void purple_notify_user_info_entry_set_type(PurpleNotifyUserInfoEntry *user_info_entry,
00643 PurpleNotifyUserInfoEntryType type);
00644
00655 void *purple_notify_uri(void *handle, const char *uri);
00656
00666 void purple_notify_close(PurpleNotifyType type, void *ui_handle);
00667
00673 void purple_notify_close_with_handle(void *handle);
00674
00678 #define purple_notify_info(handle, title, primary, secondary) \
00679 purple_notify_message((handle), PURPLE_NOTIFY_MSG_INFO, (title), \
00680 (primary), (secondary), NULL, NULL)
00681
00685 #define purple_notify_warning(handle, title, primary, secondary) \
00686 purple_notify_message((handle), PURPLE_NOTIFY_MSG_WARNING, (title), \
00687 (primary), (secondary), NULL, NULL)
00688
00692 #define purple_notify_error(handle, title, primary, secondary) \
00693 purple_notify_message((handle), PURPLE_NOTIFY_MSG_ERROR, (title), \
00694 (primary), (secondary), NULL, NULL)
00695
00698
00700
00709 void purple_notify_set_ui_ops(PurpleNotifyUiOps *ops);
00710
00717 PurpleNotifyUiOps *purple_notify_get_ui_ops(void);
00718
00721
00723
00731 void *purple_notify_get_handle(void);
00732
00736 void purple_notify_init(void);
00737
00741 void purple_notify_uninit(void);
00742
00746 #ifdef __cplusplus
00747 }
00748 #endif
00749
00750 #endif