00001 00002 // Name: ThemeHandler.h 00003 // Purpose: 00004 // Author: Joe Yates 00005 // Modified by: 00006 // Created: 11/10/2004 00007 // RCS-ID: $Id: ThemeHandler.h,v 1.1.1.1 2006/01/24 22:13:19 titusd Exp $ 00008 // Copyright: (c) BID Snc 00009 // License: BSD license (see the file 'LICENSE.txt') 00011 00012 #ifndef __ThemeHandler_h__ 00013 #define __ThemeHandler_h__ 00014 00015 #include "ResourceManager.h" 00016 00017 /* 00018 00019 ThemeHandler virtual base class 00020 00021 */ 00022 00023 class ThemeHandler 00024 { 00025 // friends, classes, enums and types 00026 00027 // Constructors/destructors 00028 public: 00029 virtual ~ThemeHandler() 00030 {}; 00031 00032 // Operators 00033 00034 // Slots 00035 00036 // Methods 00037 public: 00038 virtual bool LoadTheme(const wxString& sNewTheme) = 0; 00039 virtual bool ThemeLoaded() = 0; 00040 virtual wxBitmap GetImage(ResourceId res) = 0; 00041 00042 protected: 00043 wxString sTheme; 00044 bool bThemeLoaded; 00045 }; 00046 00047 /* 00048 class ImageResourceHash : public std::map<int, wxString> 00049 { 00050 //public: 00051 // typedef std::map<int, wxString>::iterator Iterator; 00052 }; 00053 */ 00054 00055 class FileThemeHandler : public ThemeHandler 00056 { 00057 // Constructors/destructors 00058 public: 00059 FileThemeHandler(); 00060 00061 // Method Implementation 00062 public: 00063 bool LoadTheme(const wxString& sNewTheme); 00064 bool ThemeLoaded(); 00065 wxBitmap GetImage(ResourceId res); 00066 00067 private: 00068 std::map<int, wxString> hImageResources; 00069 wxString sAppPath; 00070 wxString sThemePath; 00071 }; 00072 00073 #endif // ndef __ThemeHandler_h__