summaryrefslogtreecommitdiff
path: root/include/opie/tododb.h
blob: 6478363d3ab14db4b383bd4421396ae3758d31db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

#ifndef tododb_h
#define tododb_h

#include <qvaluelist.h>

#include <opie/todoevent.h>

class ToDoDB
{
 public:
    // if no argument is supplied pick the default book 
    ToDoDB(const QString &fileName = QString::null );
    ~ToDoDB();
    QValueList<ToDoEvent> effectiveToDos(const QDate &from,
					 const QDate &to,
					 bool includeNoDates = true);
    QValueList<ToDoEvent> effectiveToDos(const QDate &start, bool includeNoDates = true );
    QValueList<ToDoEvent> rawToDos(); // all events
    QValueList<ToDoEvent> overDue();

    void addEvent(const ToDoEvent &event );
    void editEvent(const ToDoEvent &editEvent );
    void removeEvent(const ToDoEvent &event);

    void reload();
    void setFileName(const QString & );
    QString fileName()const;
    bool save();

 private:
    class ToDoDBPrivate;
    ToDoDBPrivate *d;
    QString m_fileName;
    QValueList<ToDoEvent> m_todos;
    void load();
};


#endif