~ubuntu-branches/ubuntu/karmic/kdepim/karmic-backports

« back to all changes in this revision

Viewing changes to akonadi/resources/kolabproxy/task.h

  • Committer: Bazaar Package Importer
  • Author(s): Christian Mangold
  • Date: 2009-07-10 06:34:50 UTC
  • mfrom: (1.1.40 upstream)
  • Revision ID: james.westby@ubuntu.com-20090710063450-neojgew2fh0n3y0u
Tags: 4:4.2.96-0ubuntu1
* New upstream release
* Bump kde build-deps to 4.2.96

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
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.
4
 
 
5
 
    Copyright (c) 2004 Bo Thorsen <bo@sonofthor.dk>
6
 
 
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.
11
 
 
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.
16
 
 
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.
21
 
 
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
31
 
    your version.
32
 
*/
33
 
 
34
 
#ifndef KOLAB_TASK_H
35
 
#define KOLAB_TASK_H
36
 
 
37
 
#include <incidence.h>
38
 
 
39
 
#include <kcal/incidence.h>
40
 
 
41
 
class QDomElement;
42
 
 
43
 
namespace KCal {
44
 
  class Todo;
45
 
  class ResourceKolab;
46
 
}
47
 
 
48
 
namespace Kolab {
49
 
 
50
 
/**
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
54
 
 * one to the other.
55
 
 */
56
 
class Task : public Incidence {
57
 
public:
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 */);
62
 
 
63
 
  /// Use this to get an xml string describing this task entry
64
 
  static QString taskToXML( KCal::Todo*, const QString& tz );
65
 
 
66
 
  explicit Task( /*KCal::ResourceKolab *res, const QString& subResource, quint32 sernum,*/
67
 
                 const QString& tz, KCal::Todo* todo = 0 );
68
 
  virtual ~Task();
69
 
 
70
 
  virtual QString type() const { return "Task"; }
71
 
 
72
 
  void saveTo( KCal::Todo* todo );
73
 
 
74
 
  virtual void setPriority( int priority );
75
 
  virtual int priority() const;
76
 
 
77
 
  virtual void setPercentCompleted( int percent );
78
 
  virtual int percentCompleted() const;
79
 
 
80
 
  virtual void setStatus( KCal::Incidence::Status status );
81
 
  virtual KCal::Incidence::Status status() const;
82
 
 
83
 
  virtual void setParent( const QString& parentUid );
84
 
  virtual QString parent() const;
85
 
 
86
 
  virtual void setHasStartDate( bool );
87
 
  virtual bool hasStartDate() const;
88
 
 
89
 
  virtual void setDueDate( const KDateTime& date );
90
 
  virtual KDateTime dueDate() const;
91
 
  virtual bool hasDueDate() const;
92
 
 
93
 
  virtual void setCompletedDate( const KDateTime& date );
94
 
  virtual KDateTime completedDate() const;
95
 
  virtual bool hasCompletedDate() const;
96
 
 
97
 
  // Load the attributes of this class
98
 
  virtual bool loadAttribute( QDomElement& );
99
 
 
100
 
  // Save the attributes of this class
101
 
  virtual bool saveAttributes( QDomElement& ) const;
102
 
 
103
 
  // Load this task by reading the XML file
104
 
  virtual bool loadXML( const QDomDocument& xml );
105
 
 
106
 
  // Serialize this task to an XML string
107
 
  virtual QString saveXML() const;
108
 
 
109
 
protected:
110
 
  // Read all known fields from this ical todo
111
 
  void setFields( const KCal::Todo* );
112
 
 
113
 
  int mPriority;
114
 
  int mPercentCompleted;
115
 
  KCal::Incidence::Status mStatus;
116
 
  QString mParent;
117
 
 
118
 
  bool mHasStartDate;
119
 
 
120
 
  bool mHasDueDate;
121
 
  KDateTime mDueDate;
122
 
 
123
 
  bool mHasCompletedDate;
124
 
  KDateTime mCompletedDate;
125
 
};
126
 
 
127
 
}
128
 
 
129
 
#endif // KOLAB_TASK_H