src/IndicatorPage.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 INDICATORPAGE_HPP
00023 #define INDICATORPAGE_HPP
00024 
00025 #include <qstring.h>
00026 #include <qwidget.h>
00027 #include <qpopupmenu.h>
00028 #include <qdir.h>
00029 #include <qcombobox.h>
00030 #include <qlistbox.h>
00031 #include <qlineedit.h>
00032 #include "DBIndex.h"
00033 #include "Setting.h"
00034 #include "Indicator.h"
00035 #include "RcFile.h"
00036 
00037 
00038 class IndicatorPage : public QWidget
00039 {
00040   Q_OBJECT
00041 
00042   signals:
00043     void signalDisableIndicator (QString);
00044     void signalEnableIndicator (QString);
00045     void signalEditIndicator (Indicator *);
00046     void signalDeleteIndicator (QString);
00047     void signalNewIndicator (Indicator *);
00048     void signalGroupChanged ();
00049     void signalGroupIsChanging ();
00050     void signalLocalIndicator (QString);
00051   
00052   public:
00053   
00054     enum HotKey
00055     {
00056       NewIndicatorGroup,
00057       DeleteIndicatorGroup,
00058       NewIndicator,
00059       AddLocalIndicator,
00060       DeleteIndicator,
00061       EditIndicator,
00062       MoveIndicator,
00063       Help,
00064       Tab
00065     };
00066   
00067     IndicatorPage (QWidget *, DBIndex *);
00068     ~IndicatorPage ();
00069     void updateGroups ();
00070     QString getIndicatorGroup ();
00071     void setFocus ();
00072     void setChartPath (QString &);
00073     void removeLocalIndicators ();
00074     void addLocalIndicators (QString &);
00075 
00076   public slots:
00077     void doubleClick (QListBoxItem *);
00078     void updateList ();
00079     void slotHelp ();
00080     void rightClick (QListBoxItem *);
00081     void newIndicator ();
00082     void editIndicator (QString);
00083     void editIndicator ();
00084     void deleteIndicator ();
00085     void itemSelected (const QString &);
00086     void changeIndicator (QString &);
00087     void slotAccel (int);
00088     void doKeyPress (QKeyEvent *key);
00089     void moveIndicator ();
00090     void slotGroupChanged (int);
00091     void newIndicatorGroup ();
00092     void deleteIndicatorGroup ();
00093     void searchChanged (const QString &);
00094     void addLocalIndicator ();
00095 
00096   protected:
00097     virtual void keyPressEvent (QKeyEvent *);
00098     
00099     QListBox *list;
00100     QComboBox *group;
00101     QPopupMenu *menu;
00102     QString baseDir;
00103     QString currentGroup;
00104     bool updateEnableFlag;
00105     QString chartPath;
00106     QStringList localIndicators;
00107     QLineEdit *search;
00108     QDir idir;
00109     DBIndex *chartIndex;
00110     RcFile rcfile;
00111 };
00112 
00113 #endif