src/MainMenubar.h

Go to the documentation of this file.
00001 /*
00002  *  Qtstalker stock charter
00003  * 
00004  *  Copyright (C) 2001-2007 Stefan S. Stratigakos
00005  * 
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
00019  *  USA.
00020  */
00021 
00022 #ifndef MAINMENUBAR_HPP
00023 #define MAINMENUBAR_HPP
00024 
00025 #include <qstring.h>
00026 #include <qmenubar.h>
00027 #include <qmainwindow.h>
00028 #include <qpopupmenu.h>
00029 #include <qintdict.h>
00030 #include <qaction.h>
00031 
00032 class MainMenubar : public QMenuBar
00033 {
00034   Q_OBJECT
00035   
00036   signals:
00037     void signalExit ();
00038     void signalGrid (bool);
00039     void signalScale (bool);
00040     void signalDraw (bool);
00041     void signalCrosshairs (bool);
00042     void signalSidePanel (bool);
00043     void signalNewIndicator();
00044     void signalOptions();
00045     void signalQuotes();
00046     void signalPaperTrade (bool);
00047     void signalAdvancePaperTrade ();
00048     
00049   public:
00050   
00051     enum MenuAction
00052     {
00053       Exit,
00054       NewIndicator,
00055       Options,
00056       Grid,
00057       Quotes,
00058       DataWindow,
00059       About,
00060       ScaleToScreen,
00061       SidePanel,
00062       DrawMode,
00063       Crosshairs,
00064       Help,
00065       PaperTrade,
00066       AdvancePaperTrade,
00067       IndicatorSummary
00068     };
00069   
00070     MainMenubar(QMainWindow *);
00071     ~MainMenubar();
00072     void createMenus ();
00073     QAction * getAction (int);
00074     bool getStatus (int);
00075     void setStatus (int, bool);
00076     void saveSettings ();
00077     
00078   public slots:
00079     void slotAccel (int);
00080     void doKeyPress (QKeyEvent *);
00081     
00082   private:
00083     QPopupMenu *fileMenu;
00084     QPopupMenu *editMenu;
00085     QPopupMenu *viewMenu;
00086     QPopupMenu *toolMenu;
00087     QPopupMenu *helpMenu;
00088     QIntDict<QAction> actions;
00089 };
00090 
00091 #endif