Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

traninfo.h

Go to the documentation of this file.
00001 /*
00002                              This file is part of the OPIE Project
00003                =.
00004              .=l.            Copyright (c)  2002 Dan Williams <drw@handhelds.org>
00005            .>+-=
00006  _;:,     .>    :=|.         This file is free software; you can
00007 .> <`_,   >  .   <=          redistribute it and/or modify it under
00008 :`=1 )Y*s>-.--   :           the terms of the GNU General Public
00009 .="- .-=="i,     .._         License as published by the Free Software
00010  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00011      ._= =}       :          or (at your option) any later version.
00012     .%`+i>       _;_.
00013     .i_,=:_.      -<s.       This file is distributed in the hope that
00014      +  .  -:.       =       it will be useful, but WITHOUT ANY WARRANTY;
00015     : ..    .:,     . . .    without even the implied warranty of
00016     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00017   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU General
00018 ..}^=.=       =       ;      Public License for more details.
00019 ++=   -.     .`     .:
00020  :     =  ...= . :.=-        You should have received a copy of the GNU
00021  -.   .:....=;==+<;          General Public License along with this file;
00022   -_. . .   )=.  =           see the file COPYING. If not, write to the
00023     --        :-=`           Free Software Foundation, Inc.,
00024                              59 Temple Place - Suite 330,
00025                              Boston, MA 02111-1307, USA.
00026 
00027 */
00028 
00029 #ifndef TRANINFO_H
00030 #define TRANINFO_H
00031 
00032 #include <qdatetime.h>
00033 #include <qlist.h>
00034 
00035 class Config;
00036 
00037 class TranInfo
00038 {
00039         public:
00040                 TranInfo( int = 0, const QString & = 0x0, const QDate & = QDate::currentDate(),
00041                                   bool = TRUE, const QString & = 0x0, const QString & = 0x0,
00042                                   float = 0.0, float = 0.0,
00043                                   const QString & = 0x0, const QString & = 0x0, int =-1 );
00044                 TranInfo( Config *, int );
00045 
00046         // getters
00047                 int            id()                     const { return i; }
00048         const QString &getIdStr();
00049 
00050                 const QString &desc()           const { return d; }
00051                 const QDate   &date()           const { return td; }
00052                 const QString &datestr(bool = false);
00053                 bool           withdrawal()     const { return w; }
00054                 const QString &type()           const { return t; }
00055                 const QString &category()       const { return c; }
00056                 float          amount()         const { return a; }
00057                 float          fee()            const { return f; }
00058                 const QString &number() const { return cn; }
00059                 const QString &notes()          const { return n; }
00060         int getNext()   { return(_next); }
00061 
00062         // setters
00063         void setDesc( const QString &desc )             { d = desc; }
00064                 void setDate( const QDate &date )                       { td = date; }
00065                 void setWithdrawal( bool withdrawal )           { w = withdrawal; }
00066                 void setType( const QString &type )             { t = type; }
00067                 void setCategory( const QString &cat )  { c = cat; }
00068                 void setAmount( float amount )                          { a = amount; }
00069                 void setFee( float fee )                                        { f = fee; }
00070                 void setNumber( const QString &num )            { cn = num; }
00071                 void setNotes( const QString &notes )           { n = notes; }
00072         void setNext(int next) { _next=next; }
00073 
00074         // write
00075         void write( Config * );
00076 
00077         // toString
00078         QString toString();
00079 
00080         private:
00081                 int     i;
00082                 QString d;
00083                 QDate   td;
00084                 bool    w;
00085                 QString t;
00086                 QString c;
00087                 float   a;
00088                 float   f;
00089                 QString cn;
00090                 QString n;
00091         int     _next;
00092 };
00093 
00094 class TranInfoList : public QList<TranInfo>
00095 {
00096     public:
00097         TranInfo *findMostRecentByDesc( const QString &desc );
00098 
00099         protected:
00100                 int compareItems( QCollection::Item, QCollection::Item );
00101 };
00102 
00103 #endif

Generated on Sat Nov 5 16:16:47 2005 for OPIE by  doxygen 1.4.2