* @file gtkconv.h GTK+ Conversation API * @see @ref gtkconv-signals * Pidgin is the legal property of its developers, whose names are too numerous * to list here. Please refer to the COPYRIGHT file distributed with this * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA #ifndef _PIDGIN_CONVERSATION_H_ #define _PIDGIN_CONVERSATION_H_ typedef struct _PidginImPane PidginImPane; typedef struct _PidginChatPane PidginChatPane; typedef struct _PidginConversation PidginConversation; PIDGIN_UNSEEN_NONE, /**< No unseen text in the conversation. */ PIDGIN_UNSEEN_EVENT, /**< Unseen events in the conversation. */ PIDGIN_UNSEEN_NO_LOG, /**< Unseen text with NO_LOG flag. */ PIDGIN_UNSEEN_TEXT, /**< Unseen text in the conversation. */ PIDGIN_UNSEEN_NICK /**< Unseen text and the nick was said. */ CHAT_USERS_ALIAS_KEY_COLUMN, CHAT_USERS_WEIGHT_COLUMN, CHAT_USERS_ICON_STOCK_COLUMN, #define PIDGIN_CONVERSATION(conv) \ ((PidginConversation *)purple_conversation_get_ui_data(conv)) #define PIDGIN_IS_PIDGIN_CONVERSATION(conv) \ (purple_conversation_get_ui_ops(conv) == \ pidgin_conversations_get_conv_ui_ops()) #include "conversation.h" #include "gtkconv-theme.h" /************************************************************************** **************************************************************************/ * A GTK+ representation of a graphical window containing one or more * A GTK+ conversation pane. struct _PidginConversation PurpleConversation *active_conv; PurpleConversation *last_conversed; PurpleMessageFlags last_flags; gboolean auto_resize; /* this is set to TRUE if the conversation * is being resized by a non-user-initiated * event, such as the buddy icon appearing gboolean entry_growing; /* True if the size of the entry was set * automatically by typing too much to fit GtkWidget *close; /* "x" on the tab */ PidginUnseenState unseen_state; GtkWidget *infopane_hbox; GtkListStore *infopane_model; GtkTreeIter infopane_iter; /* Used when attaching a PidginConversation to a PurpleConversation * with message history */ GtkWidget *quickfind_entry; GtkWidget *quickfind_container; /************************************************************************** * @name GTK+ Conversation API **************************************************************************/ * Returns the UI operations structure for GTK+ conversations. * @return The GTK+ conversation operations structure. PurpleConversationUiOps *pidgin_conversations_get_conv_ui_ops(void); * Returns the default theme for GTK+ conversations. * @return The default GTK+ conversation theme. PurpleTheme *pidgin_conversations_get_default_theme(void); * Updates the buddy icon on a conversation. * @param conv The conversation. void pidgin_conv_update_buddy_icon(PurpleIMConversation *im); * Sets the active conversation within a GTK-conversation. * @param conv The conversation void pidgin_conv_switch_active_conversation(PurpleConversation *conv); * Updates conversation buttons by protocol. * @param conv The conversation. void pidgin_conv_update_buttons_by_protocol(PurpleConversation *conv); * Returns a list of conversations of any type which have an unseen * state greater than or equal to the specified minimum state. Using the * hidden_only parameter, this search can be limited to hidden * conversations. The max_count parameter will limit the total number of * converations returned if greater than zero. The returned list should * be freed by the caller. * @param min_state The minimum unseen state. * @param hidden_only If TRUE, only consider hidden conversations. * @param max_count Maximum number of conversations to return, or 0 for * @return List of PurpleConversation matching criteria, or NULL. pidgin_conversations_get_unseen_all(PidginUnseenState min_state, * Returns a list of IM conversations which have an unseen state greater * than or equal to the specified minimum state. Using the hidden_only * parameter, this search can be limited to hidden IM conversations. The * max_count parameter will limit the total number of IM converations * returned if greater than zero. The returned list should be freed by the * @param min_state The minimum unseen state. * @param hidden_only If TRUE, only consider hidden conversations. * @param max_count Maximum number of conversations to return, or 0 for * @return List of PurpleIMConversation matching criteria, pidgin_conversations_get_unseen_ims(PidginUnseenState min_state, * Returns a list of chat conversations which have an unseen state greater * than or equal to the specified minimum state. Using the hidden_only * parameter, this search can be limited to hidden chat conversations. The * max_count parameter will limit the total number of chat converations * returned if greater than zero. The returned list should be freed by the * @param min_state The minimum unseen state. * @param hidden_only If TRUE, only consider hidden conversations. * @param max_count Maximum number of conversations to return, or 0 for * @return List of PurpleChatConversation matching criteria, pidgin_conversations_get_unseen_chats(PidginUnseenState min_state, * Fill a menu with a list of conversations. Clicking the conversation * menu item will present that conversation to the user. * @param menu Menu widget to add items to. * @param convs List of PurpleConversation to add to menu. * @return Number of conversations added to menu. pidgin_conversations_fill_menu(GtkWidget *menu, GList *convs); * Presents a purple conversation to the user. * @param conv The conversation. void pidgin_conv_present_conversation(PurpleConversation *conv); * Reattach Pidgin UI to a conversation. * @param conv The conversation. * @return Wheter Pidgin UI was successfully attached. gboolean pidgin_conv_attach_to_conversation(PurpleConversation *conv); PidginWindow *pidgin_conv_get_window(PidginConversation *gtkconv); GdkPixbuf *pidgin_conv_get_tab_icon(PurpleConversation *conv, gboolean small_icon); void pidgin_conv_new(PurpleConversation *conv); int pidgin_conv_get_tab_at_xy(PidginWindow *win, int x, int y, gboolean *to_right); gboolean pidgin_conv_is_hidden(PidginConversation *gtkconv); /**************************************************************************/ /** @name GTK+ Conversations Subsystem */ /**************************************************************************/ * Returns the gtk conversations subsystem handle. * @return The conversations subsystem handle. void *pidgin_conversations_get_handle(void); * Initializes the GTK+ conversations subsystem. void pidgin_conversations_init(void); * Uninitialized the GTK+ conversation subsystem. void pidgin_conversations_uninit(void); #endif /* _PIDGIN_CONVERSATION_H_ */