Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXIconDict.h
1 /********************************************************************************
2 * *
3 * I c o n D i c t i o n a r y *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1998,2013 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXICONDICT_H
22 #define FXICONDICT_H
23 
24 #ifndef FXDICT_H
25 #include "FXDict.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXIconSource;
32 
33 
47 class FXAPI FXIconDict : public FXDict {
48  FXDECLARE(FXIconDict)
49 private:
50  FXIconSource *source; // Icon source
51  FXString path; // Where to search icons
52 protected:
53  FXIconDict():source(NULL){}
54  virtual void *createData(void*);
55  virtual void deleteData(void*);
56 private:
57  FXIconDict(const FXIconDict&);
58  FXIconDict &operator=(const FXIconDict&);
59 public:
60 
62  static const FXchar defaultIconPath[];
63 
64 public:
65 
70  FXIconDict(FXApp* app,const FXString& p=defaultIconPath);
71 
73  void setIconSource(FXIconSource *src){ source=src; }
74 
76  FXIconSource* getIconSource() const { return source; }
77 
79  void setIconPath(const FXString& p){ path=p; }
80 
82  const FXString& getIconPath() const { return path; }
83 
85  FXIcon* insert(const FXchar* name){ return static_cast<FXIcon*>(FXDict::insert(name,const_cast<FXchar*>(name))); }
86 
88  FXIcon* replace(const FXchar* name){ return static_cast<FXIcon*>(FXDict::replace(name,const_cast<FXchar*>(name))); }
89 
91  FXIcon* remove(const FXchar* name){ return static_cast<FXIcon*>(FXDict::remove(name)); }
92 
94  FXIcon* find(const FXchar* name){ return static_cast<FXIcon*>(FXDict::find(name)); }
95 
97  FXIcon* data(FXival pos) const { return static_cast<FXIcon*>(FXDict::data(pos)); }
98 
100  virtual void save(FXStream& store) const;
101 
103  virtual void load(FXStream& store);
104 
106  virtual ~FXIconDict();
107  };
108 
109 
110 }
111 
112 #endif

Copyright © 1997-2013 Jeroen van der Zijp