Version: 0.6.0
gxdiscconnections.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: wxGxDiscConnections class.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2010-2013 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/catalog/gxcatalog.h"
25 #include "wxgis/catalog/gxobject.h"
26 #include "wxgis/catalog/gxmlconnstor.h"
27 
28 #define CONNCONF wxT("conn.json")
29 
37 class WXDLLIMPEXP_GIS_CLT wxGxDiscConnections :
40  public IGxObjectNoFilter
41 {
42  DECLARE_DYNAMIC_CLASS(wxGxDiscConnections)
43 public:
44  wxGxDiscConnections(void);
45  virtual ~wxGxDiscConnections(void);
46  //wxGxObject
47  virtual bool Create(wxGxObject *oParent = NULL, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
48  virtual bool Destroy(void);
49  virtual wxString GetBaseName(void) const {return GetName();};
50  virtual wxString GetFullName(void) const {return wxEmptyString;};
51  virtual wxString GetCategory(void) const {return wxString(_("Folder connections"));};
52  virtual void Refresh(void);
53  //wxGxObjectContainer
54  virtual bool AreChildrenViewable(void) const {return true;};
55  //IGxRootObjectProperties
56  virtual void Init(wxXmlNode* const pConfigNode);
57  virtual void Serialize(wxXmlNode* const pConfigNode);
58  virtual bool ConnectFolder(const wxString &sPath);
59  virtual bool DisconnectFolder(int nStoreId);
60 protected:
61  //wxGxXMLConnectionStorage
62  virtual bool IsObjectExist(wxGxObject* const pObj, const wxJSONValue& GxObjConfValue);
63  virtual void CreateConnectionsStorage(void);
64  virtual wxGxObject* CreateChildGxObject(const wxJSONValue& GxObjConfValue);
65  virtual int GetStorageVersion(void) const {return 2;};
66 protected:
67  wxString m_sUserConfigDir;
68  wxGxCatalog* m_pCatalog;
69  long m_ConnectionPointCatalogCookie;
70 private:
71  DECLARE_EVENT_TABLE()
72 };
The JSON value class implementation.
Definition: jsonval.h:91
Definition: gxcatalog.h:42
Definition: catalog.h:72
Definition: gxdiscconnections.h:37
Definition: gxmlconnstor.h:67
Definition: catalog.h:123
Definition: gxobject.h:37