summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/otodoaccess.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/otodoaccess.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/otodoaccess.h37
1 files changed, 34 insertions, 3 deletions
diff --git a/libopie2/opiepim/core/otodoaccess.h b/libopie2/opiepim/core/otodoaccess.h
index 916923f..e13d277 100644
--- a/libopie2/opiepim/core/otodoaccess.h
+++ b/libopie2/opiepim/core/otodoaccess.h
@@ -1,105 +1,136 @@
1/*
2 This file is part of the Opie Project
3 Copyright (C) The Main Author <main-author@whereever.org>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l.
6 .>+-=
7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
16 : .. .:, . . . without even the implied warranty of
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.= = ; Library General Public License for more
20++= -. .` .: details.
21 : = ...= . :.=-
22 -. .:....=;==+<; You should have received a copy of the GNU
23 -_. . . )=. = Library General Public License along with
24 -- :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28*/
1#ifndef OPIE_TODO_ACCESS_H 29#ifndef OPIE_TODO_ACCESS_H
2#define OPIE_TODO_ACCESS_H 30#define OPIE_TODO_ACCESS_H
3 31
4#include <qobject.h> 32#include <qobject.h>
5#include <qvaluelist.h> 33#include <qvaluelist.h>
6 34
7#include "otodo.h" 35#include <opie2/otodo.h>
8#include "otodoaccessbackend.h" 36#include <opie2/otodoaccessbackend.h>
9#include "opimaccesstemplate.h" 37#include <opie2/opimaccesstemplate.h>
10 38
39namespace Opie {
11 40
12/** 41/**
13 * OTodoAccess 42 * OTodoAccess
14 * the class to get access to 43 * the class to get access to
15 * the todolist 44 * the todolist
16 */ 45 */
17class OTodoAccess : public QObject, public OPimAccessTemplate<OTodo> { 46class OTodoAccess : public QObject, public OPimAccessTemplate<OTodo> {
18 Q_OBJECT 47 Q_OBJECT
19public: 48public:
20 enum SortOrder { Completed = 0, 49 enum SortOrder { Completed = 0,
21 Priority, 50 Priority,
22 Description, 51 Description,
23 Deadline }; 52 Deadline };
24 enum SortFilter{ Category =1, 53 enum SortFilter{ Category =1,
25 OnlyOverDue= 2, 54 OnlyOverDue= 2,
26 DoNotShowCompleted =4 }; 55 DoNotShowCompleted =4 };
27 /** 56 /**
28 * if you use 0l 57 * if you use 0l
29 * the default resource will be 58 * the default resource will be
30 * picked up 59 * picked up
31 */ 60 */
32 OTodoAccess( OTodoAccessBackend* = 0l, enum Access acc = Random ); 61 OTodoAccess( OTodoAccessBackend* = 0l, enum Access acc = Random );
33 ~OTodoAccess(); 62 ~OTodoAccess();
34 63
35 64
36 /* our functions here */ 65 /* our functions here */
37 /** 66 /**
38 * include todos from start to end 67 * include todos from start to end
39 * includeNoDates whether or not to include 68 * includeNoDates whether or not to include
40 * events with no dates 69 * events with no dates
41 */ 70 */
42 List effectiveToDos( const QDate& start, 71 List effectiveToDos( const QDate& start,
43 const QDate& end, 72 const QDate& end,
44 bool includeNoDates = true ); 73 bool includeNoDates = true );
45 74
46 /** 75 /**
47 * start 76 * start
48 * end date taken from the currentDate() 77 * end date taken from the currentDate()
49 */ 78 */
50 List effectiveToDos( const QDate& start, 79 List effectiveToDos( const QDate& start,
51 bool includeNoDates = true ); 80 bool includeNoDates = true );
52 81
53 82
54 /** 83 /**
55 * return overdue OTodos 84 * return overdue OTodos
56 */ 85 */
57 List overDue(); 86 List overDue();
58 87
59 /** 88 /**
60 * 89 *
61 */ 90 */
62 List sorted( bool ascending, int sortOrder, int sortFilter, int cat ); 91 List sorted( bool ascending, int sortOrder, int sortFilter, int cat );
63 92
64 /** 93 /**
65 * merge a list of OTodos into 94 * merge a list of OTodos into
66 * the resource 95 * the resource
67 */ 96 */
68 void mergeWith( const QValueList<OTodo>& ); 97 void mergeWith( const QValueList<OTodo>& );
69 98
70 /** 99 /**
71 * delete all already completed items 100 * delete all already completed items
72 */ 101 */
73 void removeAllCompleted(); 102 void removeAllCompleted();
74 103
75 /** 104 /**
76 * request information about what a backend supports. 105 * request information about what a backend supports.
77 * Supports in the sense of beeing able to store. 106 * Supports in the sense of beeing able to store.
78 * This is related to the enum in OTodo 107 * This is related to the enum in OTodo
79 * 108 *
80 * @param backend Will be used in the future when we support multiple backend 109 * @param backend Will be used in the future when we support multiple backend
81 */ 110 */
82 QBitArray backendSupport( const QString& backend = QString::null )const; 111 QBitArray backendSupport( const QString& backend = QString::null )const;
83 112
84 /** 113 /**
85 * see above but for a specefic attribute. This method was added for convience 114 * see above but for a specefic attribute. This method was added for convience
86 * @param attr The attribute to be queried for 115 * @param attr The attribute to be queried for
87 * @param backend Will be used in the future when we support multiple backends 116 * @param backend Will be used in the future when we support multiple backends
88 */ 117 */
89 bool backendSupports( int attr, const QString& backend = QString::null )const; 118 bool backendSupports( int attr, const QString& backend = QString::null )const;
90signals: 119signals:
91 /** 120 /**
92 * if the OTodoAccess was changed 121 * if the OTodoAccess was changed
93 */ 122 */
94 void changed( const OTodoAccess* ); 123 void changed( const OTodoAccess* );
95 void changed( const OTodoAccess*, int uid ); 124 void changed( const OTodoAccess*, int uid );
96 void added( const OTodoAccess*, int uid ); 125 void added( const OTodoAccess*, int uid );
97 void removed( const OTodoAccess*, int uid ); 126 void removed( const OTodoAccess*, int uid );
98private: 127private:
99 int m_cat; 128 int m_cat;
100 OTodoAccessBackend* m_todoBackEnd; 129 OTodoAccessBackend* m_todoBackEnd;
101 class OTodoAccessPrivate; 130 class OTodoAccessPrivate;
102 OTodoAccessPrivate* d; 131 OTodoAccessPrivate* d;
103}; 132};
104 133
134}
135
105#endif 136#endif