Frameworks/libpurple.framework/Versions/0.6.2/Headers/theme-manager.h
author Zachary West <zacw@adium.im>
Fri Aug 21 13:25:11 2009 -0700 (2009-08-21)
changeset 2592 e8d15275025e
parent 2535 Frameworks/libpurple.framework/Versions/0.6.0/Headers/theme-manager.h@39c3c161de14
permissions -rw-r--r--
im.pidgin.adium.1-4 at 267c6165e02e34318a1823960bd04c0639952f73
     1 /**
     2  * @file theme-manager.h  Theme Manager API
     3  */
     4 
     5 /*
     6  * purple
     7  *
     8  * Purple is the legal property of its developers, whose names are too numerous
     9  * to list here.  Please refer to the COPYRIGHT file distributed with this
    10  * source distribution.
    11  *
    12  * This program is free software; you can redistribute it and/or modify
    13  * it under the terms of the GNU General Public License as published by
    14  * the Free Software Foundation; either version 2 of the License, or
    15  * (at your option) any later version.
    16  *
    17  * This program is distributed in the hope that it will be useful,
    18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20  * GNU General Public License for more details.
    21  *
    22  * You should have received a copy of the GNU General Public License
    23  * along with this program; if not, write to the Free Software
    24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
    25  */
    26 
    27 #ifndef PURPLE_THEME_MANAGER_H
    28 #define PURPLE_THEME_MANAGER_H
    29 
    30 #include <glib-object.h>
    31 #include <glib.h>
    32 #include "theme.h"
    33 #include "theme-loader.h"
    34 
    35 typedef void (*PTFunc) (PurpleTheme *);
    36 
    37 typedef struct _PurpleThemeManager PurpleThemeManager;
    38 typedef struct _PurpleThemeManagerClass PurpleThemeManagerClass;
    39 
    40 #define PURPLE_TYPE_THEME_MANAGER            (purple_theme_manager_get_type())
    41 #define PURPLE_THEME_MANAGER(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_THEME_MANAGER, PurpleThemeManager))
    42 #define PURPLE_THEME_MANAGER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_THEME_MANAGER, PurpleThemeManagerClass))
    43 #define PURPLE_IS_THEME_MANAGER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_THEME_MANAGER))
    44 #define PURPLE_IS_THEME_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_THEME_MANAGER))
    45 #define PURPLE_GET_THEME_MANAGER_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_THEME_MANAGER, PurpleThemeManagerClass))
    46 
    47 struct _PurpleThemeManager {
    48 	GObject parent;
    49 };
    50 
    51 struct _PurpleThemeManagerClass {
    52 	GObjectClass parent_class;
    53 };
    54 
    55 /**************************************************************************/
    56 /** @name Purple Theme Manager API                                        */
    57 /**************************************************************************/
    58 G_BEGIN_DECLS
    59 
    60 /**
    61  * GObject foo.
    62  *
    63  * @internal.
    64  */
    65 GType purple_theme_manager_get_type(void);
    66 
    67 /**
    68  * Initalizes the theme manager.
    69  */
    70 void purple_theme_manager_init(void);
    71 
    72 /**
    73  * Uninitalizes the manager then frees all the themes and loaders it is
    74  * responsible for.
    75  */
    76 void purple_theme_manager_uninit(void);
    77 
    78 /**
    79  * Rebuilds all the themes in the theme manager.
    80  * (Removes all current themes but keeps the added loaders.)
    81  */
    82 void purple_theme_manager_refresh(void);
    83 
    84 /**
    85  * Finds the PurpleTheme object stored by the theme manager.
    86  *
    87  * @param name The name of the PurpleTheme.
    88  * @param type The type of the PurpleTheme.
    89  *
    90  * @returns The PurpleTheme, or NULL if it wasn't found.
    91  */
    92 PurpleTheme *purple_theme_manager_find_theme(const gchar *name, const gchar *type);
    93 
    94 /**
    95  * Adds a PurpleTheme to the theme manager.  If the theme already exists
    96  * then this function does nothing.
    97  *
    98  * @param theme The PurpleTheme to add to the manager.
    99  */
   100 void purple_theme_manager_add_theme(PurpleTheme *theme);
   101 
   102 /**
   103  * Removes a PurpleTheme from the theme manager and frees the theme.
   104  *
   105  * @param theme The PurpleTheme to remove from the manager.
   106  */
   107 void purple_theme_manager_remove_theme(PurpleTheme *theme);
   108 
   109 /**
   110  * Adds a loader to the theme manager so it knows how to build themes.
   111  *
   112  * @param loader The PurpleThemeLoader to add.
   113  */
   114 void purple_theme_manager_register_type(PurpleThemeLoader *loader);
   115 
   116 /**
   117  * Removes the loader and all themes of the same type from the loader.
   118  *
   119  * @param loader The PurpleThemeLoader to be removed.
   120  */
   121 void purple_theme_manager_unregister_type(PurpleThemeLoader *loader);
   122 
   123 /**
   124  * Calls the given function on each purple theme.
   125  *
   126  * @param func The PTFunc to be applied to each theme.
   127  */
   128 void purple_theme_manager_for_each_theme(PTFunc func);
   129 
   130 /**
   131  * Loads a theme of the given type without adding it to the manager
   132  *
   133  * @param theme_dir	the directory of the theme to load
   134  * @param type		the type of theme to load
   135  */
   136 PurpleTheme *purple_theme_manager_load_theme(const gchar *theme_dir, const gchar *type);
   137 
   138 G_END_DECLS
   139 #endif /* PURPLE_THEME_MANAGER_H */