actionmanager.h

Go to the documentation of this file.
00001 // -*- c++ -*-  (for Emacs)
00002 
00003 // BASED ON: qdesigner_actions.h in qt-mac-opensource-4.0.0-b2-snapshot-20050318, located in the /tools/designer/src/designer/ sub-dir of Qt.
00004 //           Imported on Wed Mar 30 2005 by Aidan Lane.
00005 //           Modifications Copyright (c) CEMA, Monash University. All rights reserved.
00006 /****************************************************************************
00007  **
00008  ** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
00009  **
00010  ** This file is part of the designer application of the Qt Toolkit.
00011  **
00012  ** This file may be distributed and/or modified under the terms of the
00013  ** GNU General Public License version 2 as published by the Free Software
00014  ** Foundation and appearing in the file LICENSE.GPL included in the
00015  ** packaging of this file.
00016  **
00017  ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00018  **   information about Qt Commercial License Agreements.
00019  ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00020  **
00021  ** Contact info@trolltech.com if any conditions of this licensing are
00022  ** not clear to you.
00023  **
00024  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00025  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00026  **
00027  ****************************************************************************/
00028 
00029 
00030 #ifndef ACTIONMANAGER_H
00031 #define ACTIONMANAGER_H
00032 
00033 #include <QObject>
00034 #include <QPointer>
00035 
00036 
00037 class QAction;
00038 class QActionGroup;
00039 class QSignalMapper;
00040 
00041 class GestureLabApplication;
00042 
00043 
00055 class ActionManager: public QObject {
00056 
00057   Q_OBJECT
00058  
00059 public:
00060   ActionManager( GestureLabApplication* diagramManager );
00061   virtual ~ActionManager();
00062 
00063   static ActionManager* instance();
00064 
00065   GestureLabApplication* diagramManager() const;
00066 
00067   QActionGroup* fileActions()   const { return m_fileActions; }
00068   QActionGroup* editActions()   const { return m_editActions; }
00069   QActionGroup* windowActions() const { return m_windowActions; }
00070   QActionGroup* helpActions()   const { return m_helpActions; }
00071 
00072   /*
00073    * File actions
00074    */
00075   QAction* newRecogniserAction() const { return m_newRecogniserAction; }
00076   QAction* newExperimentAction() const { return m_newExperimentAction; }
00077   QAction* closeWindowAction()   const { return m_closeWindowAction; }
00078   QAction* appQuitAction()       const { return m_appQuitAction; }
00079 
00080   /*
00081    * Edit actions
00082    */
00083   QAction* undoAction()      const { return m_undoAction; }
00084   QAction* redoAction()      const { return m_redoAction; }
00085   QAction* cutAction()       const { return m_cutAction; }
00086   QAction* copyAction()      const { return m_copyAction; }
00087   QAction* pasteAction()     const { return m_pasteAction; }
00088   QAction* deleteAction()    const { return m_deleteAction; }
00089   QAction* selectAllAction() const { return m_selectAllAction; }
00090   QAction* appPrefsAction()  const { return m_appPrefsAction; }
00091 
00092   /*
00093    * Window actions
00094    */
00095   QAction* minimizeWindowAction()         const { return m_minimizeWindowAction; }
00096   QAction* zoomWindowAction()             const { return m_zoomWindowAction; }
00097   QAction* showGestureBrowserAction()     const { return m_showGestureBrowserAction; }
00098   QAction* showRecogniserTestPadAction()  const { return m_showRecogniserTestPadAction; }
00099   QAction* showRecogniserBrowserAction()  const { return m_showRecogniserBrowserAction; }
00100   QAction* showExperimentBrowserAction()  const { return m_showExperimentBrowserAction; }
00101   QAction* showSqlBrowserAction()         const { return m_showSqlBrowserAction; }
00102   QAction* bringAllToFrontAction()        const { return m_bringAllToFrontAction; }
00103 
00104   /*
00105    * Help actions
00106    */
00107   QAction* appHelpAction()  const { return m_appHelpAction; }
00108   QAction* appAboutAction() const { return m_appAboutAction; }
00109 
00110 
00111 signals:
00112   void request( const QString& message );
00113 
00114 
00115 protected slots:
00116   void minimizeWindow();
00117   void zoomWindow();
00118   void bringAllToFront();
00119 
00120   void showAppHelp();
00121 
00122 
00123 private:
00124   void fixActionContext();
00125 
00126   QPointer<GestureLabApplication> m_diagramManager;
00127 
00128   QSignalMapper* m_signalMapper;
00129 
00130   QActionGroup* m_fileActions;
00131   QActionGroup* m_editActions;
00132   QActionGroup* m_windowActions;
00133   QActionGroup* m_helpActions;
00134 
00135   QAction* m_newRecogniserAction;
00136   QAction* m_newExperimentAction;
00137   QAction* m_closeWindowAction;
00138   QAction* m_appQuitAction;
00139 
00140   QAction* m_undoAction;
00141   QAction* m_redoAction;
00142   QAction* m_cutAction;
00143   QAction* m_copyAction;
00144   QAction* m_pasteAction;
00145   QAction* m_deleteAction;
00146   QAction* m_selectAllAction;
00147   QAction* m_appPrefsAction;
00148 
00149   QAction* m_minimizeWindowAction;
00150   QAction* m_zoomWindowAction;
00151   QAction* m_showGestureBrowserAction;
00152   QAction* m_showRecogniserTestPadAction;
00153   QAction* m_showRecogniserBrowserAction;
00154   QAction* m_showExperimentBrowserAction;
00155   QAction* m_showSqlBrowserAction;
00156   QAction* m_bringAllToFrontAction;
00157 
00158   QAction* m_appHelpAction;
00159   QAction* m_appAboutAction;
00160 };
00161 
00162 
00163 #endif // ACTIONMANAGER_H

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