gtkconv.h

Go to the documentation of this file.
00001 
00007 /* pidgin
00008  *
00009  * Pidgin 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 _PIDGIN_CONVERSATION_H_
00028 #define _PIDGIN_CONVERSATION_H_
00029 
00030 typedef struct _PidginImPane       PidginImPane;
00031 typedef struct _PidginChatPane     PidginChatPane;
00032 typedef struct _PidginConversation PidginConversation;
00033 
00037 typedef enum
00038 {
00039     PIDGIN_UNSEEN_NONE,   
00040     PIDGIN_UNSEEN_EVENT,  
00041     PIDGIN_UNSEEN_NO_LOG, 
00042     PIDGIN_UNSEEN_TEXT,   
00043     PIDGIN_UNSEEN_NICK    
00044 } PidginUnseenState;
00045 
00046 enum {
00047     CHAT_USERS_ICON_COLUMN,
00048     CHAT_USERS_ALIAS_COLUMN,
00049     CHAT_USERS_ALIAS_KEY_COLUMN,
00050     CHAT_USERS_NAME_COLUMN,
00051     CHAT_USERS_FLAGS_COLUMN,
00052     CHAT_USERS_COLOR_COLUMN,
00053     CHAT_USERS_WEIGHT_COLUMN,
00054     CHAT_USERS_ICON_STOCK_COLUMN,   
00055     CHAT_USERS_COLUMNS
00056 };
00057 
00058 #define PIDGIN_CONVERSATION(conv) \
00059     ((PidginConversation *)(conv)->ui_data)
00060 
00061 #define PIDGIN_IS_PIDGIN_CONVERSATION(conv) \
00062     (purple_conversation_get_ui_ops(conv) == \
00063      pidgin_conversations_get_conv_ui_ops())
00064 
00065 #include "pidgin.h"
00066 #include "conversation.h"
00067 #include "gtkconvwin.h"
00068 
00069 /**************************************************************************
00070  * @name Structures
00071  **************************************************************************/
00082 struct _PidginImPane
00083 {
00084     GtkWidget *block;
00085     GtkWidget *send_file;
00086     GtkWidget *sep1;
00087     GtkWidget *sep2;
00088     GtkWidget *check;
00089     GtkWidget *progress;
00090     guint32 typing_timer;
00091 
00092     /* Buddy icon stuff */
00093     GtkWidget *icon_container;
00094     GtkWidget *icon;
00095     gboolean show_icon;
00096     gboolean animate;
00097     GdkPixbufAnimation *anim;
00098     GdkPixbufAnimationIter *iter;
00099     guint32 icon_timer;
00100 };
00101 
00105 struct _PidginChatPane
00106 {
00107     GtkWidget *count;
00108     GtkWidget *list;
00109     GtkWidget *topic_text;
00110 };
00111 
00115 struct _PidginConversation
00116 {
00117     PurpleConversation *active_conv;
00118     GList *convs;
00119     GList *send_history;
00120 
00121     PidginWindow *win;
00122 
00123     gboolean make_sound;
00124 
00125     GtkTooltips *tooltips;
00126 
00127     GtkWidget *tab_cont;
00128     GtkWidget *tabby;
00129     GtkWidget *menu_tabby;
00130 
00131     GtkWidget *imhtml;
00132     GtkTextBuffer *entry_buffer;
00133     GtkWidget *entry;
00134     gboolean auto_resize;   /* this is set to TRUE if the conversation
00135                  * is being resized by a non-user-initiated
00136                  * event, such as the buddy icon appearing
00137                  */
00138     gboolean entry_growing; /* True if the size of the entry was set
00139                  * automatically by typing too much to fit
00140                  * in one line */
00141 
00142     GtkWidget *close; /* "x" on the tab */
00143     GtkWidget *icon;
00144     GtkWidget *tab_label;
00145     GtkWidget *menu_icon;
00146     GtkWidget *menu_label;
00147 #if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKCONV_C_)
00148 
00149     GtkSizeGroup *sg;
00150 #else
00151     gpointer depr1;
00152 #endif
00153 
00154     GtkWidget *lower_hbox;
00155 
00156     GtkWidget *toolbar;
00157 
00158     PidginUnseenState unseen_state;
00159     guint unseen_count;
00160 
00161     union
00162     {
00163         PidginImPane   *im;
00164         PidginChatPane *chat;
00165 
00166     } u;
00167 
00168     time_t newday;
00169     GtkWidget *infopane_hbox;
00170     GtkWidget *infopane;
00171     GtkListStore *infopane_model;
00172     GtkTreeIter infopane_iter;
00173 
00174     /* Used when attaching a PidginConversation to a PurpleConversation
00175      * with message history */
00176     struct {
00177         int timer;
00178         GList *current;
00179     } attach;
00180 
00181     /* Quick Find (since 2.7.0) */
00182     struct {
00183         GtkWidget *entry;
00184         GtkWidget *container;
00185     } quickfind;
00186 };
00187 
00190 /**************************************************************************
00191  * @name GTK+ Conversation API
00192  **************************************************************************/
00200 PurpleConversationUiOps *pidgin_conversations_get_conv_ui_ops(void);
00201 
00207 void pidgin_conv_update_buddy_icon(PurpleConversation *conv);
00208 
00214 void pidgin_conv_switch_active_conversation(PurpleConversation *conv);
00215 
00221 void pidgin_conv_update_buttons_by_protocol(PurpleConversation *conv);
00222 
00238 GList *
00239 pidgin_conversations_find_unseen_list(PurpleConversationType type,
00240                                         PidginUnseenState min_state,
00241                                         gboolean hidden_only,
00242                                         guint max_count);
00243 
00252 guint
00253 pidgin_conversations_fill_menu(GtkWidget *menu, GList *convs);
00254 
00260 void pidgin_conv_present_conversation(PurpleConversation *conv);
00261 
00271 gboolean pidgin_conv_attach_to_conversation(PurpleConversation *conv);
00272 
00273 PidginWindow *pidgin_conv_get_window(PidginConversation *gtkconv);
00274 GdkPixbuf *pidgin_conv_get_tab_icon(PurpleConversation *conv, gboolean small_icon);
00275 void pidgin_conv_new(PurpleConversation *conv);
00276 int pidgin_conv_get_tab_at_xy(PidginWindow *win, int x, int y, gboolean *to_right);
00277 gboolean pidgin_conv_is_hidden(PidginConversation *gtkconv);
00280 /**************************************************************************/
00282 /**************************************************************************/
00290 void *pidgin_conversations_get_handle(void);
00291 
00295 void pidgin_conversations_init(void);
00296 
00300 void pidgin_conversations_uninit(void);
00301 
00304 #endif /* _PIDGIN_CONVERSATION_H_ */