Version: 0.6.0
gxfilters.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: wxGxObjectDialog filters of GxObjects to show.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009,2011,2012 Dmitry Baryshnikov
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program 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 General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  ****************************************************************************/
21 
22 #pragma once
23 
24 #include "wxgis/datasource/datasource.h"
25 #include "wxgis/catalog/gxobject.h"
26 
33 class WXDLLIMPEXP_GIS_CLT wxGxObjectFilter : public wxObject
34 {
35  DECLARE_CLASS(wxGxObjectFilter)
36 public:
37  wxGxObjectFilter(void);
38  virtual ~wxGxObjectFilter(void);
39  virtual bool CanChooseObject( wxGxObject* const pObject );
40  virtual bool CanDisplayObject( wxGxObject* const pObject );
41  virtual bool CanStoreToObject( wxGxObject* const pObject );
42  virtual wxGISEnumSaveObjectResults CanSaveObject( wxGxObject* const pLocation, const wxString &sName );
43  virtual wxString GetName(void) const;
44  virtual wxString GetExt(void) const;
45  virtual wxString GetDriver(void) const;
46  virtual int GetSubType(void) const;
47  virtual wxGISEnumDatasetType GetType(void) const;
48 };
49 
50 WX_DEFINE_USER_EXPORTED_ARRAY(wxGxObjectFilter*, wxGxObjectFiltersArray, class WXDLLIMPEXP_GIS_CLT);
51 
59 class WXDLLIMPEXP_GIS_CLT wxGxPrjFileFilter : public wxGxObjectFilter
60 {
61  DECLARE_CLASS(wxGxPrjFileFilter)
62 public:
63  wxGxPrjFileFilter(void);
64  virtual ~wxGxPrjFileFilter(void);
65  virtual bool CanChooseObject( wxGxObject* const pObject );
66  virtual bool CanDisplayObject( wxGxObject* const pObject );
67  virtual wxString GetName(void) const;
68  virtual wxString GetExt(void) const;
69 };
70 
71 
79 class WXDLLIMPEXP_GIS_CLT wxGxRemoteDBSchemaFilter : public wxGxObjectFilter
80 {
81  DECLARE_CLASS(wxGxRemoteDBSchemaFilter)
82 public:
84  virtual ~wxGxRemoteDBSchemaFilter(void);
85  virtual bool CanChooseObject(wxGxObject* const pObject);
86  virtual bool CanDisplayObject(wxGxObject* const pObject);
87  virtual bool CanStoreToObject(wxGxObject* const pObject);
88  virtual wxString GetName(void) const;
89 };
90 
98 class WXDLLIMPEXP_GIS_CLT wxGxDatasetFilter : public wxGxObjectFilter
99 {
100  DECLARE_CLASS(wxGxDatasetFilter)
101 public:
102  wxGxDatasetFilter(wxGISEnumDatasetType nType, int nSubType = wxNOT_FOUND);
103  virtual ~wxGxDatasetFilter(void);
104  virtual bool CanChooseObject( wxGxObject* const pObject );
105  virtual bool CanDisplayObject( wxGxObject* const pObject );
106  virtual bool CanStoreToObject(wxGxObject* const pObject);
107  virtual wxString GetName(void) const;
108  virtual wxGISEnumDatasetType GetType(void) const{return m_nType;};
109  virtual int GetSubType(void) const{return m_nSubType;};
110 protected:
111  wxGISEnumDatasetType m_nType;
112  int m_nSubType;
113 };
114 
122 class WXDLLIMPEXP_GIS_CLT wxGxFeatureDatasetFilter : public wxGxObjectFilter
123 {
124  DECLARE_CLASS(wxGxFeatureDatasetFilter)
125 public:
126  wxGxFeatureDatasetFilter(wxGISEnumVectorDatasetType nSubType);
127  virtual ~wxGxFeatureDatasetFilter(void);
128  virtual bool CanChooseObject( wxGxObject* const pObject );
129  virtual bool CanDisplayObject( wxGxObject* const pObject );
130  virtual bool CanStoreToObject(wxGxObject* const pObject);
131  virtual wxString GetName(void) const;
132  virtual wxString GetExt(void) const;
133  virtual wxString GetDriver(void) const;
134  virtual int GetSubType(void) const;
135  virtual wxGISEnumDatasetType GetType(void) const {return enumGISFeatureDataset;};
136 protected:
137  wxGISEnumVectorDatasetType m_nSubType;
138 };
139 
147 class WXDLLIMPEXP_GIS_CLT wxGxFolderFilter : public wxGxObjectFilter
148 {
149  DECLARE_CLASS(wxGxFolderFilter)
150 public:
151  wxGxFolderFilter(void);
152  virtual ~wxGxFolderFilter(void);
153  virtual bool CanChooseObject( wxGxObject* const pObject );
154  virtual bool CanDisplayObject( wxGxObject* const pObject );
155  virtual bool CanStoreToObject(wxGxObject* const pObject);
156  virtual wxString GetName(void) const;
157 };
158 
166 class WXDLLIMPEXP_GIS_CLT wxGxRasterDatasetFilter : public wxGxObjectFilter
167 {
168 public:
169  wxGxRasterDatasetFilter(wxGISEnumRasterDatasetType nSubType);
170  virtual ~wxGxRasterDatasetFilter(void);
171  virtual bool CanChooseObject(wxGxObject* const pObject);
172  virtual bool CanDisplayObject(wxGxObject* const pObject);
173  virtual bool CanStoreToObject(wxGxObject* const pObject);
174  virtual wxString GetName(void) const;
175  virtual wxString GetExt(void) const;
176  virtual wxString GetDriver(void) const;
177  virtual int GetSubType(void) const;
178  virtual wxGISEnumDatasetType GetType(void) const { return enumGISRasterDataset; };
179 protected:
180  wxGISEnumRasterDatasetType m_nSubType;
181 };
182 
183 
191 class WXDLLIMPEXP_GIS_CLT wxGxTextFilter : public wxGxObjectFilter
192 {
193  DECLARE_CLASS(wxGxTextFilter)
194 public:
195  wxGxTextFilter(const wxString &soName, const wxString &soExt);
196  virtual ~wxGxTextFilter(void);
197  virtual bool CanChooseObject( wxGxObject* const pObject );
198  virtual bool CanDisplayObject( wxGxObject* const pObject );
199  virtual bool CanStoreToObject(wxGxObject* const pObject);
200  virtual wxString GetName(void) const;
201  virtual wxString GetExt(void) const;
202 protected:
203  wxString m_soName;
204  wxString m_soExt, m_soExtCmp;
205 };
206 
207 
215 class WXDLLIMPEXP_GIS_CLT wxGxTableFilter : public wxGxObjectFilter
216 {
217  DECLARE_CLASS(wxGxTableFilter)
218 public:
219  wxGxTableFilter(wxGISEnumTableType nSubType);
220  virtual ~wxGxTableFilter(void);
221  virtual bool CanChooseObject( wxGxObject* const pObject );
222  virtual bool CanDisplayObject( wxGxObject* const pObject );
223  virtual bool CanStoreToObject(wxGxObject* const pObject);
224  virtual wxString GetName(void) const;
225  virtual wxString GetExt(void) const;
226  virtual wxString GetDriver(void) const;
227  virtual int GetSubType(void) const;
228  virtual wxGISEnumDatasetType GetType(void) const {return enumGISTable;};
229 protected:
230  wxGISEnumTableType m_nSubType;
231 };
232 
Definition: gxfilters.h:98
Definition: gxfilters.h:59
Definition: gxfilters.h:215
Definition: gxfilters.h:147
Definition: gxfilters.h:191
Definition: gxfilters.h:166
Definition: gxfilters.h:122
Definition: gxfilters.h:33
Definition: gxfilters.h:79
Definition: gxobject.h:37