00001 /*************************************************************************** 00002 iconsets.h - description 00003 ------------------- 00004 begin : Tue Oct 18 2005 00005 copyright : (C) 2005-2006 by Ben Swerts 00006 email : bswerts@users.sourceforge.net 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00020 00021 #ifndef ICONSETS_H 00022 #define ICONSETS_H 00023 00025 00026 // STL headers 00027 #include <vector> 00028 00029 // Qt forward class declarations 00030 #include <qiconset.h> 00031 #include <qpixmap.h> 00032 class QString; 00033 00035 class IconSets 00036 { 00037 public: 00038 ~IconSets(); // default destructor 00039 00040 // public enums 00041 enum IconSetID{Open = 0, Save, Prefs, Image, Help, WhatsThis, LastIcon}; 00042 00043 // static public member functions 00044 static QIconSet getIconSet(const IconSetID id); // returns the iconset associated with the id 00045 static QString factoryName(const IconSetID id); // returns the string with which to access the 'normal' version of the icon 00046 00047 private: 00048 // private enums 00049 enum FactoryID{OpenNormal = 0, OpenActive, SaveNormal, SaveDisabled, SaveActive, 00050 PrefsNormal, PrefsActive, 00051 ImageNormal, ImageDisabled, ImageActive, 00052 HelpNormal, HelpActive, WhatsThisNormal, WhatsThisActive, 00053 LastFactory}; 00054 00055 IconSets(); // private constructor for a static class 00056 00057 // private static member functions 00058 static void initialize(); // fills all pixmaps 00059 static void initPixmap(unsigned char* data, const int sizeX, const int sizeY, const bool alpha, const FactoryID id, const QString idString, const IconSetID iconID = LastIcon); // fills one pixmap 00060 00061 // private static member data 00062 static bool isInitialized; // indicates whether initialize() is called already 00063 static std::vector<QString> factoryNames; // the names of all pixmaps stored in the QMimeSourceFactory 00064 static std::vector<QString> iconNames; // the names of the normal versions of the icons stored in the QMimeSourceFactory 00065 }; 00066 00067 #endif 00068