-rw-r--r-- | include/opie/tododb.h | 44 | ||||
-rw-r--r-- | include/opie/todoevent.h | 53 | ||||
-rw-r--r-- | include/opie/todoresource.h | 14 | ||||
-rw-r--r-- | include/opie/xmltree.h | 112 |
4 files changed, 0 insertions, 223 deletions
diff --git a/include/opie/tododb.h b/include/opie/tododb.h deleted file mode 100644 index 945f343..0000000 --- a/include/opie/tododb.h +++ b/dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | |||
2 | #ifndef tododb_h | ||
3 | #define tododb_h | ||
4 | |||
5 | #include <qvaluelist.h> | ||
6 | |||
7 | #include <opie/todoevent.h> | ||
8 | |||
9 | class ToDoResource; | ||
10 | class ToDoDB | ||
11 | { | ||
12 | public: | ||
13 | // if no argument is supplied pick the default book | ||
14 | ToDoDB(const QString &fileName = QString::null, ToDoResource* resource= 0 ); | ||
15 | ~ToDoDB(); | ||
16 | QValueList<ToDoEvent> effectiveToDos(const QDate &from, | ||
17 | const QDate &to, | ||
18 | bool includeNoDates = true); | ||
19 | QValueList<ToDoEvent> effectiveToDos(const QDate &start, bool includeNoDates = true ); | ||
20 | QValueList<ToDoEvent> rawToDos(); // all events | ||
21 | QValueList<ToDoEvent> overDue(); | ||
22 | |||
23 | void addEvent(const ToDoEvent &event ); | ||
24 | void editEvent(const ToDoEvent &editEvent ); | ||
25 | void removeEvent(const ToDoEvent &event); | ||
26 | |||
27 | void reload(); | ||
28 | void setFileName(const QString & ); | ||
29 | QString fileName()const; | ||
30 | bool save(); | ||
31 | ToDoResource *resource(); | ||
32 | void setResource(ToDoResource* res); | ||
33 | |||
34 | private: | ||
35 | class ToDoDBPrivate; | ||
36 | ToDoDBPrivate *d; | ||
37 | QString m_fileName; | ||
38 | ToDoResource *m_res; | ||
39 | QValueList<ToDoEvent> m_todos; | ||
40 | void load(); | ||
41 | }; | ||
42 | |||
43 | |||
44 | #endif | ||
diff --git a/include/opie/todoevent.h b/include/opie/todoevent.h deleted file mode 100644 index 79522b2..0000000 --- a/include/opie/todoevent.h +++ b/dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | |||
2 | #ifndef todoevent_h | ||
3 | #define todoevent_h | ||
4 | |||
5 | #include <qdatetime.h> | ||
6 | |||
7 | class ToDoEvent { | ||
8 | friend class ToDoDB; | ||
9 | public: | ||
10 | enum Priority { VERYHIGH=1, HIGH, NORMAL, LOW, VERYLOW }; | ||
11 | ToDoEvent( bool completed = false, int priority = NORMAL, | ||
12 | const QString &category = QString::null, | ||
13 | const QString &description = QString::null , | ||
14 | bool hasDate = false, QDate date = QDate::currentDate(), int uid = -1 ); | ||
15 | bool isCompleted() const; | ||
16 | bool hasDate() const; | ||
17 | int priority()const ; | ||
18 | QString category()const; | ||
19 | QDate date()const; | ||
20 | QString description()const; | ||
21 | |||
22 | int uid()const { return m_uid;}; | ||
23 | void setCompleted(bool completed ); | ||
24 | void setHasDate( bool hasDate ); | ||
25 | // if the category doesn't exist we will create it | ||
26 | void setCategory( const QString &category ); | ||
27 | void setPriority(int priority ); | ||
28 | void setDate( QDate date ); | ||
29 | void setDescription(const QString& ); | ||
30 | bool isOverdue(); | ||
31 | |||
32 | void setUid(int id) {m_uid = id; }; | ||
33 | bool operator<(const ToDoEvent &toDoEvent )const; | ||
34 | bool operator<=(const ToDoEvent &toDoEvent )const; | ||
35 | bool operator!=(const ToDoEvent &toDoEvent )const { return !(*this == toDoEvent); }; | ||
36 | bool operator>(const ToDoEvent &toDoEvent )const; | ||
37 | bool operator>=(const ToDoEvent &toDoEvent)const; | ||
38 | bool operator==(const ToDoEvent &toDoEvent )const; | ||
39 | ToDoEvent &operator=(const ToDoEvent &toDoEvent ); | ||
40 | private: | ||
41 | class ToDoEventPrivate; | ||
42 | ToDoEventPrivate *d; | ||
43 | QDate m_date; | ||
44 | bool m_isCompleted:1; | ||
45 | bool m_hasDate:1; | ||
46 | int m_priority; | ||
47 | QString m_category; | ||
48 | QString m_desc; | ||
49 | int m_uid; | ||
50 | }; | ||
51 | |||
52 | |||
53 | #endif | ||
diff --git a/include/opie/todoresource.h b/include/opie/todoresource.h deleted file mode 100644 index 34edb04..0000000 --- a/include/opie/todoresource.h +++ b/dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | |||
2 | |||
3 | #ifndef opietodoresource_h | ||
4 | #define opietodoresource_h | ||
5 | |||
6 | class ToDoEvent; | ||
7 | class ToDoResource { | ||
8 | public: | ||
9 | ToDoResource( ) {}; | ||
10 | virtual QValueList<ToDoEvent> load(const QString &file ) = 0; | ||
11 | virtual bool save( const QString &file, const QValueList<ToDoEvent> & ) = 0; | ||
12 | }; | ||
13 | |||
14 | #endif | ||
diff --git a/include/opie/xmltree.h b/include/opie/xmltree.h deleted file mode 100644 index ed93c23..0000000 --- a/include/opie/xmltree.h +++ b/dev/null | |||
@@ -1,112 +0,0 @@ | |||
1 | /* This file is part of the KDE project | ||
2 | Copyright (C) 2000,2001 Simon Hausmann <hausmann@kde.org> | ||
3 | |||
4 | This library is free software; you can redistribute it and/or | ||
5 | modify it under the terms of the GNU Library General Public | ||
6 | License as published by the Free Software Foundation; either | ||
7 | version 2 of the License, or (at your option) any later version. | ||
8 | |||
9 | This library is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | Library General Public License for more details. | ||
13 | |||
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 | ||
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
17 | Boston, MA 02111-1307, USA. | ||
18 | */ | ||
19 | |||
20 | |||
21 | #ifndef __bookmarks_h__ | ||
22 | #define __bookmarks_h__ | ||
23 | |||
24 | #include <qstring.h> | ||
25 | #include <qmap.h> | ||
26 | #include <qtextstream.h> | ||
27 | |||
28 | /** | ||
29 | * A small xml lib written by Simon Hausmann. | ||
30 | */ | ||
31 | class XMLElement | ||
32 | { | ||
33 | public: | ||
34 | typedef QMap<QString, QString> AttributeMap; | ||
35 | |||
36 | /** | ||
37 | * The constructor of XMLElement | ||
38 | */ | ||
39 | XMLElement(); | ||
40 | ~XMLElement(); | ||
41 | |||
42 | /** appendChild appends a child to the XMLElement behind the last element. | ||
43 | * The ownership of the child get's transfered to the | ||
44 | * this XMLElement. | ||
45 | * If child is already the child of another parent | ||
46 | * it's get removed from the other parent first. | ||
47 | */ | ||
48 | void appendChild( XMLElement *child ); | ||
49 | |||
50 | /** inserts newChild after refChild. If newChild is the child | ||
51 | * of another parent the child will get removed. | ||
52 | * The ownership of child gets transfered. | ||
53 | * | ||
54 | */ | ||
55 | void insertAfter( XMLElement *newChild, XMLElement *refChild ); | ||
56 | |||
57 | /** same as insertAfter but the element get's inserted before refChild. | ||
58 | * | ||
59 | */ | ||
60 | void insertBefore( XMLElement *newChild, XMLElement *refChild ); | ||
61 | |||
62 | /** removeChild removes the child from the XMLElement. | ||
63 | * The ownership gets dropped. You need to delete the | ||
64 | * child yourself. | ||
65 | */ | ||
66 | void removeChild( XMLElement *child ); | ||
67 | |||
68 | /** parent() returns the parent of this XMLElement | ||
69 | * If there is no parent 0l gets returned | ||
70 | */ | ||
71 | XMLElement *parent() const { return m_parent; } | ||
72 | XMLElement *firstChild() const { return m_first; } | ||
73 | XMLElement *nextChild() const { return m_next; } | ||
74 | XMLElement *prevChild() const { return m_prev; } | ||
75 | XMLElement *lastChild() const { return m_last; } | ||
76 | |||
77 | void setTagName( const QString &tag ) { m_tag = tag; } | ||
78 | QString tagName() const { return m_tag; } | ||
79 | |||
80 | void setValue( const QString &val ) { m_value = val; } | ||
81 | QString value() const { return m_value; } | ||
82 | |||
83 | void setAttributes( const AttributeMap &attrs ) { m_attributes = attrs; } | ||
84 | AttributeMap attributes() const { return m_attributes; } | ||
85 | AttributeMap &attributes() { return m_attributes; } | ||
86 | |||
87 | QString attribute( const QString & ) const; | ||
88 | void setAttribute( const QString &attr, const QString &value ); | ||
89 | void save( QTextStream &stream, uint indent = 0 ); | ||
90 | |||
91 | XMLElement *namedItem( const QString &name ); | ||
92 | |||
93 | XMLElement *clone() const; | ||
94 | |||
95 | static XMLElement *load( const QString &fileName ); | ||
96 | |||
97 | private: | ||
98 | QString m_tag; | ||
99 | QString m_value; | ||
100 | AttributeMap m_attributes; | ||
101 | |||
102 | XMLElement *m_parent; | ||
103 | XMLElement *m_next; | ||
104 | XMLElement *m_prev; | ||
105 | XMLElement *m_first; | ||
106 | XMLElement *m_last; | ||
107 | |||
108 | XMLElement( const XMLElement &rhs ); | ||
109 | XMLElement &operator=( const XMLElement &rhs ); | ||
110 | }; | ||
111 | |||
112 | #endif | ||