rasdaman complete source
rviewQuery.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_QUERY_H_
42 #define _RVIEW_QUERY_H_
43 
44 
45 #ifdef __GNUG__
46 #pragma interface
47 #endif
48 
49 
50 
51 #include "rviewUtils.hh"
52 #include "rviewDb.hh"
53 
54 
55 
56 
57 
58 class rviewQuery: public rviewFrame
59 {
60 public:
61 
62  rviewQuery(rviewDatabase *db, char *query=NULL);
63  ~rviewQuery(void);
64 
65  void OnSize(int w, int h);
66  void OnMenuCommand(int id);
67 
68  void label(void);
69  int process(wxObject &obj, wxEvent &evt);
70 
71  int userEvent(const user_event &ue);
72 
73  virtual const char *getFrameName(void) const;
74  virtual rviewFrameType getFrameType(void) const;
75 
76  // Returns the query window ID
77  int getIdentifier(void) const;
78  int getQueryCounter(void) const;
79 
80 
81 protected:
82 
83  void buildMenubar(void);
84  bool loadQuery(char *file);
85  bool saveQuery(char *file);
86  void newDBState(bool newState);
87  void updateTitle(void);
88 
89  wxTextWindow *twin;
90  wxMenuBar *mbar;
91  wxMenu *mbarMenus[3];
92  wxPanel *panel;
93  rviewButton *butClear, *butExec, *butUpdt;
94  wxFont *font;
95  int hotNumber;
96  DynamicString hotPath;
97  DynamicString lastHotPath;
98  rviewDatabase *queryDb;
99  // For update queries
100  rviewDisplay *updateDisplay;
101  r_Ref<r_GMarray> updateMddObj;
102  int qwindowID;
103  int updateID;
104 
105  static const char query_extension[];
106  static const char query_firstline[];
107 
108  static const keyword_to_ident_c fontNameTab[];
109  static const keyword_to_ident_c fontStyleTab[];
110  static const keyword_to_ident_c fontWeightTab[];
111 
112  // constants
113  // Width and height of query window
114  static const int query_width;
115  static const int query_height;
116  // Borders in query window
117  static const int query_border;
118  // Height of control area at the bottom of the query
119  static const int query_bottom;
120  // Button dimensions
121  static const int query_bwidth;
122  static const int query_bheight;
123 
124 
125 private:
126 
127  // Query window counter, realises a unique integer ID for each
128  // query window.
129  static int queryCounter;
130 };
131 
132 #endif