gtkconv.h

Go to the documentation of this file.
00001 
00025 #ifndef _PIDGIN_CONVERSATION_H_
00026 #define _PIDGIN_CONVERSATION_H_
00027 
00028 typedef struct _PidginImPane       PidginImPane;
00029 typedef struct _PidginChatPane     PidginChatPane;
00030 typedef struct _PidginConversation PidginConversation;
00031 
00035 typedef enum
00036 {
00037     PIDGIN_UNSEEN_NONE,   
00038     PIDGIN_UNSEEN_EVENT,  
00039     PIDGIN_UNSEEN_NO_LOG, 
00040     PIDGIN_UNSEEN_TEXT,   
00041     PIDGIN_UNSEEN_NICK    
00042 } PidginUnseenState;
00043 
00044 enum {
00045     CHAT_USERS_ICON_COLUMN,
00046     CHAT_USERS_ALIAS_COLUMN,
00047     CHAT_USERS_ALIAS_KEY_COLUMN,
00048     CHAT_USERS_NAME_COLUMN,
00049     CHAT_USERS_FLAGS_COLUMN,
00050     CHAT_USERS_COLOR_COLUMN,
00051     CHAT_USERS_WEIGHT_COLUMN,
00052     CHAT_USERS_COLUMNS
00053 };
00054 
00055 #define PIDGIN_CONVERSATION(conv) \
00056     ((PidginConversation *)(conv)->ui_data)
00057 
00058 #define PIDGIN_IS_PIDGIN_CONVERSATION(conv) \
00059     (purple_conversation_get_ui_ops(conv) == \
00060      pidgin_conversations_get_conv_ui_ops())
00061 
00062 #include "pidgin.h"
00063 #include "conversation.h"
00064 #include "gtkconvwin.h"
00065 
00066 /**************************************************************************
00067  * @name Structures
00068  **************************************************************************/
00079 struct _PidginImPane
00080 {
00081     GtkWidget *block;
00082     GtkWidget *send_file;
00083     GtkWidget *sep1;
00084     GtkWidget *sep2;
00085     GtkWidget *check;
00086     GtkWidget *progress;
00087     guint32 typing_timer;
00088 
00089     /* Buddy icon stuff */
00090     GtkWidget *icon_container;
00091     GtkWidget *icon;
00092     gboolean show_icon;
00093     gboolean animate;
00094     GdkPixbufAnimation *anim;
00095     GdkPixbufAnimationIter *iter;
00096     guint32 icon_timer;
00097 };
00098 
00102 struct _PidginChatPane
00103 {
00104     GtkWidget *count;
00105     GtkWidget *list;
00106     GtkWidget *topic_text;
00107 };
00108 
00112 struct _PidginConversation
00113 {
00114     PurpleConversation *active_conv;
00115     GList *convs;
00116     GList *send_history;
00117 
00118     PidginWindow *win;
00119 
00120     gboolean make_sound;
00121 
00122     GtkTooltips *tooltips;
00123 
00124     GtkWidget *tab_cont;
00125     GtkWidget *tabby;
00126     GtkWidget *menu_tabby;
00127 
00128     GtkWidget *imhtml;
00129     GtkTextBuffer *entry_buffer;
00130     GtkWidget *entry;
00131     gboolean auto_resize;   /* this is set to TRUE if the conversation
00132                  * is being resized by a non-user-initiated
00133                  * event, such as the buddy icon appearing
00134                  */
00135     gboolean entry_growing; /* True if the size of the entry was set
00136                  * automatically by typing too much to fit
00137                  * in one line */
00138 
00139     GtkWidget *close; /* "x" on the tab */
00140     GtkWidget *icon;
00141     GtkWidget *tab_label;
00142     GtkWidget *menu_icon;
00143     GtkWidget *menu_label;
00144     GtkSizeGroup *sg;
00145 
00146     GtkWidget *lower_hbox;
00147 
00148     GtkWidget *toolbar;
00149 
00150     PidginUnseenState unseen_state;
00151     guint unseen_count;
00152 
00153     union
00154     {
00155         PidginImPane   *im;
00156         PidginChatPane *chat;
00157 
00158     } u;
00159 
00160     time_t newday;
00161 };
00162 
00165 /**************************************************************************
00166  * @name GTK+ Conversation API
00167  **************************************************************************/
00175 PurpleConversationUiOps *pidgin_conversations_get_conv_ui_ops(void);
00176 
00182 void pidgin_conv_update_buddy_icon(PurpleConversation *conv);
00183 
00189 void pidgin_conv_switch_active_conversation(PurpleConversation *conv);
00190 
00196 void pidgin_conv_update_buttons_by_protocol(PurpleConversation *conv);
00197 
00213 GList *
00214 pidgin_conversations_find_unseen_list(PurpleConversationType type,
00215                                         PidginUnseenState min_state,
00216                                         gboolean hidden_only,
00217                                         guint max_count);
00218 
00227 guint
00228 pidgin_conversations_fill_menu(GtkWidget *menu, GList *convs);
00229 
00235 void pidgin_conv_present_conversation(PurpleConversation *conv);
00236 
00237 PidginWindow *pidgin_conv_get_window(PidginConversation *gtkconv);
00238 GdkPixbuf *pidgin_conv_get_tab_icon(PurpleConversation *conv, gboolean small_icon);
00239 void pidgin_conv_new(PurpleConversation *conv);
00240 int pidgin_conv_get_tab_at_xy(PidginWindow *win, int x, int y, gboolean *to_right);
00241 gboolean pidgin_conv_is_hidden(PidginConversation *gtkconv);
00244 /**************************************************************************/
00246 /**************************************************************************/
00254 void *pidgin_conversations_get_handle(void);
00255 
00259 void pidgin_conversations_init(void);
00260 
00264 void pidgin_conversations_uninit(void);
00265 
00268 #endif /* _PIDGIN_CONVERSATION_H_ */