mainwindow.h

Go to the documentation of this file.
00001 /* Copyright (C) 2006 P.L. Lucas
00002  *
00003  * This program is free software; you can redistribute it and/or modify
00004  * it under the terms of the GNU General Public License as published by
00005  * the Free Software Foundation; either version 2 of the License, or
00006  * (at your option) any later version.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  * GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program; if not, write to the Free Software
00015  * Foundation, Inc., 59 Temple Place, Suite 330, 
00016  * Boston, MA 02111-1307, USA. 
00017  */
00018 
00019 #ifndef MAINWINDOW_H
00020 #define MAINWINDOW_H
00021 
00022 #include <QtCore/QVariant>
00023 #include <QtGui/QAction>
00024 #include <QtGui/QApplication>
00025 #include <QtGui/QButtonGroup>
00026 #include <QtGui/QMainWindow>
00027 #include <QtGui/QMenu>
00028 #include <QtGui/QMenuBar>
00029 #include <QtGui/QStatusBar>
00030 #include <QtGui/QToolBar>
00031 #include <QtGui/QWidget>
00032 #include <QWorkspace>
00033 #include <QMap>
00034 #include "config.h"
00035 #include "octave_connection.h"
00036 
00037 /**Represents and creates main window. This class is only for creates main window interface, menus and menus actions. Menus callbacks are implemented in Operations class.<br>
00038  * Menus and actions can be added to this class or using createAction and createMenu methods.
00039  * @see GenerateMenu for user menus.
00040  * @see Operations class for actions callbacks.
00041  * @see createAction, createMenu
00042  */
00043 class MainWindow:public QMainWindow
00044 {
00045         public:
00046         //General actions
00047         QAction *actionOpen;
00048         QAction *actionOctave_help;
00049         QAction *actionTable;
00050         QAction *actionEditor;
00051         QAction *actionCompletionMatches;
00052         QAction *actionDynamicHelp;
00053         QAction *actionStopProcess;
00054         QAction *actionClearTerminal;
00055         //Matrix actions
00056         QAction *actionInverse;
00057         QAction *actionDeterminant;
00058         QAction *actionEigenvalues;
00059         QAction *actionTranspose;
00060         QAction *actionSubmatrix;
00061         //Statistics actions
00062         QAction *actionMean;
00063         QAction *actionMedian;
00064         QAction *actionStd;
00065         QAction *actionCov;
00066         QAction *actionCorrcoef;
00067         //Plot actions
00068         QAction *actionPlot;
00069         QAction *actionPolar;
00070         QAction *actionSemilogy;
00071         QAction *actionSemilogx;
00072         QAction *actionLogLog;
00073         QAction *actionAxis;
00074         QAction *actionTitleLabel;
00075         QMenu *menu2DPlot;
00076         QMenu *menuExport;
00077         QAction *actionToEPS;
00078         QAction *actionToPDF;
00079         QAction *actionToPNG;
00080         //Config actions
00081         QAction *actionGeneralConfig;
00082         /**Main window work space.*/
00083         QWorkspace *work_space;
00084         /**Main window menu bar.*/
00085         QMenuBar *menubar;
00086         QMenu *menuFile;
00087         //QMenu *menuEdit;
00088         QMenu *menuData;
00089         QMenu *menuMatrix;
00090         QMenu *menuStatistics;
00091         QMenu *menuPlot;
00092         QMenu *menuConfig;
00093         QMenu *menuHelp;
00094         /**Main window status bar.*/
00095         QStatusBar *statusbar;
00096         /**Main window tool bar.*/
00097         QToolBar *toolBar;
00098         
00099         /**Creates new MainWindow.
00100          * @param oc OctaveConnection creates in terminal.
00101          * @param parent parent widget.
00102          */
00103         MainWindow(OctaveConnection *oc, QWidget *parent=0);
00104         /**Clears all menus.
00105          */
00106         void clear_menu();
00107         
00108         /**Show base menu.*/
00109         void show_menu_base();
00110         
00111         /**Show config and help menus*/
00112         void show_config_help_menus();
00113         
00114         /**This a QMap of menu actions. You can create menu actions using createAction method.
00115          * @see createAction.
00116          */
00117         QMap<QString, QAction *> actions;
00118         
00119         /**Creates new action. Actions are added to actions variable.
00120          * @param action_name Name of action. Only for internal use.
00121          * @param name Label of action in menues.
00122          * @param icon Icon path of action in menues.
00123          * @return New action.
00124          * @see actions.
00125          */
00126         QAction *createAction(QString action_name, const char *name, QString icon=QString());
00127         QAction *createAction(QString action_name, QString name, QString icon=QString());
00128         /**This a QMap of menus. You can create menu using createMenu method.
00129          * @see createMenu.
00130          */
00131         QMap<QString, QMenu *> menus;
00132         /**Creates new menu. Menus are added to menus variable.
00133          * @param action_name Name of menu. Only for internal use.
00134          * @param name Label of menu.
00135          * @param icon Icon path of menu.
00136          * @return New menu.
00137          * @see menus.
00138          */
00139         QMenu *createMenu(QString menu_name, const char *name, QString icon=QString());
00140         QMenu *createMenu(QString menu_name, QString name, QString icon=QString());
00141         /**Connection to Octave terminal. Useful for send commands to Octave and see results in terminal.
00142          */
00143         OctaveConnection *octave_connection;
00144 };
00145 
00146 #endif

Generated on Wed Mar 21 10:32:50 2007 for QtOctave by  doxygen 1.4.7