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     GtkWidget *infopane_hbox;
00162     GtkWidget *infopane;
00163     GtkListStore *infopane_model;
00164     GtkTreeIter infopane_iter;
00165 };
00166 
00169 /**************************************************************************
00170  * @name GTK+ Conversation API
00171  **************************************************************************/
00179 PurpleConversationUiOps *pidgin_conversations_get_conv_ui_ops(void);
00180 
00186 void pidgin_conv_update_buddy_icon(PurpleConversation *conv);
00187 
00193 void pidgin_conv_switch_active_conversation(PurpleConversation *conv);
00194 
00200 void pidgin_conv_update_buttons_by_protocol(PurpleConversation *conv);
00201 
00217 GList *
00218 pidgin_conversations_find_unseen_list(PurpleConversationType type,
00219                                         PidginUnseenState min_state,
00220                                         gboolean hidden_only,
00221                                         guint max_count);
00222 
00231 guint
00232 pidgin_conversations_fill_menu(GtkWidget *menu, GList *convs);
00233 
00239 void pidgin_conv_present_conversation(PurpleConversation *conv);
00240 
00241 PidginWindow *pidgin_conv_get_window(PidginConversation *gtkconv);
00242 GdkPixbuf *pidgin_conv_get_tab_icon(PurpleConversation *conv, gboolean small_icon);
00243 void pidgin_conv_new(PurpleConversation *conv);
00244 int pidgin_conv_get_tab_at_xy(PidginWindow *win, int x, int y, gboolean *to_right);
00245 gboolean pidgin_conv_is_hidden(PidginConversation *gtkconv);
00248 /**************************************************************************/
00250 /**************************************************************************/
00258 void *pidgin_conversations_get_handle(void);
00259 
00263 void pidgin_conversations_init(void);
00264 
00268 void pidgin_conversations_uninit(void);
00269 
00272 #endif /* _PIDGIN_CONVERSATION_H_ */