Migrate xmpp-caps.xml to XDG cache dir
[pidgin-git.git] / libpurple / theme-manager.h
blob2b05abcc2056229947844abe1a1bd554a59314d7
1 /*
2 * purple
4 * Purple is the legal property of its developers, whose names are too numerous
5 * to list here. Please refer to the COPYRIGHT file distributed with this
6 * source distribution.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
23 #ifndef PURPLE_THEME_MANAGER_H
24 #define PURPLE_THEME_MANAGER_H
25 /**
26 * SECTION:theme-manager
27 * @section_id: libpurple-theme-manager
28 * @short_description: <filename>theme-manager.h</filename>
29 * @title: Theme Manager API
32 #include <glib-object.h>
33 #include <glib.h>
34 #include "theme.h"
35 #include "theme-loader.h"
37 typedef void (*PurpleThemeFunc) (PurpleTheme *);
39 typedef struct _PurpleThemeManager PurpleThemeManager;
40 typedef struct _PurpleThemeManagerClass PurpleThemeManagerClass;
42 #define PURPLE_TYPE_THEME_MANAGER (purple_theme_manager_get_type())
43 #define PURPLE_THEME_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_THEME_MANAGER, PurpleThemeManager))
44 #define PURPLE_THEME_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_THEME_MANAGER, PurpleThemeManagerClass))
45 #define PURPLE_IS_THEME_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_THEME_MANAGER))
46 #define PURPLE_IS_THEME_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_THEME_MANAGER))
47 #define PURPLE_GET_THEME_MANAGER_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_THEME_MANAGER, PurpleThemeManagerClass))
49 struct _PurpleThemeManager {
50 GObject parent;
53 struct _PurpleThemeManagerClass {
54 GObjectClass parent_class;
56 /*< private >*/
57 void (*purple_reserved1)(void);
58 void (*purple_reserved2)(void);
59 void (*purple_reserved3)(void);
60 void (*purple_reserved4)(void);
63 /**************************************************************************/
64 /* Purple Theme Manager API */
65 /**************************************************************************/
66 G_BEGIN_DECLS
68 /**
69 * purple_theme_manager_get_type:
71 * Returns: The #GType for theme manager.
73 GType purple_theme_manager_get_type(void);
75 /**
76 * purple_theme_manager_init:
78 * Initalizes the theme manager.
80 void purple_theme_manager_init(void);
82 /**
83 * purple_theme_manager_uninit:
85 * Uninitalizes the manager then frees all the themes and loaders it is
86 * responsible for.
88 void purple_theme_manager_uninit(void);
90 /**
91 * purple_theme_manager_refresh:
93 * Rebuilds all the themes in the theme manager.
94 * (Removes all current themes but keeps the added loaders.)
96 void purple_theme_manager_refresh(void);
98 /**
99 * purple_theme_manager_find_theme:
100 * @name: The name of the PurpleTheme.
101 * @type: The type of the PurpleTheme.
103 * Finds the PurpleTheme object stored by the theme manager.
105 * Returns: The PurpleTheme, or NULL if it wasn't found.
107 PurpleTheme *purple_theme_manager_find_theme(const gchar *name, const gchar *type);
110 * purple_theme_manager_add_theme:
111 * @theme: The PurpleTheme to add to the manager.
113 * Adds a PurpleTheme to the theme manager. If the theme already exists
114 * then this function does nothing.
116 void purple_theme_manager_add_theme(PurpleTheme *theme);
119 * purple_theme_manager_remove_theme:
120 * @theme: The PurpleTheme to remove from the manager.
122 * Removes a PurpleTheme from the theme manager and frees the theme.
124 void purple_theme_manager_remove_theme(PurpleTheme *theme);
127 * purple_theme_manager_register_type:
128 * @loader: The PurpleThemeLoader to add.
130 * Adds a loader to the theme manager so it knows how to build themes.
132 void purple_theme_manager_register_type(PurpleThemeLoader *loader);
135 * purple_theme_manager_unregister_type:
136 * @loader: The PurpleThemeLoader to be removed.
138 * Removes the loader and all themes of the same type from the loader.
140 void purple_theme_manager_unregister_type(PurpleThemeLoader *loader);
143 * purple_theme_manager_for_each_theme:
144 * @func: The PurpleThemeFunc to be applied to each theme.
146 * Calls the given function on each purple theme.
148 void purple_theme_manager_for_each_theme(PurpleThemeFunc func);
151 * purple_theme_manager_load_theme:
152 * @theme_dir: the directory of the theme to load
153 * @type: the type of theme to load
155 * Loads a theme of the given type without adding it to the manager
157 PurpleTheme *purple_theme_manager_load_theme(const gchar *theme_dir, const gchar *type);
159 G_END_DECLS
161 #endif /* PURPLE_THEME_MANAGER_H */