3 * Pidgin is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #ifndef PIDGIN_CONV_THEME_H
23 #define PIDGIN_CONV_THEME_H
25 * SECTION:gtkconv-theme
26 * @section_id: pidgin-gtkconv-theme
27 * @short_description: <filename>gtkconv-theme.h</filename>
28 * @title: Conversation Theme Class
32 #include <glib-object.h>
33 #include "conversation.h"
36 typedef struct _PidginConvTheme PidginConvTheme
;
37 typedef struct _PidginConvThemeClass PidginConvThemeClass
;
39 #define PIDGIN_TYPE_CONV_THEME (pidgin_conversation_theme_get_type ())
40 #define PIDGIN_CONV_THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIDGIN_TYPE_CONV_THEME, PidginConvTheme))
41 #define PIDGIN_CONV_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PIDGIN_TYPE_CONV_THEME, PidginConvThemeClass))
42 #define PIDGIN_IS_CONV_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIDGIN_TYPE_CONV_THEME))
43 #define PIDGIN_IS_CONV_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PIDGIN_TYPE_CONV_THEME))
44 #define PIDGIN_CONV_THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PIDGIN_TYPE_CONV_THEME, PidginConvThemeClass))
49 * extends PurpleTheme (theme.h)
50 * A pidgin icon theme.
51 * This object represents a Pidgin icon theme.
53 * PidginConvTheme is a PurpleTheme Object.
55 struct _PidginConvTheme
60 struct _PidginConvThemeClass
62 PurpleThemeClass parent_class
;
66 PIDGIN_CONVERSATION_THEME_TEMPLATE_MAIN
,
67 PIDGIN_CONVERSATION_THEME_TEMPLATE_HEADER
,
68 PIDGIN_CONVERSATION_THEME_TEMPLATE_FOOTER
,
69 PIDGIN_CONVERSATION_THEME_TEMPLATE_TOPIC
,
70 PIDGIN_CONVERSATION_THEME_TEMPLATE_STATUS
,
71 PIDGIN_CONVERSATION_THEME_TEMPLATE_CONTENT
,
72 PIDGIN_CONVERSATION_THEME_TEMPLATE_INCOMING_CONTENT
,
73 PIDGIN_CONVERSATION_THEME_TEMPLATE_INCOMING_NEXT_CONTENT
,
74 PIDGIN_CONVERSATION_THEME_TEMPLATE_INCOMING_CONTEXT
,
75 PIDGIN_CONVERSATION_THEME_TEMPLATE_INCOMING_NEXT_CONTEXT
,
76 PIDGIN_CONVERSATION_THEME_TEMPLATE_OUTGOING_CONTENT
,
77 PIDGIN_CONVERSATION_THEME_TEMPLATE_OUTGOING_NEXT_CONTENT
,
78 PIDGIN_CONVERSATION_THEME_TEMPLATE_OUTGOING_CONTEXT
,
79 PIDGIN_CONVERSATION_THEME_TEMPLATE_OUTGOING_NEXT_CONTEXT
,
80 PIDGIN_CONVERSATION_THEME_TEMPLATE_BASESTYLE_CSS
82 } PidginConvThemeTemplateType
;
84 /**************************************************************************/
85 /* Pidgin Conversation Theme API */
86 /**************************************************************************/
90 * pidgin_conversation_theme_get_type:
92 * Returns: The #GType for a conversation theme.
94 GType
pidgin_conversation_theme_get_type(void);
97 * pidgin_conversation_theme_get_info:
98 * @theme: The conversation theme
100 * Get the Info.plist hash table from a conversation theme.
102 * Returns: The hash table. Keys are strings as outlined for message styles,
103 * values are GValue*s. This is an internal structure. Take a ref if
104 * necessary, but don't destroy it yourself.
106 const GHashTable
*pidgin_conversation_theme_get_info(const PidginConvTheme
*theme
);
109 * pidgin_conversation_theme_set_info:
110 * @theme: The conversation theme
111 * @info: The new hash table. The theme will take ownership of this hash
112 * table. Do not use it yourself afterwards with holding a ref.
113 * For key and value specifications, see pidgin_conversation_theme_get_info().
115 * Set the Info.plist hash table for a conversation theme.
117 void pidgin_conversation_theme_set_info(PidginConvTheme
*theme
, GHashTable
*info
);
120 * pidgin_conversation_theme_lookup:
121 * @theme: The conversation theme
122 * @key: The key to find
123 * @specific: Whether to search variant-specific keys
125 * Lookup a key in a theme
127 * Returns: The key information. If @specific is %TRUE, then keys are first
128 * searched by variant, then by general ones. Otherwise, only general
129 * key values are returned.
131 const GValue
*pidgin_conversation_theme_lookup(PidginConvTheme
*theme
, const char *key
, gboolean specific
);
134 * pidgin_conversation_theme_get_template:
135 * @theme: The conversation theme
136 * @type: The type of template data
138 * Get the template data from a conversation theme.
140 * Returns: The template data requested. Fallback is made as required by styles.
141 * Subsequent calls to this function will return cached values.
143 const char *pidgin_conversation_theme_get_template(PidginConvTheme
*theme
, PidginConvThemeTemplateType type
);
146 * pidgin_conversation_theme_add_variant:
147 * @theme: The conversation theme
148 * @variant: The name of the variant
150 * Add an available variant name to a conversation theme.
152 * Note: The conversation theme will take ownership of the variant name string.
153 * This function should normally only be called by the theme loader.
155 void pidgin_conversation_theme_add_variant(PidginConvTheme
*theme
, char *variant
);
158 * pidgin_conversation_theme_get_variant:
159 * @theme: The conversation theme
161 * Get the currently set variant name for a conversation theme.
163 * Returns: The current variant name.
165 const char *pidgin_conversation_theme_get_variant(PidginConvTheme
*theme
);
168 * pidgin_conversation_theme_set_variant:
169 * @theme: The conversation theme
170 * @variant: The name of the variant
172 * Set the variant name for a conversation theme.
174 void pidgin_conversation_theme_set_variant(PidginConvTheme
*theme
, const char *variant
);
177 * pidgin_conversation_theme_get_variants:
178 * @theme: The conversation theme
180 * Get a list of available variants for a conversation theme.
182 * Returns: The list of variants. This GList and the string data are owned by
183 * the theme and should not be freed by the caller.
185 const GList
*pidgin_conversation_theme_get_variants(PidginConvTheme
*theme
);
188 * pidgin_conversation_theme_get_template_path:
189 * @theme: The conversation theme
191 * Get the path to the template HTML file.
193 * Returns: The path to the HTML file.
195 char *pidgin_conversation_theme_get_template_path(PidginConvTheme
*theme
);
198 * pidgin_conversation_theme_get_css_path:
199 * @theme: The conversation theme
201 * Get the path to the current variant CSS file.
203 * Returns: The path to the CSS file.
205 char *pidgin_conversation_theme_get_css_path(PidginConvTheme
*theme
);
208 * pidgin_conversation_theme_get_nick_colors:
209 * @theme: The conversation theme
211 * Get (and reference) the array of nick colors
213 * Returns: Pointer to GArray of nick colors, or NULL if no colors in theme
215 GArray
*pidgin_conversation_theme_get_nick_colors(PidginConvTheme
*theme
);
219 #endif /* PIDGIN_CONV_THEME_H */