Version: 0.6.0
gxremoteconnui.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: Remote Connection UI classes.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2011,2013,2014 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 #pragma once
22 
23 #include "wxgis/catalogui/catalogui.h"
24 #include "wxgis/catalog/gxremoteconn.h"
25 #include "wxgis/catalogui/gxview.h"
26 
27 #ifdef wxGIS_USE_POSTGRES
28 
36 class WXDLLIMPEXP_GIS_CLU wxGxRemoteConnectionUI :
37  public wxGxRemoteConnection,
38  public IGxObjectUI,
39  public IGxObjectEditUI,
40  public IGxObjectWizard,
41  public IGxDropTarget,
42  public wxGxAutoRenamer
43 {
44  DECLARE_CLASS(wxGxRemoteConnectionUI)
45  enum
46  {
47  EXIT_EVENT = wxID_HIGHEST + 1,
48  LOADED_EVENT
49  };
50 public:
51  wxGxRemoteConnectionUI(wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "", const wxIcon &LargeIconConn = wxNullIcon, const wxIcon &SmallIconConn = wxNullIcon, const wxIcon &LargeIconDisconn = wxNullIcon, const wxIcon &SmallIconDisconn = wxNullIcon);
52  virtual ~wxGxRemoteConnectionUI(void);
53  //IGxObjectUI
54  virtual wxIcon GetLargeImage(void);
55  virtual wxIcon GetSmallImage(void);
56  virtual wxString ContextMenu(void) const {return wxString(wxT("wxGxRemoteConnection.ContextMenu"));};
57  virtual wxString NewMenu(void) const {return wxString(wxT("wxGxRemoteConnection.NewMenu"));};
58  //IGxRemoteConnection
59  virtual bool Connect(void);
60  //IGxObjectEditUI
61  virtual void EditProperties(wxWindow *parent);
62  //IGxObjectWizard
63  virtual bool Invoke(wxWindow* pParentWnd);
64  //IGxDropTarget
65  virtual bool Drop(const wxArrayString& saGxObjectPaths, bool bMove);
66 protected:
67  //wxGxRemoteConnection
68  virtual wxGxRemoteDBSchema* GetNewRemoteDBSchema(int nRemoteId, const wxString &sName, const CPLString &soPath, wxGISPostgresDataSource *pwxGISRemoteConn);
69  virtual wxThread::ExitCode Entry();
70  //events
71  virtual void OnThreadFinished(wxThreadEvent& event);
72 protected:
73  wxIcon m_oLargeIconConn, m_oSmallIconConn;
74  wxIcon m_oLargeIconDisconn, m_oSmallIconDisconn;
75  wxIcon m_oLargeIconFeatureClass, m_oSmallIconFeatureClass;
76  wxIcon m_oLargeIconTable, m_oSmallIconTable;
77  wxIcon m_oLargeIconSchema, m_oSmallIconSchema;
78  long m_PendingId;
79 private:
80  DECLARE_EVENT_TABLE()
81 };
82 
90 class WXDLLIMPEXP_GIS_CLU wxGxRemoteDBSchemaUI :
91  public wxGxRemoteDBSchema,
92  public IGxObjectUI,
93  public IGxObjectEditUI,
94  public IGxDropTarget
95 {
96  DECLARE_CLASS(wxGxRemoteDBSchemaUI)
97  enum
98  {
99  EXIT_EVENT = wxID_HIGHEST + 1,
100  LOADED_EVENT
101  };
102 public:
103  wxGxRemoteDBSchemaUI(int nRemoteId, wxGISPostgresDataSource* pwxGISRemoteConn, wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "", const wxIcon &LargeIcon = wxNullIcon, const wxIcon &SmallIcon = wxNullIcon, const wxIcon &LargeIconFeatureClass = wxNullIcon, const wxIcon &SmallIconFeatureClass = wxNullIcon, const wxIcon &LargeIconTable = wxNullIcon, const wxIcon &SmallIconTable = wxNullIcon);
104  virtual ~wxGxRemoteDBSchemaUI(void);
105  //wxGxObjectContainer
106  virtual bool HasChildren(void);
107  //IGxObjectEdit
108  virtual bool Delete(void);
109  //IGxObjectUI
110  virtual wxIcon GetLargeImage(void);
111  virtual wxIcon GetSmallImage(void);
112  virtual wxString ContextMenu(void) const {return wxString(wxT("wxGxRemoteDBSchema.ContextMenu"));};
113  virtual wxString NewMenu(void) const {return wxString(wxT("wxGxRemoteDBSchema.NewMenu"));};
114  //IGxObjectEditUI
115  virtual void EditProperties(wxWindow *parent);
116  //IGxDropTarget
117  virtual bool Drop(const wxArrayString& saGxObjectPaths, bool bMove);
118  //events
119  void OnThreadFinished(wxThreadEvent& event);
120 protected:
121  //wxGxRemoteDBSchema
122  virtual wxGxObject* GetNewTable(int nRemoteId, const wxString &sTableName, const wxGISEnumDatasetType eType);
123  virtual wxThread::ExitCode Entry();
124  virtual bool CreateAndRunThread(void);
125 protected:
126  wxIcon m_oLargeIcon, m_oSmallIcon;
127  wxIcon m_oLargeIconFeatureClass, m_oSmallIconFeatureClass;
128  wxIcon m_oLargeIconTable, m_oSmallIconTable;
129  long m_PendingId;
130 private:
131  DECLARE_EVENT_TABLE()
132 };
133 
134 #endif // wxGIS_USE_POSTGRES
135 
143 class WXDLLIMPEXP_GIS_CLU wxGxTMSWebServiceUI :
144  public wxGxTMSWebService,
145  public IGxObjectUI,
146  public IGxObjectEditUI
147 {
148  DECLARE_CLASS(wxGxTMSWebServiceUI)
149 public:
150  wxGxTMSWebServiceUI(wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "", const wxIcon &icLargeIcon = wxNullIcon, const wxIcon &icSmallIcon = wxNullIcon, const wxIcon &icLargeIconDsbl = wxNullIcon, const wxIcon &icSmallIconDsbl = wxNullIcon);
151  virtual ~wxGxTMSWebServiceUI(void);
152  //IGxObjectUI
153  virtual wxIcon GetLargeImage(void);
154  virtual wxIcon GetSmallImage(void);
155  virtual wxString ContextMenu(void) const {return wxString(wxT("wxGxTMSWebService.ContextMenu"));};
156  virtual wxString NewMenu(void) const {return wxEmptyString;};
157  //IGxObjectEditUI
158  virtual void EditProperties(wxWindow *parent);
159 protected:
160  wxIcon m_icLargeIcon, m_icSmallIcon;
161  wxIcon m_icLargeIconDsbl, m_icSmallIconDsbl;
162 };
Definition: gxremoteconn.h:145
Definition: gxremoteconnui.h:143
Definition: catalogui.h:73
Definition: catalogui.h:60
Definition: catalogui.h:90
Definition: catalogui.h:128
Definition: gxobject.h:37
Definition: gxview.h:65