lib/Config.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 
00023 #ifndef CONFIG_HPP
00024 #define CONFIG_HPP
00025 
00026 #include <qstring.h>
00027 #include <qstringlist.h>
00028 #include <qlibrary.h>
00029 #include <qdict.h>
00030 #include <qsplitter.h>
00031 #include "IndicatorPlugin.h"
00032 #include "QuotePlugin.h"
00033 #include "Setting.h"
00034 #include "RcFile.h"
00035 
00036 class Config
00037 {
00038   public:
00039     enum Parm
00040     {
00041       Home,
00042       DataPath,
00043       Pixelspace,
00044       BarLength,
00045       Grid,
00046       Bars,
00047       BackgroundColor,
00048       BorderColor,
00049       GridColor,
00050       PaperTradeMode,
00051       IndicatorPath,
00052       Crosshairs,
00053       DrawMode,
00054       DataPanelSize,
00055       PS1Button,
00056       ScaleToScreen,
00057       IndicatorPluginPath, // unused
00058       QuotePluginPath,
00059       GroupPath,
00060       PortfolioPath,
00061       Group,
00062       TestPath,
00063       PlotFont,
00064       AppFont,
00065       NavAreaSize,
00066       LogScale,
00067       PS2Button,
00068       PS3Button,
00069       IndexPath,
00070       HelpFilePath,
00071       LastQuotePlugin,
00072       Height,
00073       Width,
00074       X,
00075       Y,
00076       ScannerPath,
00077       Version,
00078       PlotSizes,
00079       Menubar,
00080       COPath,
00081       LocalIndicatorsPath,
00082       FundamentalsPath,
00083       CurrentChart,
00084       Macro5, //unused
00085       Macro6, //unused
00086       Macro7, //unused
00087       Macro8, //unused
00088       Macro9, //unused
00089       Macro10, //unused
00090       Macro11, //unused
00091       Macro12, //unused
00092       IndicatorGroup,
00093       QuotePluginStorage,
00094       ShowUpgradeMessage, // unused
00095       LastNewIndicator,
00096       UserDocsPath
00097     };
00098 
00099     enum Indicator
00100     {
00101       Config_BARS,
00102       Config_CUS,
00103       Config_ExScript,
00104       Config_FI,
00105       Config_LMS,
00106       Config_LOWPASS,
00107       Config_PP,
00108       Config_SINWAV,
00109       Config_SZ,
00110       Config_THERM,
00111       Config_VFI,
00112       Config_VIDYA,
00113       Config_VOL
00114     };
00115 
00116     Config ();
00117     ~Config ();
00118     void setData (Parm, QString &);
00119     void setData (QString &, QString &);
00120     void getData (Parm, QString &);
00121     void getData (QString &, QString &);
00122     void loadSplitterSize (Parm, QSplitter *);
00123     void saveSplitterSize (Parm, QSplitter *);
00124     void getDirList (QString &, bool, QStringList &);
00125     void setup ();
00126 
00127     void getIndicators (QString &, QStringList &);
00128     void getIndicator (QString &, Setting &);
00129     void deleteIndicator (QString &);
00130     void getIndicatorList (QStringList &);
00131     void setIndicator (QString &, Setting &);
00132 
00133     void getPluginList (Config::Parm, QStringList &);
00134     IndicatorPlugin * getIndicatorPlugin (QString &);
00135     QuotePlugin * getQuotePlugin (QString &);
00136     void closePlugins ();
00137     void closePlugin (QString &);
00138 
00139     void copyIndicatorFile (QString &, QString &);
00140 //    void checkUpgrade (); deprecated
00141     void check034Conversion ();
00142 
00143   protected:
00144     QDict<QLibrary> libs;
00145     QDict<IndicatorPlugin> indicatorPlugins;
00146     QDict<QuotePlugin> quotePlugins;
00147     QString version;
00148     QStringList indicatorList;
00149     QStringList indicatorList2;
00150     RcFile rcfile;
00151 };
00152 
00153 #endif
00154