rasdaman complete source
rview.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 /
23 
41 #ifndef _RVIEW_H_
42 #define _RVIEW_H_
43 
44 
45 #ifdef __GNUG__
46 #pragma interface
47 #endif
48 
49 
50 
51 
52 
53 // RasDaMan includes
54 #include "rasodmg/ref.hh"
55 #include "rasodmg/marray.hh"
56 
57 
58 #include "rviewApp.hh"
59 #include "rviewUtils.hh"
60 #include "rviewPrefs.hh"
61 
62 
63 
64 /*
65  * rView's main frame
66  */
67 class rviewMainFrame: public rviewFrame
68 {
69 public:
70 
71  rviewMainFrame(wxFrame *frame, char *title, int x, int y, int w, int h);
72  ~rviewMainFrame(void);
73  void OnMenuCommand(int id);
74  void OnSize(int w, int h);
75  void SetDatabaseInfo(const char *srvName, int srvPort,
76  const char *dbName, const char*usrName);
77  void GetDatabaseInfo(DynamicString &srvName, int& srvPort, DynamicString &dbName,
78  DynamicString &usrName, DynamicString &usrPassword) const;
79  void newDBState(bool newState);
80  bool OnClose();
81 
82  // Implementations of the rviewFrame virtual functions
83  void label(void);
84  int process(wxObject &obj, wxEvent &evt);
85 
86  int userEvent(const user_event &ue);
87 
88  virtual const char *getFrameName(void) const;
89  virtual rviewFrameType getFrameType(void) const;
90 
91  // constants
92  // Width and height of main window
93  static const int main_width;
94  static const int main_height;
95  // Border around panel in main frame
96  static const int main_border;
97  // Height of server / database text widgets
98  static const int main_theight;
99  // Dimensions of button(s)
100  static const int main_bwidth;
101  static const int main_bheight;
102 
103 
104 protected:
105 
106  rviewText *server;
107  rviewText *port;
108  rviewText *database;
109  rviewText *username;
110  rviewText *userpassword;
111  rviewButton *openBut;
112  wxPanel *panel;
113  wxMenuBar *mBar;
114  bool dbOpen;
115  rviewAbout *aboutWindow;
116 };
117 
118 
119 
120 /*
121  * rView application specifics
122  */
123 class rView: public rmanClientApp
124 {
125 public:
126 
127  rView(void);
128  virtual ~rView(void);
129  wxFrame *OnInit(void);
130  void OpenCloseServer(void);
131  void OpenQueryWindow(void);
132 
133 
134 private:
135 
136  rviewMainFrame *mainFrame;
137 
138  static const char labels_filename[];
139  static const char prefs_filename[];
140  static const double version;
141 };
142 
143 #endif