00001 /***************************************************************************** 00002 ** $Id: qts_record.h,v 1.4 2002/10/07 02:55:07 andrew23 Exp $ 00003 ** 00004 ** This is part of the QCad GUI 00005 ** Copyright (C) 2001 Andrew Mustun 00006 ** 00007 ** This program is free software; you can redistribute it and/or modify 00008 ** it under the terms of the GNU General Public License (version 2) as 00009 ** published by the Free Software Foundation. 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 USA 00019 ******************************************************************************/ 00020 00021 #ifndef QTS_RECORD_H 00022 #define QTS_RECORD_H 00023 00024 #include <qobject.h> 00025 #include <qdatetime.h> 00026 #include "rs_line.h" 00027 00032 class QTS_Record : public QObject { 00033 public: 00034 QTS_Record(); 00035 QTS_Record(const QDateTime& per); 00036 QTS_Record(const QString& periodStr, double open, double high, double low, double close); 00037 ~QTS_Record(); 00038 00039 bool parse(const QString& str); 00040 static QDateTime periodFromString(const QString& periodStr); 00041 static int stringToMonth(const QString& monthStr); 00042 static const char* monthToString(int m); 00043 QString getPeriodString(const QString& format); 00044 QString getPeriodString(); 00045 QString getPeriodStringEnglish(); 00046 long getPeriodInt(); 00047 QString toString(); 00048 void updateLines(); 00049 00050 bool isHoliday(); 00051 00052 public: 00054 QDateTime period; 00056 double open; 00058 double high; 00060 double low; 00062 double close; 00064 RS_Line* lbar; 00066 RS_Line* lopen; 00068 RS_Line* lclose; 00069 }; 00070 00071 #endif