Remove redundant NULL checks
[pidgin-git.git] / pidgin / gtkblist-theme.h
blob2c4fb07fb0c25607cdafc4210cc368800127d5d0
1 /**
2 * @file gtkblist-theme.h GTK+ Buddy List Theme API
3 */
5 /* pidgin
7 * Pidgin is the legal property of its developers, whose names are too numerous
8 * to list here. Please refer to the COPYRIGHT file distributed with this
9 * source distribution.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
26 #ifndef PIDGIN_BLIST_THEME_H
27 #define PIDGIN_BLIST_THEME_H
29 #include <glib.h>
30 #include <glib-object.h>
31 #include <gtk/gtk.h>
33 #include "theme.h"
35 /**
36 * A pidgin buddy list theme.
37 * This is an object for Purple to represent a buddy list theme.
39 * PidginBlistTheme is a PurpleTheme Object.
41 typedef struct _PidginBlistTheme PidginBlistTheme;
42 typedef struct _PidginBlistThemeClass PidginBlistThemeClass;
44 #define PIDGIN_TYPE_BLIST_THEME (pidgin_blist_theme_get_type ())
45 #define PIDGIN_BLIST_THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIDGIN_TYPE_BLIST_THEME, PidginBlistTheme))
46 #define PIDGIN_BLIST_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PIDGIN_TYPE_BLIST_THEME, PidginBlistThemeClass))
47 #define PIDGIN_IS_BLIST_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIDGIN_TYPE_BLIST_THEME))
48 #define PIDGIN_IS_BLIST_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PIDGIN_TYPE_BLIST_THEME))
49 #define PIDGIN_BLIST_THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PIDGIN_TYPE_BLIST_THEME, PidginBlistThemeClass))
51 struct _PidginBlistTheme
53 PurpleTheme parent;
54 gpointer priv;
57 struct _PidginBlistThemeClass
59 PurpleThemeClass parent_class;
62 #if 0
63 typedef struct
65 const gchar *font;
66 const gchar *color;
68 } PidginThemeFont;
69 #endif
70 typedef struct _PidginThemeFont PidginThemeFont;
72 typedef struct
74 gint status_icon;
75 gint text;
76 gint emblem;
77 gint protocol_icon;
78 gint buddy_icon;
79 gboolean show_status;
81 } PidginBlistLayout;
83 /**************************************************************************/
84 /** @name PidginThemeFont API */
85 /**************************************************************************/
87 /**
88 * Create a new PidginThemeFont.
90 * @param face The font face
91 * @param color The color of the font
93 * @return A newly created PidginThemeFont
95 PidginThemeFont * pidgin_theme_font_new(const gchar *face, GdkColor *color);
97 /**
98 * Frees a font and color pair
100 * @param font The theme font
102 void pidgin_theme_font_free(PidginThemeFont *font);
105 * Set the font-face of a PidginThemeFont.
107 * @param font The PidginThemeFont
108 * @param face The font-face
110 void pidgin_theme_font_set_font_face(PidginThemeFont *font, const gchar *face);
113 * Set the color of a PidginThemeFont.
115 * @param font The PidginThemeFont
116 * @param color The color
118 void pidgin_theme_font_set_color(PidginThemeFont *font, const GdkColor *color);
121 * Get the font-face of a PidginThemeFont.
123 * @param font The PidginThemeFont
125 * @return The font-face, or NULL if none is set.
127 const gchar * pidgin_theme_font_get_font_face(PidginThemeFont *font);
130 * Get the color of a PidginThemeFont as a GdkColor object.
132 * @param font The PidginThemeFont
134 * @return The color, or NULL if none is set.
136 const GdkColor * pidgin_theme_font_get_color(PidginThemeFont *font);
139 * Get the color of a PidginThemeFont.
141 * @param font The PidginThemeFont
143 * @return The color, or NULL if none is set.
145 const gchar * pidgin_theme_font_get_color_describe(PidginThemeFont *font);
147 /**************************************************************************/
148 /** @name Purple Buddy List Theme API */
149 /**************************************************************************/
150 G_BEGIN_DECLS
153 * GObject foo.
154 * @internal.
156 GType pidgin_blist_theme_get_type(void);
158 /* get methods */
161 * Returns the background color of the buddy list.
163 * @param theme The PidginBlist theme.
165 * @returns A gdk color.
167 GdkColor *pidgin_blist_theme_get_background_color(PidginBlistTheme *theme);
170 * Returns the opacity of the buddy list window
171 * (0.0 or clear to 1.0 fully opaque).
173 * @param theme The PidginBlist theme.
175 * @returns The opacity
177 gdouble pidgin_blist_theme_get_opacity(PidginBlistTheme *theme);
180 * Returns the layout to be used with the buddy list.
182 * @param theme The PidginBlist theme.
184 * @returns The buddy list layout.
186 PidginBlistLayout *pidgin_blist_theme_get_layout(PidginBlistTheme *theme);
189 * Returns the background color to be used with expanded groups.
191 * @param theme The PidginBlist theme.
193 * @returns A gdk color.
195 GdkColor *pidgin_blist_theme_get_expanded_background_color(PidginBlistTheme *theme);
198 * Returns the text font and color to be used with expanded groups.
200 * @param theme The PidginBlist theme.
202 * @returns A font and color pair.
204 PidginThemeFont *pidgin_blist_theme_get_expanded_text_info(PidginBlistTheme *theme);
207 * Returns the background color to be used with collapsed groups.
209 * @param theme The PidginBlist theme.
211 * @returns A gdk color.
213 GdkColor *pidgin_blist_theme_get_collapsed_background_color(PidginBlistTheme *theme);
216 * Returns the text font and color to be used with collapsed groups.
218 * @param theme The PidginBlist theme.
220 * @returns A font and color pair.
222 PidginThemeFont *pidgin_blist_theme_get_collapsed_text_info(PidginBlistTheme *theme);
225 * Returns the colors to be used for contacts and chats.
227 * @param theme The PidginBlist theme.
229 * @returns A gdkcolor for contacts and chats.
231 GdkColor *pidgin_blist_theme_get_contact_color(PidginBlistTheme *theme);
234 * Returns the text font and color to be used for expanded contacts.
236 * @param theme The PidginBlist theme.
238 * @returns A font and color pair.
240 PidginThemeFont *pidgin_blist_theme_get_contact_text_info(PidginBlistTheme *theme);
243 * Returns the text font and color to be used for online buddies.
245 * @param theme The PidginBlist theme.
247 * @returns A font and color pair.
249 PidginThemeFont *pidgin_blist_theme_get_online_text_info(PidginBlistTheme *theme);
252 * Returns the text font and color to be used for away and idle buddies.
254 * @param theme The PidginBlist theme.
256 * @returns A font and color pair.
258 PidginThemeFont *pidgin_blist_theme_get_away_text_info(PidginBlistTheme *theme);
261 * Returns the text font and color to be used for offline buddies.
263 * @param theme The PidginBlist theme.
265 * @returns A font and color pair.
267 PidginThemeFont *pidgin_blist_theme_get_offline_text_info(PidginBlistTheme *theme);
270 * Returns the text font and color to be used for idle buddies.
272 * @param theme The PidginBlist theme.
274 * @returns A font and color pair.
276 PidginThemeFont *pidgin_blist_theme_get_idle_text_info(PidginBlistTheme *theme);
279 * Returns the text font and color to be used for buddies with unread messages.
281 * @param theme The PidginBlist theme.
283 * @returns A font and color pair.
285 PidginThemeFont *pidgin_blist_theme_get_unread_message_text_info(PidginBlistTheme *theme);
288 * Returns the text font and color to be used for chats with unread messages
289 * that mention your nick.
291 * @param theme The PidginBlist theme.
293 * @returns A font and color pair.
295 PidginThemeFont *pidgin_blist_theme_get_unread_message_nick_said_text_info(PidginBlistTheme *theme);
298 * Returns the text font and color to be used for a buddy's status message.
300 * @param theme The PidginBlist theme.
302 * @returns A font and color pair.
304 PidginThemeFont *pidgin_blist_theme_get_status_text_info(PidginBlistTheme *theme);
306 /* Set Methods */
309 * Sets the background color to be used for this buddy list theme.
311 * @param theme The PidginBlist theme.
312 * @param color The new background color.
314 void pidgin_blist_theme_set_background_color(PidginBlistTheme *theme, const GdkColor *color);
317 * Sets the opacity to be used for this buddy list theme.
319 * @param theme The PidginBlist theme.
320 * @param opacity The new opacity setting.
322 void pidgin_blist_theme_set_opacity(PidginBlistTheme *theme, gdouble opacity);
325 * Sets the buddy list layout to be used for this buddy list theme.
327 * @param theme The PidginBlist theme.
328 * @param layout The new layout.
330 void pidgin_blist_theme_set_layout(PidginBlistTheme *theme, const PidginBlistLayout *layout);
333 * Sets the background color to be used for expanded groups.
335 * @param theme The PidginBlist theme.
336 * @param color The new background color.
338 void pidgin_blist_theme_set_expanded_background_color(PidginBlistTheme *theme, const GdkColor *color);
341 * Sets the text color and font to be used for expanded groups.
343 * @param theme The PidginBlist theme.
344 * @param pair The new text font and color pair.
346 void pidgin_blist_theme_set_expanded_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
349 * Sets the background color to be used for collapsed groups.
351 * @param theme The PidginBlist theme.
352 * @param color The new background color.
354 void pidgin_blist_theme_set_collapsed_background_color(PidginBlistTheme *theme, const GdkColor *color);
357 * Sets the text color and font to be used for expanded groups.
359 * @param theme The PidginBlist theme.
360 * @param pair The new text font and color pair.
362 void pidgin_blist_theme_set_collapsed_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
365 * Sets the background color to be used for contacts and chats.
367 * @param theme The PidginBlist theme.
368 * @param color The color to use for contacts and chats.
370 void pidgin_blist_theme_set_contact_color(PidginBlistTheme *theme, const GdkColor *color);
373 * Sets the text color and font to be used for expanded contacts.
375 * @param theme The PidginBlist theme.
376 * @param pair The new text font and color pair.
378 void pidgin_blist_theme_set_contact_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
381 * Sets the text color and font to be used for online buddies.
383 * @param theme The PidginBlist theme.
384 * @param pair The new text font and color pair.
386 void pidgin_blist_theme_set_online_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
389 * Sets the text color and font to be used for away and idle buddies.
391 * @param theme The PidginBlist theme.
392 * @param pair The new text font and color pair.
394 void pidgin_blist_theme_set_away_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
397 * Sets the text color and font to be used for offline buddies.
399 * @param theme The PidginBlist theme.
400 * @param pair The new text font and color pair.
402 void pidgin_blist_theme_set_offline_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
405 * Sets the text color and font to be used for idle buddies.
407 * @param theme The PidginBlist theme.
408 * @param pair The new text font and color pair.
410 void pidgin_blist_theme_set_idle_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
413 * Sets the text color and font to be used for buddies with unread messages.
415 * @param theme The PidginBlist theme.
416 * @param pair The new text font and color pair.
418 void pidgin_blist_theme_set_unread_message_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
421 * Sets the text color and font to be used for a chat with unread messages
422 * that mention your nick.
424 * @param theme The PidginBlist theme.
425 * @param pair The new text font and color pair.
427 void pidgin_blist_theme_set_unread_message_nick_said_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
430 * Sets the text color and font to be used for buddy status messages.
432 * @param theme The PidginBlist theme.
433 * @param pair The new text font and color pair.
435 void pidgin_blist_theme_set_status_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
437 G_END_DECLS
438 #endif /* PIDGIN_BLIST_THEME_H */