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

FXFileAssociations.h
1 /********************************************************************************
2 * *
3 * F i l e A s s o c i a t i o n s *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1998,2017 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 FXFILEASSOCIATIONS_H
22 #define FXFILEASSOCIATIONS_H
23 
24 #ifndef FXOBJECT_H
25 #include "FXObject.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXIcon;
32 class FXIconSource;
33 
34 
36 struct FXFileAssoc {
37  FXString command;
44  FXDragType dragtype;
45  FXuint flags;
46  };
47 
48 
49 // Dictionary of file associations
51 
52 
101 class FXAPI FXFileAssociations : public FXObject {
102  FXDECLARE(FXFileAssociations)
103 protected:
104  FXFileAssocDictionary bindings; // File bindings dictionary
105  FXIconCache cache; // Cache icons for rapid access
106  FXSettings *settings; // Settings database for looking up extensions
107 protected:
109 private:
111  FXFileAssociations &operator=(const FXFileAssociations&);
112 public:
113 
115  static const FXchar defaultExecBinding[];
116 
118  static const FXchar defaultDirBinding[];
119 
121  static const FXchar defaultFileBinding[];
122 
123 public:
124 
132 
140 
144  void setSettings(FXSettings* sdb){ settings=sdb; }
145 
149  FXSettings* getSettings() const { return settings; }
150 
154  void setIconSource(FXIconSource* src){ cache.setIconSource(src); }
155 
159  FXIconSource* getIconSource() const { return cache.getIconSource(); }
160 
164  void setIconPath(const FXString& path){ cache.setIconPath(path); }
165 
169  const FXString& getIconPath() const { return cache.getIconPath(); }
170 
174  virtual FXFileAssoc* parse(const FXString& assoc);
175 
183  virtual FXFileAssoc* fetch(const FXString& ext);
184 
199  virtual FXFileAssoc* findFileBinding(const FXString& pathname);
200 
215  virtual FXFileAssoc* findDirBinding(const FXString& pathname);
216 
223  virtual FXFileAssoc* findExecBinding(const FXString& pathname);
224 
228  void clear();
229 
233  virtual void save(FXStream& store) const;
234 
238  virtual void load(FXStream& store);
239 
243  virtual ~FXFileAssociations();
244  };
245 
246 }
247 
248 #endif

Copyright © 1997-2016 Jeroen van der Zijp