KCalendarCore

todo.h
Go to the documentation of this file.
1 /*
2  This file is part of the kcalcore library.
3 
4  SPDX-FileCopyrightText: 2001-2003 Cornelius Schumacher <[email protected]>
5  SPDX-FileCopyrightText: 2009 Allen Winter <[email protected]>
6 
7  SPDX-License-Identifier: LGPL-2.0-or-later
8 */
18 #ifndef KCALCORE_TODO_H
19 #define KCALCORE_TODO_H
20 
21 #include "kcalendarcore_export.h"
22 #include "incidence.h"
23 
24 namespace KCalendarCore
25 {
26 
31 class KCALENDARCORE_EXPORT Todo : public Incidence
32 {
33 public:
38 
42  typedef QVector<Ptr> List;
43 
45  // needed for Akonadi polymorphic payload support
46  typedef Incidence SuperClass;
48 
52  Todo();
53 
58  Todo(const Todo &other);
59 
66  Todo(const Incidence &other); //krazy:exclude=explicit (copy ctor)
67 
71  ~Todo() override;
72 
76  Q_REQUIRED_RESULT IncidenceType type() const override;
77 
81  Q_REQUIRED_RESULT QByteArray typeStr() const override;
82 
87  Todo *clone() const override;
88 
98  void setDtDue(const QDateTime &dtDue, bool first = false);
99 
109  Q_REQUIRED_RESULT QDateTime dtDue(bool first = false) const;
110 
115  Q_REQUIRED_RESULT bool hasDueDate() const;
116 
121  Q_REQUIRED_RESULT bool hasStartDate() const;
122 
126  Q_REQUIRED_RESULT QDateTime dtStart() const override;
127 
138  Q_REQUIRED_RESULT QDateTime dtStart(bool first) const;
139 
147  Q_REQUIRED_RESULT bool isCompleted() const;
148 
157  void setCompleted(bool completed);
158 
164  Q_REQUIRED_RESULT int percentComplete() const;
165 
175  void setPercentComplete(int percent);
176 
183  Q_REQUIRED_RESULT QDateTime completed() const;
184 
191  void setCompleted(const QDateTime &completeDate);
192 
199  bool hasCompletedDate() const;
200 
213  Q_REQUIRED_RESULT bool isInProgress(bool first) const;
214 
219  Q_REQUIRED_RESULT bool isOpenEnded() const;
220 
232  Q_REQUIRED_RESULT bool isNotStarted(bool first) const;
233 
237  void shiftTimes(const QTimeZone &oldZone, const QTimeZone &newZone) override;
238 
242  void setAllDay(bool allDay) override;
243 
249  void setDtRecurrence(const QDateTime &dt);
250 
254  Q_REQUIRED_RESULT QDateTime dtRecurrence() const;
255 
265  bool recursOn(const QDate &date, const QTimeZone &timeZone) const override;
266 
272  bool isOverdue() const;
273 
277  Q_REQUIRED_RESULT QDateTime dateTime(DateTimeRole role) const override;
278 
282  void setDateTime(const QDateTime &dateTime, DateTimeRole role) override;
283 
287  Q_REQUIRED_RESULT QLatin1String mimeType() const override;
288 
292  Q_REQUIRED_RESULT QLatin1String iconName(const QDateTime &recurrenceId = {}) const override;
293 
298  bool supportsGroupwareCommunication() const override;
299 
303  Q_REQUIRED_RESULT static QLatin1String todoMimeType();
304 
305 protected:
310  bool equals(const IncidenceBase &todo) const override;
311 
315  IncidenceBase &assign(const IncidenceBase &other) override;
316 
320  void virtual_hook(VirtualHook id, void *data) override;
321 
322 private:
326  bool accept(Visitor &v, const IncidenceBase::Ptr &incidence) override;
327 
334  Todo &operator=(const Todo &other);
335 
336  // For polymorfic serialization
337  void serialize(QDataStream &out) const override;
338  void deserialize(QDataStream &in) override;
339 
340  //@cond PRIVATE
341  class Private;
342  Private *const d;
343  //@endcond
344 };
345 
346 } // namespace KCalendarCore
347 
348 //@cond PRIVATE
349 Q_DECLARE_TYPEINFO(KCalendarCore::Todo::Ptr, Q_MOVABLE_TYPE);
350 Q_DECLARE_METATYPE(KCalendarCore::Todo::Ptr)
351 Q_DECLARE_METATYPE(KCalendarCore::Todo *)
352 //@endcond
353 
354 #endif
This class provides the interface for a visitor of calendar components.
Definition: visitor.h:31
DateTimeRole
The different types of incidence date/times roles.
An abstract class that provides a common base for all calendar incidence classes. ...
Definition: incidencebase.h:96
QSharedPointer< Todo > Ptr
A shared pointer to a Todo object.
Definition: todo.h:37
Provides a To-do in the sense of RFC2445.
Definition: todo.h:31
IncidenceType
The different types of incidences, per RFC2445.
QVector< Ptr > List
List of to-dos.
Definition: todo.h:42
This file is part of the API for handling calendar data and defines the Incidence class...
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
Definition: incidence.h:56
Namespace for all KCalendarCore types.
Definition: alarm.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Oct 28 2020 22:55:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.