datebookdb.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef DATEBOOKDB_H
00022 #define DATEBOOKDB_H
00023
00024 #include <qdatetime.h>
00025 #include <qfile.h>
00026 #include <qvaluelist.h>
00027 #include <qpe/event.h>
00028
00029
00030 enum journal_action { ACTION_ADD, ACTION_REMOVE, ACTION_REPLACE };
00031
00032 class DateBookDBPrivate;
00033 class DateBookDB
00034 {
00035 public:
00036 DateBookDB();
00037 ~DateBookDB();
00038
00039
00040 QValueList<Event> getEvents( const QDate &from, const QDate &to );
00041 QValueList<Event> getEvents( const QDateTime &start );
00042
00043
00044 QValueList<EffectiveEvent> getEffectiveEvents( const QDate &from,
00045 const QDate &to );
00046 QValueList<EffectiveEvent> getEffectiveEvents( const QDateTime &start );
00047
00048 QValueList<Event> getRawRepeats() const;
00049 QValueList<Event> getNonRepeatingEvents( const QDate &from,
00050 const QDate &to ) const;
00051
00052
00053 void addEvent( const Event &ev, bool doalarm=TRUE );
00054 void removeEvent( const Event &ev );
00055 void editEvent( const Event &old, Event &ev );
00056
00057
00058
00059 void addJFEvent( const Event &ev, bool doalarm=TRUE );
00060 void removeJFEvent( const Event &ev );
00061
00062 bool save();
00063 void reload();
00064 private:
00065
00066 bool origRepeat( const Event &ev, Event &orig ) const;
00067 bool removeRepeat( const Event &ev );
00068 void init();
00069 void loadFile( const QString &strFile );
00070
00071 void saveJournalEntry( const Event &ev, journal_action action );
00072
00073
00074 bool saveJournalEntry( const Event &ev, journal_action action,
00075 int key, bool origHadRepeat = false );
00076
00077 QValueList<Event> eventList;
00078 QValueList<Event> repeatEvents;
00079 DateBookDBPrivate *d;
00080 QFile journalFile;
00081
00082 int recordIdMax;
00083 };
00084
00085
00086 bool nextOccurance( const Event &e, const QDate &from, QDateTime &next);
00087 #endif
This file is part of the documentation for OPIE Version 1.5.5.