rasdaman complete source
rviewApp.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_APP_H_
42 #define _RVIEW_APP_H_
43 
44 #ifdef __GNUG__
45 #pragma interface
46 #endif
47 
48 // RasDaMan includes
49 #include "rasodmg/ref.hh"
50 #include "rasodmg/marray.hh"
51 
52 #include "rviewUtils.hh"
53 #include "rviewDb.hh"
54 #include "rviewDModes.hh"
55 
56 /*
57  * A generic RasDaMan client app using wxWindows.
58  */
59 class rmanClientApp : public wxApp
60 {
61 public:
62 
63  rmanClientApp(const char *homevar, const char *prefsname, const char *labelname);
64  virtual ~rmanClientApp(void);
65 
66  int OpenServer(const char *srvname, int srvport, const char *dbname,
67  const char *usrname, const char *usrpassword);
68  int CloseServer(void);
69  bool ReadDBState(void);
70  int LookupCollection(void);
71  int LookupScaledCollection(void);
72  int LookupScaledCollection(const char *name, double scale);
73  int LookupOrthosection(void);
74  int LookupOrthosection(const char *name, const double *loid);
75  int CreateCollection(void);
76  int DeleteCollection(void);
77  rviewFrame *OpenFile(unsigned int flags=0, r_Ref<r_GMarray> *newMddObj=NULL, bool resultwin=FALSE);
78  virtual void Shutdown(void);
79  int insertMDD(r_Ref<r_GMarray> srcMdd, char *collName=NULL, r_Minterval *domain=NULL);
80  int executeQuery(char *query, r_Ref<r_GMarray> *updateMdd=NULL);
81  collection_desc *executeQuerySync(char *query, r_Ref<r_GMarray> *updateMdd=NULL, bool showProgress=TRUE);
82  int getMinterval(r_Minterval &dom, const char *collname, const double *loid=NULL);
83 
84  int SavePreferences(void) const;
85  bool findPreferencesOnPath(char *path);
86 
87  // use this call to contact the application instance
88  static rmanClientApp *theApp(void);
89 
90 protected:
91 
92  rviewDatabase database;
93  char prefsFile[STRINGSIZE];
94  char prefsSaveFile[STRINGSIZE];
95  char prefsFileLeafname[STRINGSIZE];
96  char homeDir[STRINGSIZE];
97 
98 private:
99 
100  static rmanClientApp *theclientapp;
101  static const char *vffFileName;
102 };
103 
104 #endif
#define FALSE
Definition: defs.h:70
#define TRUE
Definition: defs.h:67