]> git.sesse.net Git - vlc/blob - modules/gui/skins2/src/theme_repository.hpp
Contribs: update freetype to 2.4.2
[vlc] / modules / gui / skins2 / src / theme_repository.hpp
1 /*****************************************************************************
2  * theme_repository.hpp
3  *****************************************************************************
4  * Copyright (C) 2004 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef THEME_REPOSITORY_HPP
25 #define THEME_REPOSITORY_HPP
26
27 #include "skin_common.hpp"
28 #include <map>
29
30
31 /// Singleton object handling the list of available themes
32 class ThemeRepository: public SkinObject
33 {
34 public:
35     /// Get the instance of ThemeRepository
36     /// Returns NULL if the initialization of the object failed
37     static ThemeRepository *instance( intf_thread_t *pIntf );
38
39     /// Delete the instance of ThemeRepository
40     static void destroy( intf_thread_t *pIntf );
41
42     /// Update repository
43     void updateRepository();
44
45 protected:
46     // Protected because it is a singleton
47     ThemeRepository( intf_thread_t *pIntf );
48     virtual ~ThemeRepository();
49
50 private:
51     /// Look for themes in a directory
52     void parseDirectory( const string &rDir );
53
54     /// Callback for menu item selection
55     static int changeSkin( vlc_object_t *pThis, char const *pVariable,
56                            vlc_value_t oldval, vlc_value_t newval,
57                            void *pData );
58
59     /// list of skins available
60     map<string,string> m_skinsMap;
61 };
62
63
64 #endif