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 "IndicatorPlugin.h" 00023 #include <qprocess.h> 00024 #include <qtimer.h> 00025 00026 class ExScript : public IndicatorPlugin 00027 { 00028 Q_OBJECT 00029 00030 public: 00031 ExScript (); 00032 virtual ~ExScript (); 00033 Indicator * calculate (); 00034 int indicatorPrefDialog (QWidget *); 00035 void setDefaults(); 00036 void getIndicatorSettings (Setting &); 00037 void setIndicatorSettings (Setting &); 00038 PlotLine * calculateCustom (QString &, QPtrList<PlotLine> &); 00039 void formatDialog (QStringList &vl, QString &rv, QString &rs); 00040 void getInput (QString &); 00041 PlotLine * doScript (); 00042 00043 public slots: 00044 void readFromStdout (); 00045 void timerDone (); 00046 00047 private: 00048 QColor color; 00049 PlotLine::LineType lineType; 00050 QString label; 00051 QString scriptPath; 00052 QString comlineParms; 00053 QProcess *proc; 00054 QString buffer; 00055 QTimer *timer; 00056 int seconds; 00057 00058 QString colorLabel; 00059 QString labelLabel; 00060 QString lineTypeLabel; 00061 QString scriptPathLabel; 00062 QString comlineParmsLabel; 00063 QString pluginLabel; 00064 QString dateLabel; 00065 QString openLabel; 00066 QString highLabel; 00067 QString lowLabel; 00068 QString closeLabel; 00069 QString volumeLabel; 00070 QString oiLabel; 00071 QString timeoutLabel; 00072 00073 bool dateFlag; 00074 bool openFlag; 00075 bool highFlag; 00076 bool lowFlag; 00077 bool closeFlag; 00078 bool volumeFlag; 00079 bool oiFlag; 00080 }; 00081