00001
00025 #ifndef _GAIM_NOTIFY_H_
00026 #define _GAIM_NOTIFY_H_
00027
00028 #include <stdlib.h>
00029 #include <glib-object.h>
00030 #include <glib.h>
00031
00032 #include "connection.h"
00033
00037 typedef enum
00038 {
00039 GAIM_NOTIFY_MESSAGE = 0,
00040 GAIM_NOTIFY_EMAIL,
00041 GAIM_NOTIFY_EMAILS,
00042 GAIM_NOTIFY_FORMATTED,
00043 GAIM_NOTIFY_USERINFO,
00044 GAIM_NOTIFY_URI
00046 } GaimNotifyType;
00047
00051 typedef enum
00052 {
00053 GAIM_NOTIFY_MSG_ERROR = 0,
00054 GAIM_NOTIFY_MSG_WARNING,
00055 GAIM_NOTIFY_MSG_INFO
00057 } GaimNotifyMsgType;
00058
00062 typedef struct
00063 {
00064 void *(*notify_message)(GaimNotifyMsgType type, const char *title,
00065 const char *primary, const char *secondary,
00066 GCallback cb, void *user_data);
00067 void *(*notify_email)(const char *subject, const char *from,
00068 const char *to, const char *url,
00069 GCallback cb, void *user_data);
00070 void *(*notify_emails)(size_t count, gboolean detailed,
00071 const char **subjects, const char **froms,
00072 const char **tos, const char **urls,
00073 GCallback cb, void *user_data);
00074 void *(*notify_formatted)(const char *title, const char *primary,
00075 const char *secondary, const char *text,
00076 GCallback cb, void *user_data);
00077 void *(*notify_userinfo)(GaimConnection *gc, const char *who,
00078 const char *title, const char *primary,
00079 const char *secondary, const char *text,
00080 GCallback cb, void *user_data);
00081 void *(*notify_uri)(const char *uri);
00082
00083 void (*close_notify)(GaimNotifyType type, void *ui_handle);
00084
00085 } GaimNotifyUiOps;
00086
00087
00088 #ifdef __cplusplus
00089 extern "C" {
00090 #endif
00091
00092
00094
00111 void *gaim_notify_message(void *handle, GaimNotifyMsgType type,
00112 const char *title, const char *primary,
00113 const char *secondary, GCallback cb,
00114 void *user_data);
00115
00130 void *gaim_notify_email(void *handle, const char *subject,
00131 const char *from, const char *to,
00132 const char *url, GCallback cb,
00133 void *user_data);
00134
00152 void *gaim_notify_emails(void *handle, size_t count, gboolean detailed,
00153 const char **subjects, const char **froms,
00154 const char **tos, const char **urls,
00155 GCallback cb, void *user_data);
00156
00174 void *gaim_notify_formatted(void *handle, const char *title,
00175 const char *primary, const char *secondary,
00176 const char *text, GCallback cb, void *user_data);
00177
00197 void *gaim_notify_userinfo(GaimConnection *gc, const char *who,
00198 const char *title, const char *primary,
00199 const char *secondary, const char *text,
00200 GCallback cb, void *user_data);
00201
00212 void *gaim_notify_uri(void *handle, const char *uri);
00213
00223 void gaim_notify_close(GaimNotifyType type, void *ui_handle);
00224
00230 void gaim_notify_close_with_handle(void *handle);
00231
00235 #define gaim_notify_info(handle, title, primary, secondary) \
00236 gaim_notify_message((handle), GAIM_NOTIFY_MSG_INFO, (title), \
00237 (primary), (secondary), NULL, NULL)
00238
00242 #define gaim_notify_warning(handle, title, primary, secondary) \
00243 gaim_notify_message((handle), GAIM_NOTIFY_MSG_WARNING, (title), \
00244 (primary), (secondary), NULL, NULL)
00245
00249 #define gaim_notify_error(handle, title, primary, secondary) \
00250 gaim_notify_message((handle), GAIM_NOTIFY_MSG_ERROR, (title), \
00251 (primary), (secondary), NULL, NULL)
00252
00255
00257
00266 void gaim_notify_set_ui_ops(GaimNotifyUiOps *ops);
00267
00274 GaimNotifyUiOps *gaim_notify_get_ui_ops(void);
00275
00278 #ifdef __cplusplus
00279 }
00280 #endif
00281
00282 #endif