* 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_ * @section_id: pidgin-gtkconv * @short_description: <filename>gtkconv.h</filename> * @title: Conversation API * @see_also: <link linkend="chapter-signals-gtkconv">Conversation signals</link> #define PIDGIN_TYPE_CONVERSATION (pidgin_conversation_get_type()) 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" /************************************************************************** **************************************************************************/ * A GTK+ conversation pane. struct _PidginConversation PurpleConversation *active_conv; PurpleConversation *last_conversed; PurpleMessageFlags last_flags; GtkTextBuffer *history_buffer; 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; /************************************************************************** **************************************************************************/ * pidgin_conversation_get_type: * Returns: The #GType for the #PidginConversation boxed structure. GType pidgin_conversation_get_type(void); * pidgin_conversations_get_conv_ui_ops: * Returns the UI operations structure for GTK+ conversations. * Returns: The GTK+ conversation operations structure. PurpleConversationUiOps *pidgin_conversations_get_conv_ui_ops(void); * pidgin_conv_update_buddy_icon: * @im: The IM conversation. * Updates the buddy icon on a conversation. void pidgin_conv_update_buddy_icon(PurpleIMConversation *im); * pidgin_conv_switch_active_conversation: * @conv: The conversation * Sets the active conversation within a GTK-conversation. void pidgin_conv_switch_active_conversation(PurpleConversation *conv); * pidgin_conv_update_buttons_by_protocol: * @conv: The conversation. * Updates conversation buttons by protocol. void pidgin_conv_update_buttons_by_protocol(PurpleConversation *conv); * pidgin_conversations_get_unseen_all: * @min_state: The minimum unseen state. * @hidden_only: If %TRUE, only consider hidden conversations. * @max_count: Maximum number of conversations to return, or 0 for * 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. * Returns: (transfer container) (element-type PurpleConversation): List of PurpleConversation matching criteria, or %NULL. pidgin_conversations_get_unseen_all(PidginUnseenState min_state, * pidgin_conversations_get_unseen_ims: * @min_state: The minimum unseen state. * @hidden_only: If %TRUE, only consider hidden conversations. * @max_count: Maximum number of conversations to return, or 0 for * 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 * Returns: (transfer container) (element-type PurpleConversation): List of PurpleIMConversation matching criteria, or %NULL. pidgin_conversations_get_unseen_ims(PidginUnseenState min_state, * pidgin_conversations_get_unseen_chats: * @min_state: The minimum unseen state. * @hidden_only: If %TRUE, only consider hidden conversations. * @max_count: Maximum number of conversations to return, or 0 for * 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 * Returns: (transfer container) (element-type PurpleConversation): List of PurpleChatConversation matching criteria, or %NULL. pidgin_conversations_get_unseen_chats(PidginUnseenState min_state, * pidgin_conversations_fill_menu: * @menu: Menu widget to add items to. * @convs: (element-type PurpleConversation): List of PurpleConversation to add to menu. * Fill a menu with a list of conversations. Clicking the conversation * menu item will present that conversation to the user. * Returns: Number of conversations added to menu. pidgin_conversations_fill_menu(GtkWidget *menu, GList *convs); * pidgin_conv_present_conversation: * @conv: The conversation. * Presents a purple conversation to the user. void pidgin_conv_present_conversation(PurpleConversation *conv); * pidgin_conv_attach_to_conversation: * @conv: The conversation. * Reattach Pidgin UI to a conversation. * Returns: Wheter Pidgin UI was successfully attached. gboolean pidgin_conv_attach_to_conversation(PurpleConversation *conv); * pidgin_conv_get_window: * @gtkconv: The GTK+ conversation. * Returns: The window the conversation belongs to. PidginConvWindow *pidgin_conv_get_window(PidginConversation *gtkconv); * pidgin_conv_get_tab_icon: * @conv: The conversation. * @small_icon: Whether to get the small icon. * Returns: (transfer full): The tab icon. GdkPixbuf *pidgin_conv_get_tab_icon(PurpleConversation *conv, gboolean small_icon); * @conv: The conversation. * Creates a new GTK+ conversation for a given #PurpleConversation. void pidgin_conv_new(PurpleConversation *conv); * pidgin_conv_get_tab_at_xy: * @win: The conversation window. * @x: X-coordinate to look up. * @y: Y-coordinate to look up. * @to_right: (out): Return address for a boolean which will be %TRUE if the * coordinates are on the right side of the tab (or bottom in case of * a vertical notebook), %FALSE otherwise. * Returns: The tab index of a conversation in @win at (@x, @y). int pidgin_conv_get_tab_at_xy(PidginConvWindow *win, int x, int y, gboolean *to_right); * @gtkconv: The GTK+ conversation. * Returns: %TRUE if the conversation is hidden, %FALSE otherwise. gboolean pidgin_conv_is_hidden(PidginConversation *gtkconv); /**************************************************************************/ /* GTK+ Conversations Subsystem */ /**************************************************************************/ * pidgin_conversations_get_handle: * Returns the gtk conversations subsystem handle. * Returns: The conversations subsystem handle. void *pidgin_conversations_get_handle(void); * pidgin_conversations_init: * Initializes the GTK+ conversations subsystem. void pidgin_conversations_init(void); * pidgin_conversations_uninit: * Uninitialized the GTK+ conversation subsystem. void pidgin_conversations_uninit(void); #endif /* _PIDGIN_CONVERSATION_H_ */