gesturelabapplication.h

Go to the documentation of this file.
00001 // -*- c++ -*-  (for Emacs)
00002 
00003 // Gesture Lab - 7 Oct, 2005
00004 
00005 /*  -*- c++ -*-  (for Emacs)
00006  *
00007  *  gesturelabapplication.h
00008  *  Nodal
00009  *
00010  *  Imported into Nodal by Aidan Lane on Thu Feb 24 2005.
00011  *  Copyright (c) 2005 CEMA, Monash University. All rights reserved.
00012  *
00013  *  Original file:
00014  *
00015  *    gesturelabapplication.h
00016  *    EverGreen
00017  *
00018  *    Created by Aidan Lane on Mon Jul 19 2004.
00019  *    Copyright (c) 2004 Aidan Lane. All rights reserved.
00020  *
00021  *  This program is free software; you can redistribute it and/or modify
00022  *  it under the terms of the GNU General Public License as published by
00023  *  the Free Software Foundation; either version 2 of the License, or
00024  *  (at your option) any later version.
00025  *
00026  *  This program is distributed in the hope that it will be useful,
00027  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00028  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00029  *  GNU General Public License for more details.
00030  *
00031  *  You should have received a copy of the GNU General Public License
00032  *  along with this program; if not, write to the Free Software
00033  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00034  */
00035 
00036 #ifndef GESTURELABAPPLICATION_H
00037 #define GESTURELABAPPLICATION_H
00038 
00039 
00040 #include <QApplication>
00041 
00042 #include <QHash>
00043 #include <QPointer>
00044 #include <QSqlDatabase>
00045 
00046 #include <jni.h>
00047 
00048 #include "digest.h" // Digest namespace
00049 #include "gesturelabprefsdialog.h"
00050 
00051 class QActionGroup;
00052 class QAction;
00053 class QDialog;
00054 class QMenuBar;
00055 
00056 class ActionManager;
00057 class DigestDbModel;
00058 class DigestDbController;
00059 class SettingsModel;
00060 class SettingsController;
00061 // Components:
00062 class AbstractGuiDbComponent;
00063 class ExperimentBrowserComponent;
00064 class GestureBrowserComponent;
00065 class RecogniserBrowserComponent;
00066 class RecogniserTestPadComponent;
00067 class SqlBrowseComponent;
00068 
00069 
00076 class GestureLabApplication : public QApplication {
00077 
00078   Q_OBJECT
00079 
00080 public:
00081   GestureLabApplication( int& argc, char** argv );
00082   virtual ~GestureLabApplication();
00083 
00084   bool event( QEvent* );  
00085 
00086 
00087 public slots:
00088   bool reconnectDatabase();
00089 
00090   void closeActiveWindow();
00091 
00092   void showAppPrefs();
00093   void showAppHelp();
00094   void showAppAbout();
00095   void appQuit();  
00096 
00097 
00098 private slots:
00099   void onRequest( const QString& message );
00100 
00101 
00102 private:
00103   void init();
00104   void initJvm();
00105   void setupUi();
00106   void createMenuBar();
00107 
00108   JavaVM* m_jvm;
00109 
00110   QSqlDatabase  m_db;
00111   QString       m_dbConnectionName;
00112 
00113   DigestDbModel*       m_dbModel;
00114   DigestDbController*  m_dbController;
00115 
00116   SettingsModel*       m_settingsModel;
00117   SettingsController*  m_settingsController;
00118 
00119   ActionManager* m_actionManager;
00120 
00121   // The following are used to point to modal-less, single instance dialogs
00122   // that will remain allocated until closed by user.
00123   QPointer<ExperimentBrowserComponent>  m_experimentBrowserCom;
00124   QPointer<GestureBrowserComponent>     m_gestureBrowserCom;
00125   QPointer<RecogniserBrowserComponent>  m_recogniserBrowserCom;
00126   QPointer<RecogniserTestPadComponent>  m_recogniserTestPadCom;
00127   QPointer<SqlBrowseComponent>          m_sqlBrowserCom;
00128   QPointer<GestureLabPrefsDialog>       m_prefsDlg;
00129   QPointer<QDialog>                     m_aboutBoxDlg;
00130 
00131   QList<AbstractGuiDbComponent*> m_components;
00132 
00133   QMenuBar* m_globalMenuBar; // application-wide / global menu bar
00134 
00135   QMenu* m_fileMenu;
00136   QMenu* m_editMenu;
00137   QMenu* m_windowMenu;
00138   QMenu* m_helpMenu;
00139 
00140   QString m_prevPath;
00141 };
00142 
00143 
00144 #endif // ! GESTURELABAPPLICATION_H

Generated on Mon Jul 30 09:46:50 2007 for Digest by  doxygen 1.5.2