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 #include "QuotePlugin.h" 00023 #include "FuturesData.h" 00024 #include "DbPlugin.h" 00025 #include "Setting.h" 00026 #include "Config.h" 00027 #include <qdatetime.h> 00028 #include <qtimer.h> 00029 #include <qtabdialog.h> 00030 #include <qlineedit.h> 00031 #include <qcombobox.h> 00032 #include <qcheckbox.h> 00033 #include <qdatetimeedit.h> 00034 #include <qstringlist.h> 00035 #include <qspinbox.h> 00036 #include <qprogressbar.h> 00037 #include "FileButton.h" 00038 00039 class CSV : public QuotePlugin 00040 { 00041 Q_OBJECT 00042 00043 public: 00044 CSV (); 00045 virtual ~CSV (); 00046 void update (); 00047 void setDelimiter (QString &); 00048 void getDate (QString &, QString &, Setting &, QDate &); 00049 void getTime (QString &, QString &); 00050 bool openDb (QString &, QString &, QString &, bool); 00051 void loadSettings (); 00052 void saveSettings (); 00053 void getRule (Setting &); 00054 void cancelUpdate (); 00055 void createMainPage (); 00056 void updateRules (); 00057 00058 public slots: 00059 void parse (); 00060 void reloadTimerChanged (int); 00061 void dateRangeChanged (bool); 00062 void newRule (); 00063 void editRule (); 00064 void deleteRule (); 00065 void help (); 00066 00067 private: 00068 Config config; 00069 QString delim; 00070 FuturesData fd; 00071 DbPlugin db; 00072 QString symbolOveride; 00073 QString futuresSymbol; 00074 QString futuresMonth; 00075 bool cancelFlag; 00076 QString lastPath; 00077 QTimer *reloadTimer; 00078 QString ruleDir; 00079 FileButton *file; 00080 QLineEdit *symbol; 00081 QComboBox *ruleCombo; 00082 QDateEdit *sdate; 00083 QDateEdit *edate; 00084 QCheckBox *dateRange; 00085 QSpinBox *minutes; 00086 }; 00087 00088 extern "C" 00089 { 00090 QuotePlugin * createQuotePlugin (); 00091 }