plugins/quote/Yahoo/Yahoo.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 #include "QuotePlugin.h"
00023 #include <qstring.h>
00024 #include "Setting.h"
00025 #include "DbPlugin.h"
00026 #include "Config.h"
00027 #include <qlistbox.h>
00028 #include <qdatetimeedit.h>
00029 #include <qcheckbox.h>
00030 #include <qdatetime.h>
00031 #include <qcombobox.h>
00032 #include <qspinbox.h>
00033 #include "FileButton.h"
00034 
00035 class Yahoo : public QuotePlugin
00036 {
00037   Q_OBJECT
00038 
00039   public:
00040     Yahoo ();
00041     virtual ~Yahoo ();
00042     void update ();
00043     QString parseDate (QString &);
00044     void parseHistory ();
00045     void parseQuote ();
00046     void loadSettings ();
00047     void saveSettings ();
00048     void printErrorList ();
00049     void cancelUpdate ();
00050     void parseFundamental ();
00051     void loadAllSymbols ();
00052     void createHistoryUrls (QString &);
00053     void createAutoHistoryUrls (QString &, QString &);
00054     void createQuoteUrls (QString &);
00055     void createFundamentalUrls (QString &);
00056     void buildGui ();
00057     void setMethod (QString);
00058     void getExchange (QString &, QString &);
00059       
00060   public slots:
00061     void startDownload ();
00062     void fileDone (bool);
00063     void timeoutError ();
00064     void newStock ();
00065     void methodChanged (int);
00066     void allSymbolsChecked (bool);
00067 
00068   private:
00069     QStringList symbolList;
00070     QPtrList<Setting> url;
00071     Setting *currentUrl;
00072     QString dataPath;
00073     QStringList fileList;
00074     QStringList errorList;
00075     QStringList monthList;
00076     DbPlugin plug;
00077     Config config;
00078     FileButton *list;
00079     QCheckBox *adjustment;
00080     QDateEdit *sdate;
00081     QDateEdit *edate;
00082     QComboBox *method;
00083     QCheckBox *allSymbols;
00084     int fileCount;
00085     int fileCounter;
00086 };
00087 
00088 extern "C"
00089 {
00090   QuotePlugin * createQuotePlugin ();
00091 }
00092