2
This file is part of the kolab resource - the implementation of the
3
Kolab storage format. See www.kolab.org for documentation on this.
5
Copyright (c) 2004 Bo Thorsen <bo@sonofthor.dk>
7
This library is free software; you can redistribute it and/or
8
modify it under the terms of the GNU Library General Public
9
License as published by the Free Software Foundation; either
10
version 2 of the License, or (at your option) any later version.
12
This library is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
Library General Public License for more details.
17
You should have received a copy of the GNU Library General Public License
18
along with this library; see the file COPYING.LIB. If not, write to
19
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
Boston, MA 02110-1301, USA.
22
In addition, as a special exception, the copyright holders give
23
permission to link the code of this program with any edition of
24
the Qt library by Trolltech AS, Norway (or with modified versions
25
of Qt that use the same license as Qt), and distribute linked
26
combinations including the two. You must obey the GNU General
27
Public License in all respects for all of the code used other than
28
Qt. If you modify this file, you may extend this exception to
29
your version of the file, but you are not obligated to do so. If
30
you do not wish to do so, delete this exception statement from
37
#include <incidence.h>
39
#include <kcal/incidence.h>
51
* This class represents a task, and knows how to load/save it
52
* from/to XML, and from/to a KCal::Todo.
53
* The instances of this class are temporary, only used to convert
56
class Task : public Incidence {
58
/// Use this to parse an xml string to a task entry
59
/// The caller is responsible for deleting the returned task
60
static KCal::Todo* xmlToTask( const QString& xml, const QString& tz/*, KCal::ResourceKolab *res = 0,
61
const QString& subResource = QString(), quint32 sernum = 0 */);
63
/// Use this to get an xml string describing this task entry
64
static QString taskToXML( KCal::Todo*, const QString& tz );
66
explicit Task( /*KCal::ResourceKolab *res, const QString& subResource, quint32 sernum,*/
67
const QString& tz, KCal::Todo* todo = 0 );
70
virtual QString type() const { return "Task"; }
72
void saveTo( KCal::Todo* todo );
74
virtual void setPriority( int priority );
75
virtual int priority() const;
77
virtual void setPercentCompleted( int percent );
78
virtual int percentCompleted() const;
80
virtual void setStatus( KCal::Incidence::Status status );
81
virtual KCal::Incidence::Status status() const;
83
virtual void setParent( const QString& parentUid );
84
virtual QString parent() const;
86
virtual void setHasStartDate( bool );
87
virtual bool hasStartDate() const;
89
virtual void setDueDate( const KDateTime& date );
90
virtual KDateTime dueDate() const;
91
virtual bool hasDueDate() const;
93
virtual void setCompletedDate( const KDateTime& date );
94
virtual KDateTime completedDate() const;
95
virtual bool hasCompletedDate() const;
97
// Load the attributes of this class
98
virtual bool loadAttribute( QDomElement& );
100
// Save the attributes of this class
101
virtual bool saveAttributes( QDomElement& ) const;
103
// Load this task by reading the XML file
104
virtual bool loadXML( const QDomDocument& xml );
106
// Serialize this task to an XML string
107
virtual QString saveXML() const;
110
// Read all known fields from this ical todo
111
void setFields( const KCal::Todo* );
114
int mPercentCompleted;
115
KCal::Incidence::Status mStatus;
123
bool mHasCompletedDate;
124
KDateTime mCompletedDate;
129
#endif // KOLAB_TASK_H