Code::Blocks  SVN r11506
cbcolourmanager.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3  * http://www.gnu.org/licenses/lgpl-3.0.html
4  */
5 #ifndef X_COLOURMANAGER_H
6 #define X_COLOURMANAGER_H
7 
8 #include <map>
9 #include <wx/colour.h>
10 #include <wx/string.h>
11 
12 #include "manager.h"
13 
14 class DLLIMPORT ColourManager : public Mgr<ColourManager>
15 {
16  friend class Mgr<ColourManager>;
17  friend class Manager;
18  public:
19  void Load();
20  void Save();
21  void RegisterColour(const wxString &category, const wxString &name,
22  const wxString &id, const wxColour &defaultColour);
23  wxColour GetColour(const wxString &id) const;
24  void SetColour(const wxString &id, const wxColour &colour);
25  public:
26  struct ColourDef
27  {
28  wxString category, name;
29  wxColour value, defaultValue;
30 
31  bool IsValid() const
32  {
33  return !name.empty() && !category.empty();
34  }
35  };
36  typedef std::map<wxString, ColourDef> ColourDefMap;
37 
38  const ColourDefMap& GetColourDefinitions() const;
39  private:
40  ColourDefMap m_colours;
41 };
42 
43 #endif // X_COLOURMANAGER_H
44 
45 
bool empty() const
#define DLLIMPORT
Definition: settings.h:16
ColourDefMap m_colours
Definition: manager.h:183
std::map< wxString, ColourDef > ColourDefMap