summaryrefslogtreecommitdiff
path: root/library/datebookdb.h
authorhakan <hakan>2002-03-29 16:32:49 (UTC)
committer hakan <hakan>2002-03-29 16:32:49 (UTC)
commitd31e0363e905aae78034626896b0d6620ffbc8fc (patch) (unidiff)
treee6a98e06b0a76008c1ca8b12a095ce2ab2cabd34 /library/datebookdb.h
parent6e194663130b9548c4a31afd2798d9ca1dd30be5 (diff)
downloadopie-d31e0363e905aae78034626896b0d6620ffbc8fc.zip
opie-d31e0363e905aae78034626896b0d6620ffbc8fc.tar.gz
opie-d31e0363e905aae78034626896b0d6620ffbc8fc.tar.bz2
Added getEvent(uid) and a fix reassigning uids to events whos uids have been cleared
Diffstat (limited to 'library/datebookdb.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/datebookdb.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/datebookdb.h b/library/datebookdb.h
index aadb397..e4c251c 100644
--- a/library/datebookdb.h
+++ b/library/datebookdb.h
@@ -1,85 +1,88 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#ifndef DATEBOOKDB_H 21#ifndef DATEBOOKDB_H
22#define DATEBOOKDB_H 22#define DATEBOOKDB_H
23 23
24#include <qdatetime.h> 24#include <qdatetime.h>
25#include <qfile.h> 25#include <qfile.h>
26#include <qvaluelist.h> 26#include <qvaluelist.h>
27#include <qpe/event.h> 27#include <qpe/event.h>
28 28
29// journal actions... 29// journal actions...
30enum journal_action { ACTION_ADD, ACTION_REMOVE, ACTION_REPLACE }; 30enum journal_action { ACTION_ADD, ACTION_REMOVE, ACTION_REPLACE };
31 31
32class DateBookDBPrivate; 32class DateBookDBPrivate;
33class DateBookDB 33class DateBookDB
34{ 34{
35public: 35public:
36 DateBookDB(); 36 DateBookDB();
37 ~DateBookDB(); 37 ~DateBookDB();
38 38
39 // very depreciated now!!! 39 // very depreciated now!!!
40 QValueList<Event> getEvents( const QDate &from, const QDate &to ); 40 QValueList<Event> getEvents( const QDate &from, const QDate &to );
41 QValueList<Event> getEvents( const QDateTime &start ); 41 QValueList<Event> getEvents( const QDateTime &start );
42 42
43 // USE THESE!!! 43 // USE THESE!!!
44 QValueList<EffectiveEvent> getEffectiveEvents( const QDate &from, 44 QValueList<EffectiveEvent> getEffectiveEvents( const QDate &from,
45 const QDate &to ); 45 const QDate &to );
46 QValueList<EffectiveEvent> getEffectiveEvents( const QDateTime &start ); 46 QValueList<EffectiveEvent> getEffectiveEvents( const QDateTime &start );
47 Event getEvent( int uid );
47 48
48 QValueList<Event> getRawRepeats() const; 49 QValueList<Event> getRawRepeats() const;
49 QValueList<Event> getNonRepeatingEvents( const QDate &from, 50 QValueList<Event> getNonRepeatingEvents( const QDate &from,
50 const QDate &to ) const; 51 const QDate &to ) const;
51 52
52 // Use these when dealing with adding removing events... 53 // Use these when dealing with adding removing events...
53 void addEvent( const Event &ev, bool doalarm=TRUE ); 54 void addEvent( const Event &ev, bool doalarm=TRUE );
54 void removeEvent( const Event &ev ); 55 void removeEvent( const Event &ev );
55 void editEvent( const Event &old, Event &ev ); 56 void editEvent( const Event &old, Event &ev );
56 // add/remove event without journaling ( these ended up in public by accident, never 57 // add/remove event without journaling ( these ended up in public by accident, never
57 // use them unless you know what you are doing...), 58 // use them unless you know what you are doing...),
58 // please put them in private if we ever can change the class... 59 // please put them in private if we ever can change the class...
59 void addJFEvent( const Event &ev, bool doalarm=TRUE ); 60 void addJFEvent( const Event &ev, bool doalarm=TRUE );
60 void removeJFEvent( const Event &ev ); 61 void removeJFEvent( const Event &ev );
61 62
62 bool save(); 63 bool save();
63 void reload(); 64 void reload();
64private: 65private:
65 //find the real repeat... 66 //find the real repeat...
66 bool origRepeat( const Event &ev, Event &orig ) const; 67 bool origRepeat( const Event &ev, Event &orig ) const;
67 bool removeRepeat( const Event &ev ); 68 bool removeRepeat( const Event &ev );
68 void init(); 69 void init();
69 void loadFile( const QString &strFile ); 70 void loadFile( const QString &strFile );
70 // depreciated... 71 // depreciated...
71 void saveJournalEntry( const Event &ev, journal_action action ); 72 void saveJournalEntry( const Event &ev, journal_action action );
72 // new version, uncomment the "= -1" when we remove the above 73 // new version, uncomment the "= -1" when we remove the above
73 // function.. 74 // function..
74 bool saveJournalEntry( const Event &ev, journal_action action, 75 bool saveJournalEntry( const Event &ev, journal_action action,
75 int key/* = -1*/, bool origHadRepeat = false ); 76 int key/* = -1*/, bool origHadRepeat = false );
76 77
77 QValueList<Event> eventList; // non-repeating events... 78 QValueList<Event> eventList; // non-repeating events...
78 QValueList<Event> repeatEvents; // the repeating events... 79 QValueList<Event> repeatEvents; // the repeating events...
79 DateBookDBPrivate *d; 80 DateBookDBPrivate *d;
80 QFile journalFile; 81 QFile journalFile;
82
83 intrecordIdMax; // ADDITION
81}; 84};
82 85
83/* helper functions, also useful to other apps. */ 86/* helper functions, also useful to other apps. */
84bool nextOccurance( const Event &e, const QDate &from, QDateTime &next); 87bool nextOccurance( const Event &e, const QDate &from, QDateTime &next);
85#endif 88#endif