My Project
|
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 namespace SallyAPI 00029 { 00030 namespace GUI 00031 { 00032 class CPicture; 00033 } 00034 } 00035 00036 #pragma once 00037 #include "Define.h" 00038 00039 #include <map> 00040 #include "Font.h" 00041 #include "Picture.h" 00042 #include "ThemePluginImage.h" 00043 #include "AutoLock.h" 00044 00045 namespace SallyAPI 00046 { 00047 namespace Config 00048 { 00057 00058 class DLL_API_SALLY CTheme 00059 { 00060 private: 00061 std::map<int, SallyAPI::GUI::CPicture*> m_mGUICache; 00062 std::map<std::string, std::string> m_mPropertyCache; 00063 std::map<int, std::string> m_mAdvancedImages; 00064 std::map<int, SallyAPI::Config::CThemePluginImage*> m_mPluginImages; 00065 00066 SallyAPI::System::CCritSection m_Lock; 00067 std::string m_strThemePath; 00068 std::string m_strThemeName; 00069 00070 void AddPicture(const std::string& filename, int id, bool createMipMaps = false); 00071 public: 00072 CTheme(const std::string& name); 00073 ~CTheme(); 00074 00075 SallyAPI::GUI::CPicture* GetPicture(int id); 00076 std::string GetThemePath(); 00077 std::string GetThemeName(); 00078 00079 void AddPicture(const std::string& filename, int id, int graphicId, bool createMipMaps = false); 00080 void AddPicturePlugin(const std::string& pluginPath, const std::string& pluginName, 00081 const std::string& filename, bool createMipMaps, int id); 00082 void AddPictureFullPath(const std::string& filename, int id, bool createMipMaps); 00083 void RemovePicture(int id); 00084 00085 int GetPropertyInt(const std::string& component, const std::string& id, 00086 const std::string& defaultString = "Unknown"); 00087 std::string GetPropertyString(const std::string& component, const std::string& id, 00088 const std::string& defaultString = "Unknown"); 00089 00090 std::map<int, std::string>& GetAdvancedImages(); 00091 std::map<int, SallyAPI::Config::CThemePluginImage*>& GetPluginImages(); 00092 }; 00093 } 00094 }