notify.h

Go to the documentation of this file.
00001 
00007 /* purple
00008  *
00009  * Purple is the legal property of its developers, whose names are too numerous
00010  * to list here.  Please refer to the COPYRIGHT file distributed with this
00011  * source distribution.
00012  *
00013  * This program is free software; you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation; either version 2 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * This program is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program; if not, write to the Free Software
00025  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
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_prepend_section_break(PurpleNotifyUserInfo *user_info);
00586     
00593 void purple_notify_user_info_add_section_header(PurpleNotifyUserInfo *user_info, const char *label);
00594     
00602 void purple_notify_user_info_prepend_section_header(PurpleNotifyUserInfo *user_info, const char *label);
00603     
00607 void purple_notify_user_info_remove_last_item(PurpleNotifyUserInfo *user_info);
00608 
00616 const gchar *purple_notify_user_info_entry_get_label(PurpleNotifyUserInfoEntry *user_info_entry);
00617 
00624 void purple_notify_user_info_entry_set_label(PurpleNotifyUserInfoEntry *user_info_entry, const char *label);
00625 
00633 const gchar *purple_notify_user_info_entry_get_value(PurpleNotifyUserInfoEntry *user_info_entry);
00634 
00641 void purple_notify_user_info_entry_set_value(PurpleNotifyUserInfoEntry *user_info_entry, const char *value);
00642 
00643 
00651 PurpleNotifyUserInfoEntryType purple_notify_user_info_entry_get_type(PurpleNotifyUserInfoEntry *user_info_entry);
00652 
00659 void purple_notify_user_info_entry_set_type(PurpleNotifyUserInfoEntry *user_info_entry,
00660                                           PurpleNotifyUserInfoEntryType type);
00661 
00672 void *purple_notify_uri(void *handle, const char *uri);
00673 
00683 void purple_notify_close(PurpleNotifyType type, void *ui_handle);
00684 
00690 void purple_notify_close_with_handle(void *handle);
00691 
00695 #define purple_notify_info(handle, title, primary, secondary) \
00696     purple_notify_message((handle), PURPLE_NOTIFY_MSG_INFO, (title), \
00697                         (primary), (secondary), NULL, NULL)
00698 
00702 #define purple_notify_warning(handle, title, primary, secondary) \
00703     purple_notify_message((handle), PURPLE_NOTIFY_MSG_WARNING, (title), \
00704                         (primary), (secondary), NULL, NULL)
00705 
00709 #define purple_notify_error(handle, title, primary, secondary) \
00710     purple_notify_message((handle), PURPLE_NOTIFY_MSG_ERROR, (title), \
00711                         (primary), (secondary), NULL, NULL)
00712 
00715 /**************************************************************************/
00717 /**************************************************************************/
00726 void purple_notify_set_ui_ops(PurpleNotifyUiOps *ops);
00727 
00734 PurpleNotifyUiOps *purple_notify_get_ui_ops(void);
00735 
00738 /**************************************************************************/
00740 /**************************************************************************/
00748 void *purple_notify_get_handle(void);
00749 
00753 void purple_notify_init(void);
00754 
00758 void purple_notify_uninit(void);
00759 
00763 #ifdef __cplusplus
00764 }
00765 #endif
00766 
00767 #endif /* _PURPLE_NOTIFY_H_ */

Generated on Fri Oct 24 07:25:07 2008 for pidgin by  doxygen 1.5.6