lib/BarEdit.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 #ifndef BAREDIT_HPP
00023 #define BAREDIT_HPP
00024 
00025 //#include <qdatetimeedit.h>
00026 #include <qlineedit.h>
00027 #include <qwidget.h>
00028 #include <qlayout.h>
00029 #include <qdatetime.h>
00030 #include "Toolbar.h"
00031 
00032 class BarEdit : public QWidget
00033 {
00034   Q_OBJECT
00035   
00036   signals:
00037     void signalDeleteRecord ();
00038     void signalSaveRecord ();
00039     void signalFirstRecord ();
00040     void signalLastRecord ();
00041     void signalPrevRecord ();
00042     void signalNextRecord ();
00043     void signalSearch (QDateTime);
00044 
00045   public:
00046     BarEdit (QWidget *);
00047     ~BarEdit ();
00048     void clearRecordFields ();
00049     void createField (QString &, QString &, bool);
00050     void getDate (QString &);
00051     void setDate (QString &, bool);
00052     void setField (QString &, QString &);
00053     void getField (QString &, QString &);
00054     bool getSaveFlag ();
00055     void saveRecordDialog ();
00056     void clearButtons ();
00057 
00058   public slots:
00059     void deleteRecord ();
00060     void saveRecord ();
00061     void slotDateSearch ();
00062     void textChanged (const QString &);
00063     void slotFirstRecord ();
00064     void slotLastRecord ();
00065     void slotPrevRecord ();
00066     void slotNextRecord ();
00067 
00068   private:
00069     QGridLayout *grid;
00070 //    QDateTimeEdit *dateSearch;
00071     QLineEdit *date;
00072     QDict<QLineEdit> editList;
00073     Toolbar *toolbar;
00074     bool saveRecordFlag;
00075     bool ignoreSaveRecordFlag;
00076     QString saveLabel;
00077     QString deleteLabel;
00078 };
00079 
00080 #endif