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
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
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>
35 #include "theme-loader.h"
37 typedef void (*PurpleThemeFunc
) (PurpleTheme
*theme
);
39 #define PURPLE_TYPE_THEME_MANAGER purple_theme_manager_get_type()
41 /**************************************************************************/
42 /* Purple Theme Manager API */
43 /**************************************************************************/
47 * purple_theme_manager_get_type:
49 * Returns: The #GType for theme manager.
51 G_DECLARE_FINAL_TYPE(PurpleThemeManager
, purple_theme_manager
, PURPLE
,
52 THEME_MANAGER
, GObject
)
55 * purple_theme_manager_init:
57 * Initalizes the theme manager.
59 void purple_theme_manager_init(void);
62 * purple_theme_manager_uninit:
64 * Uninitalizes the manager then frees all the themes and loaders it is
67 void purple_theme_manager_uninit(void);
70 * purple_theme_manager_refresh:
72 * Rebuilds all the themes in the theme manager.
73 * (Removes all current themes but keeps the added loaders.)
75 void purple_theme_manager_refresh(void);
78 * purple_theme_manager_find_theme:
79 * @name: The name of the PurpleTheme.
80 * @type: The type of the PurpleTheme.
82 * Finds the PurpleTheme object stored by the theme manager.
84 * Returns: (transfer none): The PurpleTheme, or NULL if it wasn't found.
86 PurpleTheme
*purple_theme_manager_find_theme(const gchar
*name
, const gchar
*type
);
89 * purple_theme_manager_add_theme:
90 * @theme: The PurpleTheme to add to the manager.
92 * Adds a PurpleTheme to the theme manager. If the theme already exists
93 * then this function does nothing.
95 void purple_theme_manager_add_theme(PurpleTheme
*theme
);
98 * purple_theme_manager_remove_theme:
99 * @theme: The PurpleTheme to remove from the manager.
101 * Removes a PurpleTheme from the theme manager and frees the theme.
103 void purple_theme_manager_remove_theme(PurpleTheme
*theme
);
106 * purple_theme_manager_register_type:
107 * @loader: The PurpleThemeLoader to add.
109 * Adds a loader to the theme manager so it knows how to build themes.
111 void purple_theme_manager_register_type(PurpleThemeLoader
*loader
);
114 * purple_theme_manager_unregister_type:
115 * @loader: The PurpleThemeLoader to be removed.
117 * Removes the loader and all themes of the same type from the loader.
119 void purple_theme_manager_unregister_type(PurpleThemeLoader
*loader
);
122 * purple_theme_manager_for_each_theme:
123 * @func: (scope call): The PurpleThemeFunc to be applied to each theme.
125 * Calls the given function on each purple theme.
127 void purple_theme_manager_for_each_theme(PurpleThemeFunc func
);
130 * purple_theme_manager_load_theme:
131 * @theme_dir: the directory of the theme to load
132 * @type: the type of theme to load
134 * Loads a theme of the given type without adding it to the manager
136 * Returns: (transfer full): The newly loaded theme.
138 PurpleTheme
*purple_theme_manager_load_theme(const gchar
*theme_dir
, const gchar
*type
);
142 #endif /* PURPLE_THEME_MANAGER_H */