author | zecke <zecke> | 2002-10-07 11:39:30 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-07 11:39:30 (UTC) |
commit | f11d4bda64b58abfebf77485d5d77143a10dc8c9 (patch) (unidiff) | |
tree | a4e80550c4abe867303553de608316941dd943f1 /core/pim/todo/todomanager.h | |
parent | c2cd5470fa3ec69394fa65ad16ab29a6cadab56f (diff) | |
download | opie-f11d4bda64b58abfebf77485d5d77143a10dc8c9.zip opie-f11d4bda64b58abfebf77485d5d77143a10dc8c9.tar.gz opie-f11d4bda64b58abfebf77485d5d77143a10dc8c9.tar.bz2 |
Re add files
for todo
-rw-r--r-- | core/pim/todo/todomanager.h | 107 |
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 | |||
44 | namespace 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 | ||