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

FXFileDict.h
1 /********************************************************************************
2 * *
3 * F i l e - A s s o c i a t i o n T a b l e *
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 FXFILEDICT_H
22 #define FXFILEDICT_H
23 
24 #ifndef FXDICT_H
25 #include "FXDict.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXIconDict;
32 
33 
35 struct FXFileAssoc {
36  FXString command;
43  FXDragType dragtype;
44  FXuint flags;
45  };
46 
47 
48 
82 class FXAPI FXFileDict : public FXDict {
83  FXDECLARE(FXFileDict)
84 private:
85  FXSettings *settings; // Settings database where to get bindings
86  FXIconDict *icons; // Icon dictionary which keeps track of loaded icons
87 protected:
88  FXFileDict(){}
89  virtual void *createData(void*);
90  virtual void deleteData(void*);
91 private:
92  FXFileDict(const FXFileDict&);
93  FXFileDict &operator=(const FXFileDict&);
94 public:
95 
97  static const FXchar defaultExecBinding[];
98 
100  static const FXchar defaultDirBinding[];
101 
103  static const FXchar defaultFileBinding[];
104 
105 public:
106 
113  FXFileDict(FXApp* app);
114 
121  FXFileDict(FXApp* app,FXSettings* db);
122 
124  void setSettings(FXSettings* s){ settings=s; }
125 
127  FXSettings* getSettings() const { return settings; }
128 
130  void setIconDict(FXIconDict *icns){ icons=icns; }
131 
133  FXIconDict* getIconDict() const { return icons; }
134 
139  void setIconPath(const FXString& path);
140 
142  const FXString& getIconPath() const;
143 
164  FXFileAssoc* replace(const FXchar* ext,const FXchar* str);
165 
167  FXFileAssoc* remove(const FXchar* ext);
168 
170  FXFileAssoc* find(const FXchar* ext);
171 
173  FXFileAssoc* data(FXival pos) const { return (FXFileAssoc*)FXDict::data(pos); }
174 
189  virtual FXFileAssoc* findFileBinding(const FXchar* pathname);
190 
205  virtual FXFileAssoc* findDirBinding(const FXchar* pathname);
206 
213  virtual FXFileAssoc* findExecBinding(const FXchar* pathname);
214 
216  virtual void save(FXStream& store) const;
217 
219  virtual void load(FXStream& store);
220 
222  virtual ~FXFileDict();
223  };
224 
225 }
226 
227 #endif

Copyright © 1997-2013 Jeroen van der Zijp