Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

ResourceManager.h

Go to the documentation of this file.
00001 
00002 // Name:        ResourceManager.h
00003 // Purpose:     
00004 // Author:      Joe Yates
00005 // Modified by:
00006 // Created:     11/10/2004
00007 // RCS-ID:      $Id: ResourceManager.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 __ResourceManager_h__
00013 #define __ResourceManager_h__
00014 
00015 class ThemeHandler;
00016 
00017 enum ResourceId
00018   {
00019   // DirectoryView items (Keep this list at start - must match entries in ResourceManager's image list)
00020   resUnknown = 0,
00021   resCharacter,
00022   resBlock,
00023   resFIFO,
00024   resLink,
00025   resFolderNormal,
00026   resFolderHidden,
00027   resFolderNormalDropTarget,
00028   resFolderHiddenDropTarget,
00029   resFileNormal,
00030   resFileHidden,
00031   // DirectoryTree items
00032   resButtonPlus,
00033   resButtonMinus,
00034   // Other
00035   resApplication,
00036   };
00037 
00038 /*
00039 
00040 The ResourceManager's wxImageList holds images for the DirectoryView.
00041 The images are:
00042 - a number of standard images,
00043 - images loaded according to file types.
00044   
00045 */
00046 
00047 class ResourceManager : public wxImageList, public wxFileTypesManager
00048   {
00049   // friends, classes, enums and types
00050   private:
00051     typedef std::map<wxString, int> TypeIndexMap;
00052 
00053   // Constructors/destructors
00054   public:
00055     ResourceManager();
00056     ~ResourceManager();
00057 
00058   // Operators
00059 
00060   // Slots
00061 
00062   // Methods
00063   public:
00064     // Methods
00065     wxBitmap        GetImage(ResourceId res);
00066     int             GetDirectoryImageIndex(bool bHidden, bool bDropTarget);
00067     int             GetFileImageIndex(bool bHidden);
00068     bool            Activate(const wxString& sPathName);
00069   
00070     wxString        GetDescription(const wxString& sFileType);
00071     int             GetImageIndex(const wxString& sFileType, bool bHidden = false);
00072     int             GetLinkImageIndex(const wxString& sFileType, bool bHidden = false);
00073     bool            IsBinaryExecutable(const wxString& sFileType);
00074 
00075   private:
00076     wxBitmap        GetImageForFileType(const wxString& sFileType);
00077     int             AddImage(const wxString& sFileType, const wxBitmap& bmp);
00078 
00079   private:
00080     int             nFolderIndexBase;
00081     int             nFileIndexBase;
00082     ThemeHandler *  thm; // thm is a pointer to a ThemeHandler subclass
00083     TypeIndexMap    hImageIndex;
00084   };
00085 
00086 #endif // ndef __ResourceManager_h__

Generated on Wed Jan 25 08:14:45 2006 for Sherpa by doxygen 1.3.6