1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/Frameworks/libpurple.framework/Versions/0.6.2/Headers/theme-manager.h Fri Aug 21 13:25:11 2009 -0700
1.3 @@ -0,0 +1,139 @@
1.4 +/**
1.5 + * @file theme-manager.h Theme Manager API
1.6 + */
1.7 +
1.8 +/*
1.9 + * purple
1.10 + *
1.11 + * Purple is the legal property of its developers, whose names are too numerous
1.12 + * to list here. Please refer to the COPYRIGHT file distributed with this
1.13 + * source distribution.
1.14 + *
1.15 + * This program is free software; you can redistribute it and/or modify
1.16 + * it under the terms of the GNU General Public License as published by
1.17 + * the Free Software Foundation; either version 2 of the License, or
1.18 + * (at your option) any later version.
1.19 + *
1.20 + * This program is distributed in the hope that it will be useful,
1.21 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.23 + * GNU General Public License for more details.
1.24 + *
1.25 + * You should have received a copy of the GNU General Public License
1.26 + * along with this program; if not, write to the Free Software
1.27 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
1.28 + */
1.29 +
1.30 +#ifndef PURPLE_THEME_MANAGER_H
1.31 +#define PURPLE_THEME_MANAGER_H
1.32 +
1.33 +#include <glib-object.h>
1.34 +#include <glib.h>
1.35 +#include "theme.h"
1.36 +#include "theme-loader.h"
1.37 +
1.38 +typedef void (*PTFunc) (PurpleTheme *);
1.39 +
1.40 +typedef struct _PurpleThemeManager PurpleThemeManager;
1.41 +typedef struct _PurpleThemeManagerClass PurpleThemeManagerClass;
1.42 +
1.43 +#define PURPLE_TYPE_THEME_MANAGER (purple_theme_manager_get_type())
1.44 +#define PURPLE_THEME_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_THEME_MANAGER, PurpleThemeManager))
1.45 +#define PURPLE_THEME_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_THEME_MANAGER, PurpleThemeManagerClass))
1.46 +#define PURPLE_IS_THEME_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_THEME_MANAGER))
1.47 +#define PURPLE_IS_THEME_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_THEME_MANAGER))
1.48 +#define PURPLE_GET_THEME_MANAGER_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_THEME_MANAGER, PurpleThemeManagerClass))
1.49 +
1.50 +struct _PurpleThemeManager {
1.51 + GObject parent;
1.52 +};
1.53 +
1.54 +struct _PurpleThemeManagerClass {
1.55 + GObjectClass parent_class;
1.56 +};
1.57 +
1.58 +/**************************************************************************/
1.59 +/** @name Purple Theme Manager API */
1.60 +/**************************************************************************/
1.61 +G_BEGIN_DECLS
1.62 +
1.63 +/**
1.64 + * GObject foo.
1.65 + *
1.66 + * @internal.
1.67 + */
1.68 +GType purple_theme_manager_get_type(void);
1.69 +
1.70 +/**
1.71 + * Initalizes the theme manager.
1.72 + */
1.73 +void purple_theme_manager_init(void);
1.74 +
1.75 +/**
1.76 + * Uninitalizes the manager then frees all the themes and loaders it is
1.77 + * responsible for.
1.78 + */
1.79 +void purple_theme_manager_uninit(void);
1.80 +
1.81 +/**
1.82 + * Rebuilds all the themes in the theme manager.
1.83 + * (Removes all current themes but keeps the added loaders.)
1.84 + */
1.85 +void purple_theme_manager_refresh(void);
1.86 +
1.87 +/**
1.88 + * Finds the PurpleTheme object stored by the theme manager.
1.89 + *
1.90 + * @param name The name of the PurpleTheme.
1.91 + * @param type The type of the PurpleTheme.
1.92 + *
1.93 + * @returns The PurpleTheme, or NULL if it wasn't found.
1.94 + */
1.95 +PurpleTheme *purple_theme_manager_find_theme(const gchar *name, const gchar *type);
1.96 +
1.97 +/**
1.98 + * Adds a PurpleTheme to the theme manager. If the theme already exists
1.99 + * then this function does nothing.
1.100 + *
1.101 + * @param theme The PurpleTheme to add to the manager.
1.102 + */
1.103 +void purple_theme_manager_add_theme(PurpleTheme *theme);
1.104 +
1.105 +/**
1.106 + * Removes a PurpleTheme from the theme manager and frees the theme.
1.107 + *
1.108 + * @param theme The PurpleTheme to remove from the manager.
1.109 + */
1.110 +void purple_theme_manager_remove_theme(PurpleTheme *theme);
1.111 +
1.112 +/**
1.113 + * Adds a loader to the theme manager so it knows how to build themes.
1.114 + *
1.115 + * @param loader The PurpleThemeLoader to add.
1.116 + */
1.117 +void purple_theme_manager_register_type(PurpleThemeLoader *loader);
1.118 +
1.119 +/**
1.120 + * Removes the loader and all themes of the same type from the loader.
1.121 + *
1.122 + * @param loader The PurpleThemeLoader to be removed.
1.123 + */
1.124 +void purple_theme_manager_unregister_type(PurpleThemeLoader *loader);
1.125 +
1.126 +/**
1.127 + * Calls the given function on each purple theme.
1.128 + *
1.129 + * @param func The PTFunc to be applied to each theme.
1.130 + */
1.131 +void purple_theme_manager_for_each_theme(PTFunc func);
1.132 +
1.133 +/**
1.134 + * Loads a theme of the given type without adding it to the manager
1.135 + *
1.136 + * @param theme_dir the directory of the theme to load
1.137 + * @param type the type of theme to load
1.138 + */
1.139 +PurpleTheme *purple_theme_manager_load_theme(const gchar *theme_dir, const gchar *type);
1.140 +
1.141 +G_END_DECLS
1.142 +#endif /* PURPLE_THEME_MANAGER_H */