summaryrefslogtreecommitdiff
path: root/core/pim/todo/todomanager.h
Unidiff
Diffstat (limited to 'core/pim/todo/todomanager.h') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/todo/todomanager.h107
1 files changed, 107 insertions, 0 deletions
diff --git a/core/pim/todo/todomanager.h b/core/pim/todo/todomanager.h
new file mode 100644
index 0000000..1f9e288
--- a/dev/null
+++ b/core/pim/todo/todomanager.h
@@ -0,0 +1,107 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 <>
4           .>+-=
5 _;:,     .>    :=|. This program is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This program is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#ifndef OPIE_TODO_MANAGER_H
30#define OPIE_TODO_MANAGER_H
31
32#include <qarray.h>
33#include <qobject.h>
34#include <qstring.h>
35
36#include <qpe/categories.h>
37
38#include <opie/otodo.h>
39#include <opie/otodoaccess.h>
40
41#include "smalltodo.h"
42
43
44namespace Todo {
45 class TodoManager : public QObject{
46 Q_OBJECT
47 public:
48 bool isLoaded()const;
49 void load();
50 TodoManager(QObject* obj = 0);
51 ~TodoManager();
52
53 QStringList categories()/*const*/;
54 int catId(const QString&);
55 OTodo event(int uid );
56
57 void updateList();
58 /** returns the iterator sorted if set sorted*/
59 OTodoAccess::List::Iterator begin();
60 OTodoAccess::List::Iterator end();
61 OTodoAccess::List& list();
62
63 OTodoAccess::List::Iterator overDue();
64 OTodoAccess::List::Iterator fromTo( const QDate& start,
65 const QDate& end );
66 OTodoAccess::List::Iterator query( const OTodo& ev, int query );
67
68 void setCategory( bool sort, int category = -1);
69 void setShowOverDue( bool show );
70 void setSortOrder( int sortOrder );
71 void setSortASC( bool );
72 void sort();
73
74 OTodoAccess* todoDB();
75 bool saveAll();
76
77
78 signals:
79 void update();
80 void updateCategories();
81
82 public slots:
83 void add( const OTodo& );
84 void update( int uid, const SmallTodo& );
85 void update( int uid, const OTodo& );
86 void remove( int uid );
87 void remove( const QArray<int>& );
88 void removeAll();
89 void reload();
90 void save();
91
92 private:
93 OTodoAccess* m_db;
94 OTodoAccess::List m_list;
95 OTodoAccess::List::Iterator m_it;
96 OTodoAccess::List m_sorted;
97 Categories m_cat;
98 int m_ca;
99 /* sort cat */
100 bool m_shCat;
101 int m_sortOrder;
102 bool m_asc;
103
104 };
105};
106
107#endif