summaryrefslogtreecommitdiff
path: root/libopie2
authorzecke <zecke>2003-05-07 14:45:49 (UTC)
committer zecke <zecke>2003-05-07 14:45:49 (UTC)
commit9602e59e3baf01465f4b4139715f2196bb01e012 (patch) (unidiff)
tree2d7f0dbf91e88de3981fcc82d49ba8ddc05cfbd5 /libopie2
parentda949558a957ec4817bf610d7c9186585c0d2d92 (diff)
downloadopie-9602e59e3baf01465f4b4139715f2196bb01e012.zip
opie-9602e59e3baf01465f4b4139715f2196bb01e012.tar.gz
opie-9602e59e3baf01465f4b4139715f2196bb01e012.tar.bz2
Add d ptr
add comments and FIXMEs three new signals for otodoaccess
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/xmltree.h2
-rw-r--r--libopie2/opiepim/core/otodoaccess.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/libopie2/opiecore/xmltree.h b/libopie2/opiecore/xmltree.h
index 4a6b6d9..4b6bdfa 100644
--- a/libopie2/opiecore/xmltree.h
+++ b/libopie2/opiecore/xmltree.h
@@ -1,117 +1,119 @@
1/* This file is part of the KDE project 1/* This file is part of the KDE project
2 Copyright (C) 2000,2001 Simon Hausmann <hausmann@kde.org> 2 Copyright (C) 2000,2001 Simon Hausmann <hausmann@kde.org>
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either 6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version. 7 version 2 of the License, or (at your option) any later version.
8 8
9 This library is distributed in the hope that it will be useful, 9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20 20
21#ifndef __bookmarks_h__ 21#ifndef __bookmarks_h__
22#define __bookmarks_h__ 22#define __bookmarks_h__
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qmap.h> 25#include <qmap.h>
26#include <qtextstream.h> 26#include <qtextstream.h>
27 27
28namespace Opie 28namespace Opie
29{ 29{
30 30
31/** 31/**
32 * A small xml lib written by Simon Hausmann. 32 * A small xml lib written by Simon Hausmann.
33 */ 33 */
34class XMLElement 34class XMLElement
35{ 35{
36public: 36public:
37 typedef QMap<QString, QString> AttributeMap; 37 typedef QMap<QString, QString> AttributeMap;
38 38
39 /** 39 /**
40 * The constructor of XMLElement 40 * The constructor of XMLElement
41 */ 41 */
42 XMLElement(); 42 XMLElement();
43 ~XMLElement(); 43 ~XMLElement();
44 44
45 /** appendChild appends a child to the XMLElement behind the last element. 45 /** appendChild appends a child to the XMLElement behind the last element.
46 * The ownership of the child get's transfered to the 46 * The ownership of the child get's transfered to the
47 * this XMLElement. 47 * this XMLElement.
48 * If child is already the child of another parent 48 * If child is already the child of another parent
49 * it's get removed from the other parent first. 49 * it's get removed from the other parent first.
50 */ 50 */
51 void appendChild( XMLElement *child ); 51 void appendChild( XMLElement *child );
52 52
53 /** inserts newChild after refChild. If newChild is the child 53 /** inserts newChild after refChild. If newChild is the child
54 * of another parent the child will get removed. 54 * of another parent the child will get removed.
55 * The ownership of child gets transfered. 55 * The ownership of child gets transfered.
56 * 56 *
57 */ 57 */
58 void insertAfter( XMLElement *newChild, XMLElement *refChild ); 58 void insertAfter( XMLElement *newChild, XMLElement *refChild );
59 59
60 /** same as insertAfter but the element get's inserted before refChild. 60 /** same as insertAfter but the element get's inserted before refChild.
61 * 61 *
62 */ 62 */
63 void insertBefore( XMLElement *newChild, XMLElement *refChild ); 63 void insertBefore( XMLElement *newChild, XMLElement *refChild );
64 64
65 /** removeChild removes the child from the XMLElement. 65 /** removeChild removes the child from the XMLElement.
66 * The ownership gets dropped. You need to delete the 66 * The ownership gets dropped. You need to delete the
67 * child yourself. 67 * child yourself.
68 */ 68 */
69 void removeChild( XMLElement *child ); 69 void removeChild( XMLElement *child );
70 70
71 /** parent() returns the parent of this XMLElement 71 /** parent() returns the parent of this XMLElement
72 * If there is no parent 0l gets returned 72 * If there is no parent 0l gets returned
73 */ 73 */
74 XMLElement *parent() const { return m_parent; } 74 XMLElement *parent() const { return m_parent; }
75 XMLElement *firstChild() const { return m_first; } 75 XMLElement *firstChild() const { return m_first; }
76 XMLElement *nextChild() const { return m_next; } 76 XMLElement *nextChild() const { return m_next; }
77 XMLElement *prevChild() const { return m_prev; } 77 XMLElement *prevChild() const { return m_prev; }
78 XMLElement *lastChild() const { return m_last; } 78 XMLElement *lastChild() const { return m_last; }
79 79
80 void setTagName( const QString &tag ) { m_tag = tag; } 80 void setTagName( const QString &tag ) { m_tag = tag; }
81 QString tagName() const { return m_tag; } 81 QString tagName() const { return m_tag; }
82 82
83 void setValue( const QString &val ) { m_value = val; } 83 void setValue( const QString &val ) { m_value = val; }
84 QString value() const { return m_value; } 84 QString value() const { return m_value; }
85 85
86 void setAttributes( const AttributeMap &attrs ) { m_attributes = attrs; } 86 void setAttributes( const AttributeMap &attrs ) { m_attributes = attrs; }
87 AttributeMap attributes() const { return m_attributes; } 87 AttributeMap attributes() const { return m_attributes; }
88 AttributeMap &attributes() { return m_attributes; } 88 AttributeMap &attributes() { return m_attributes; }
89 89
90 QString attribute( const QString & ) const; 90 QString attribute( const QString & ) const;
91 void setAttribute( const QString &attr, const QString &value ); 91 void setAttribute( const QString &attr, const QString &value );
92 void save( QTextStream &stream, uint indent = 0 ); 92 void save( QTextStream &stream, uint indent = 0 );
93 93
94 XMLElement *namedItem( const QString &name ); 94 XMLElement *namedItem( const QString &name );
95 95
96 XMLElement *clone() const; 96 XMLElement *clone() const;
97 97
98 static XMLElement *load( const QString &fileName ); 98 static XMLElement *load( const QString &fileName );
99 99
100private: 100private:
101 QString m_tag; 101 QString m_tag;
102 QString m_value; 102 QString m_value;
103 AttributeMap m_attributes; 103 AttributeMap m_attributes;
104 104
105 XMLElement *m_parent; 105 XMLElement *m_parent;
106 XMLElement *m_next; 106 XMLElement *m_next;
107 XMLElement *m_prev; 107 XMLElement *m_prev;
108 XMLElement *m_first; 108 XMLElement *m_first;
109 XMLElement *m_last; 109 XMLElement *m_last;
110 110
111 XMLElement( const XMLElement &rhs ); 111 XMLElement( const XMLElement &rhs );
112 XMLElement &operator=( const XMLElement &rhs ); 112 XMLElement &operator=( const XMLElement &rhs );
113 class Private;
114 Private* d;
113}; 115};
114 116
115} // namespace Opie 117} // namespace Opie
116 118
117#endif 119#endif
diff --git a/libopie2/opiepim/core/otodoaccess.h b/libopie2/opiepim/core/otodoaccess.h
index 2bb87dc..a626731 100644
--- a/libopie2/opiepim/core/otodoaccess.h
+++ b/libopie2/opiepim/core/otodoaccess.h
@@ -1,87 +1,90 @@
1#ifndef OPIE_TODO_ACCESS_H 1#ifndef OPIE_TODO_ACCESS_H
2#define OPIE_TODO_ACCESS_H 2#define OPIE_TODO_ACCESS_H
3 3
4#include <qobject.h> 4#include <qobject.h>
5#include <qvaluelist.h> 5#include <qvaluelist.h>
6 6
7#include "otodo.h" 7#include "otodo.h"
8#include "otodoaccessbackend.h" 8#include "otodoaccessbackend.h"
9#include "opimaccesstemplate.h" 9#include "opimaccesstemplate.h"
10 10
11 11
12/** 12/**
13 * OTodoAccess 13 * OTodoAccess
14 * the class to get access to 14 * the class to get access to
15 * the todolist 15 * the todolist
16 */ 16 */
17class OTodoAccess : public QObject, public OPimAccessTemplate<OTodo> { 17class OTodoAccess : public QObject, public OPimAccessTemplate<OTodo> {
18 Q_OBJECT 18 Q_OBJECT
19public: 19public:
20 enum SortOrder { Completed = 0, 20 enum SortOrder { Completed = 0,
21 Priority, 21 Priority,
22 Description, 22 Description,
23 Deadline }; 23 Deadline };
24 enum SortFilter{ Category =1, 24 enum SortFilter{ Category =1,
25 OnlyOverDue= 2, 25 OnlyOverDue= 2,
26 DoNotShowCompleted =4 }; 26 DoNotShowCompleted =4 };
27 /** 27 /**
28 * if you use 0l 28 * if you use 0l
29 * the default resource will be 29 * the default resource will be
30 * picked up 30 * picked up
31 */ 31 */
32 OTodoAccess( OTodoAccessBackend* = 0l, enum Access acc = Random ); 32 OTodoAccess( OTodoAccessBackend* = 0l, enum Access acc = Random );
33 ~OTodoAccess(); 33 ~OTodoAccess();
34 34
35 35
36 /* our functions here */ 36 /* our functions here */
37 /** 37 /**
38 * include todos from start to end 38 * include todos from start to end
39 * includeNoDates whether or not to include 39 * includeNoDates whether or not to include
40 * events with no dates 40 * events with no dates
41 */ 41 */
42 List effectiveToDos( const QDate& start, 42 List effectiveToDos( const QDate& start,
43 const QDate& end, 43 const QDate& end,
44 bool includeNoDates = true ); 44 bool includeNoDates = true );
45 45
46 /** 46 /**
47 * start 47 * start
48 * end date taken from the currentDate() 48 * end date taken from the currentDate()
49 */ 49 */
50 List effectiveToDos( const QDate& start, 50 List effectiveToDos( const QDate& start,
51 bool includeNoDates = true ); 51 bool includeNoDates = true );
52 52
53 53
54 /** 54 /**
55 * return overdue OTodos 55 * return overdue OTodos
56 */ 56 */
57 List overDue(); 57 List overDue();
58 58
59 /** 59 /**
60 * 60 *
61 */ 61 */
62 List sorted( bool ascending, int sortOrder, int sortFilter, int cat ); 62 List sorted( bool ascending, int sortOrder, int sortFilter, int cat );
63 63
64 /** 64 /**
65 * merge a list of OTodos into 65 * merge a list of OTodos into
66 * the resource 66 * the resource
67 */ 67 */
68 void mergeWith( const QValueList<OTodo>& ); 68 void mergeWith( const QValueList<OTodo>& );
69 69
70 /** 70 /**
71 * delete all already completed items 71 * delete all already completed items
72 */ 72 */
73 void removeAllCompleted(); 73 void removeAllCompleted();
74 74
75signals: 75signals:
76 /** 76 /**
77 * if the OTodoAccess was changed 77 * if the OTodoAccess was changed
78 */ 78 */
79 void signalChanged( const OTodoAccess* ); 79 void changed( const OTodoAccess* );
80 void changed( const OTodoAccess*, int uid );
81 void added( const OTodoAccess*, int uid );
82 void removed( const OTodoAccess*, int uid );
80private: 83private:
81 int m_cat; 84 int m_cat;
82 OTodoAccessBackend* m_todoBackEnd; 85 OTodoAccessBackend* m_todoBackEnd;
83 class OTodoAccessPrivate; 86 class OTodoAccessPrivate;
84 OTodoAccessPrivate* d; 87 OTodoAccessPrivate* d;
85}; 88};
86 89
87#endif 90#endif