00001 /*************************************************************************** 00002 qtstalker.h - description 00003 ------------------- 00004 begin : Thu Mar 7 22:43:41 EST 2002 00005 copyright : (C) 2001-2007 by Stefan Stratigakos 00006 email : 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef QTSTALKER_H 00019 #define QTSTALKER_H 00020 00021 #include <qmainwindow.h> 00022 #include <qmenubar.h> 00023 #include <qtoolbar.h> 00024 #include <qstring.h> 00025 #include <qtabwidget.h> 00026 #include <qsplitter.h> 00027 #include <qmultilineedit.h> 00028 #include <qdict.h> 00029 #include <qprogressbar.h> 00030 #include <qstatusbar.h> 00031 #include <qtabwidget.h> 00032 00033 #include "Indicator.h" 00034 #include "Plot.h" 00035 #include "Config.h" 00036 #include "Navigator.h" 00037 #include "Setting.h" 00038 #include "ChartPage.h" 00039 #include "NavigatorTab.h" 00040 #include "IndicatorPage.h" 00041 #include "ScannerPage.h" 00042 #include "PortfolioPage.h" 00043 #include "TestPage.h" 00044 #include "GroupPage.h" 00045 #include "ChartToolbar.h" 00046 #include "MainMenubar.h" 00047 #include "ExtraToolbar.h" 00048 #include "DBIndex.h" 00049 #include "RcFile.h" 00050 00051 // not used #define DEFAULT_INDICATOR_HEIGHT 125 00052 00053 class QtstalkerApp : public QMainWindow 00054 { 00055 Q_OBJECT 00056 00057 signals: 00058 void signalPixelspace (int); 00059 void signalBackgroundColor (QColor); 00060 void signalBorderColor (QColor); 00061 void signalGridColor (QColor); 00062 void signalPlotFont (QFont); 00063 void signalIndex (int); 00064 void signalInterval(BarData::BarLength); 00065 void signalChartPath (QString); 00066 void signalCrosshairsStatus(bool); 00067 00068 public: 00069 00070 enum chartStatus 00071 { 00072 None, 00073 Chart 00074 }; 00075 00076 QtstalkerApp (); 00077 ~QtstalkerApp (); 00078 void initConfig (); 00079 void initMenuBar (); 00080 void initToolBar (); 00081 void initGroupNav (); 00082 void initChartNav (); 00083 void initPortfolioNav(); 00084 void initTestNav(); 00085 void initIndicatorNav (); 00086 void initScannerNav (); 00087 QString getWindowCaption (); 00088 void loadChart (QString &); 00089 void barLengthChanged (); 00090 void exportChart (QString &); 00091 void traverse(QString &); 00092 void loadIndicator (Indicator *); 00093 void setSliderStart (); 00094 00095 public slots: 00096 void slotAbout (); 00097 void slotQuit(); 00098 void slotOpenChart (QString); 00099 void slotQuotes (); 00100 void slotOptions (); 00101 void slotDataWindow (); 00102 void slotNewIndicator (Indicator *); 00103 void slotEditIndicator (Indicator *); 00104 void slotDeleteIndicator (QString); 00105 void slotBarLengthChanged (int); 00106 void slotPixelspaceChanged (int); 00107 void slotChartUpdated (); 00108 void slotStatusMessage (QString); 00109 void slotHideNav (bool); 00110 void slotUpdateInfo (Setting *); 00111 void slotPlotLeftMouseButton (int, int, bool); 00112 void slotCrosshairsStatus (bool); 00113 void slotNavigatorPosition (int); 00114 void slotHelp (); 00115 void slotDisableIndicator (QString); 00116 void slotEnableIndicator (QString); 00117 void slotProgMessage (int, int); 00118 void slotDrawPlots (); 00119 void slotPaperTradeChanged (bool); 00120 void addIndicatorButton (QString); 00121 void slotWakeup (); 00122 void slotIndicatorSummary (); 00123 void slotDeleteAllCO (); 00124 void slotDeleteCO (QString); 00125 void slotSaveCO (Setting); 00126 void slotMenubarStatus (bool); 00127 void slotExtraToolbarStatus (bool); 00128 void slotAppFont (QFont); 00129 void slotLoadMainToolbarSettings(); 00130 void slotSavePlotSizes(); 00131 void slotLoadPlotSizes(); 00132 00133 private: 00134 QToolBar *toolbar; 00135 ChartToolbar *toolbar2; 00136 ExtraToolbar *extraToolbar; 00137 MainMenubar *menubar; 00138 QSplitter *split; 00139 QSplitter *navSplitter; 00140 QSplitter *dpSplitter; 00141 NavigatorTab *navTab; 00142 QWidget *baseWidget; 00143 QWidget *navBase; 00144 ChartPage *chartNav; 00145 QDict<Plot> plotList; 00146 Config config; 00147 chartStatus status; 00148 QString chartPath; 00149 QString chartName; 00150 QString chartSymbol; 00151 QString dbPlugin; 00152 BarData *recordList; 00153 QMultiLineEdit *infoLabel; 00154 IndicatorPage *ip; 00155 PortfolioPage *pp; 00156 ScannerPage *sp; 00157 TestPage *tp; 00158 GroupPage *gp; 00159 QProgressBar *progBar; 00160 QStatusBar *statusbar; 00161 QString chartType; 00162 QPtrList<QTabWidget> tabList; 00163 QDict<QWidget> widgetList; 00164 DBIndex *chartIndex; 00165 RcFile rcfile; 00166 QString lastIndicatorUsed1; 00167 QString lastIndicatorUsed2; 00168 QString lastIndicatorUsed3; 00169 }; 00170 00171 #endif 00172