00001 /***************************************************************************** 00002 * theme_repository.hpp 00003 ***************************************************************************** 00004 * Copyright (C) 2004 the VideoLAN team 00005 * $Id: 7abacee0575cd2c82d91c3ca22b7597bab6b6754 $ 00006 * 00007 * Authors: Cyril Deguet <asmax@via.ecp.fr> 00008 * 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License along 00020 * with this program; if not, write to the Free Software Foundation, Inc., 00021 * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 00022 *****************************************************************************/ 00023 00024 #ifndef THEME_REPOSITORY_HPP 00025 #define THEME_REPOSITORY_HPP 00026 00027 #include "skin_common.hpp" 00028 #include <map> 00029 00030 00031 /// Singleton object handling the list of available themes 00032 class ThemeRepository: public SkinObject 00033 { 00034 public: 00035 /// Get the instance of ThemeRepository 00036 /// Returns NULL if the initialization of the object failed 00037 static ThemeRepository *instance( intf_thread_t *pIntf ); 00038 00039 /// Delete the instance of ThemeRepository 00040 static void destroy( intf_thread_t *pIntf ); 00041 00042 /// Update repository 00043 void updateRepository(); 00044 00045 protected: 00046 // Protected because it is a singleton 00047 ThemeRepository( intf_thread_t *pIntf ); 00048 virtual ~ThemeRepository(); 00049 00050 private: 00051 /// Look for themes in a directory 00052 void parseDirectory( const string &rDir ); 00053 00054 /// Callback for menu item selection 00055 static int changeSkin( vlc_object_t *pThis, char const *pVariable, 00056 vlc_value_t oldval, vlc_value_t newval, 00057 void *pData ); 00058 00059 /// list of skins available 00060 map<string,string> m_skinsMap; 00061 }; 00062 00063 00064 #endif
1.5.6