Version: 0.6.0
gxshellconnui.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 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 
32 /*
33 class WXDLLIMPEXP_GIS_CLU wxGxRemoteConnectionUI :
34  public wxGxRemoteConnection,
35  public IGxObjectUI,
36  public IGxObjectEditUI,
37  public IGxObjectWizard,
38  public wxGxAutoRenamer
39 {
40  DECLARE_CLASS(wxGxRemoteConnectionUI)
41 public:
42  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);
43  virtual ~wxGxRemoteConnectionUI(void);
44  //IGxObjectUI
45  virtual wxIcon GetLargeImage(void);
46  virtual wxIcon GetSmallImage(void);
47  virtual wxString ContextMenu(void) const {return wxString(wxT("wxGxRemoteConnection.ContextMenu"));};
48  virtual wxString NewMenu(void) const {return wxString(wxT("wxGxRemoteConnection.NewMenu"));};
49  //IGxRemoteConnection
50  virtual bool Connect(void);
51  //IGxObjectEditUI
52  virtual void EditProperties(wxWindow *parent);
53  //IGxObjectWizard
54  virtual bool Invoke(wxWindow* pParentWnd);
55 protected:
56  //wxGxRemoteConnection
57  virtual wxGxRemoteDBSchema* GetNewRemoteDBSchema(const wxString &sName, const CPLString &soPath, wxGISPostgresDataSource *pwxGISRemoteConn);
58  virtual wxThread::ExitCode Entry();
59  //events
60  virtual void OnThreadFinished(wxThreadEvent& event);
61 protected:
62  wxIcon m_oLargeIconConn, m_oSmallIconConn;
63  wxIcon m_oLargeIconDisconn, m_oSmallIconDisconn;
64  wxIcon m_oLargeIconFeatureClass, m_oSmallIconFeatureClass;
65  wxIcon m_oLargeIconTable, m_oSmallIconTable;
66  wxIcon m_oLargeIconSchema, m_oSmallIconSchema;
67  long m_PendingId;
68 };
69 
73 /*
74 class WXDLLIMPEXP_GIS_CLU wxGxRemoteDBSchemaUI :
75  public wxGxRemoteDBSchema,
76  public IGxObjectUI,
77  public IGxObjectEditUI,
78  public IGxDropTarget
79 {
80  DECLARE_CLASS(wxGxRemoteDBSchemaUI)
81  enum
82  {
83  EXIT_EVENT = wxID_HIGHEST+1
84  };
85 public:
86  wxGxRemoteDBSchemaUI(bool bHasGeom, bool bHasGeog, bool bHasRaster, 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);
87  virtual ~wxGxRemoteDBSchemaUI(void);
88  //wxGxObjectContainer
89  virtual bool HasChildren(void);
90  //IGxObjectUI
91  virtual wxIcon GetLargeImage(void);
92  virtual wxIcon GetSmallImage(void);
93  virtual wxString ContextMenu(void) const {return wxString(wxT("wxGxRemoteDBSchema.ContextMenu"));};
94  virtual wxString NewMenu(void) const {return wxString(wxT("wxGxRemoteDBSchema.NewMenu"));};
95  //IGxObjectEditUI
96  virtual void EditProperties(wxWindow *parent);
97  //IGxDropTarget
98  virtual wxDragResult CanDrop(wxDragResult def);
99  virtual bool Drop(const wxArrayString& saGxObjectPaths, bool bMove);
100  //events
101  void OnThreadFinished(wxThreadEvent& event);
102 protected:
103  //wxGxRemoteDBSchema
104  virtual wxGxObject* AddTable(const wxString &sTableName, const wxGISEnumDatasetType eType);
105  virtual wxThread::ExitCode Entry();
106  virtual bool CreateAndRunThread(void);
107 protected:
108  wxIcon m_oLargeIcon, m_oSmallIcon;
109  wxIcon m_oLargeIconFeatureClass, m_oSmallIconFeatureClass;
110  wxIcon m_oLargeIconTable, m_oSmallIconTable;
111  long m_PendingId;
112 };
113 
114 #endif // wxGIS_USE_POSTGRES
115 
119 /*
120 class WXDLLIMPEXP_GIS_CLU wxGxTMSWebServiceUI :
121  public wxGxTMSWebService,
122  public IGxObjectUI,
123  public IGxObjectEditUI
124 {
125  DECLARE_CLASS(wxGxTMSWebServiceUI)
126 public:
127  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);
128  virtual ~wxGxTMSWebServiceUI(void);
129  //IGxObjectUI
130  virtual wxIcon GetLargeImage(void);
131  virtual wxIcon GetSmallImage(void);
132  virtual wxString ContextMenu(void) const {return wxString(wxT("wxGxTMSWebService.ContextMenu"));};
133  virtual wxString NewMenu(void) const {return wxEmptyString;};
134  //IGxObjectEditUI
135  virtual void EditProperties(wxWindow *parent);
136 protected:
137  wxIcon m_icLargeIcon, m_icSmallIcon;
138  wxIcon m_icLargeIconDsbl, m_icSmallIconDsbl;
139 };
140 */