KCalendarCore

schedulemessage.h
1 /*
2  This file is part of the kcalcore library.
3 
4  SPDX-FileCopyrightText: 2001-2003 Cornelius Schumacher <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 #ifndef KCALCORE_SCHEDULEMESSAGE_H
9 #define KCALCORE_SCHEDULEMESSAGE_H
10 
11 #include "incidencebase.h"
12 
13 #include "kcalendarcore_export.h"
14 
15 namespace KCalendarCore
16 {
17 class IncidenceBase;
18 
19 /**
20  iTIP methods.
21 */
22 enum iTIPMethod {
23  iTIPPublish, /**< Event, to-do, journal or freebusy posting */
24  iTIPRequest, /**< Event, to-do or freebusy scheduling request */
25  iTIPReply, /**< Event, to-do or freebusy reply to request */
26  iTIPAdd, /**< Event, to-do or journal additional property request */
27  iTIPCancel, /**< Event, to-do or journal cancellation notice */
28  iTIPRefresh, /**< Event or to-do description update request */
29  iTIPCounter, /**< Event or to-do submit counter proposal */
30  iTIPDeclineCounter, /**< Event or to-do decline a counter proposal */
31  iTIPNoMethod, /**< No method */
32 };
33 
34 /**
35  @brief
36  A Scheduling message class.
37 
38  This class provides an encapsulation of a scheduling message.
39  It associates an incidence with an iTIPMethod and status information.
40 */
41 class KCALENDARCORE_EXPORT ScheduleMessage
42 {
43 public:
44  /**
45  Message status.
46  */
47  enum Status {
48  PublishNew, /**< New message posting */
49  PublishUpdate, /**< Updated message */
50  Obsolete, /**< obsolete */
51  RequestNew, /**< Request new message posting */
52  RequestUpdate, /**< Request updated message */
53  Unknown, /**< No status */
54  };
55 
56  /**
57  A shared pointer to a ScheduleMessage.
58  */
60 
61  /**
62  Creates a scheduling message with method as defined in iTIPMethod and a status.
63  @param incidence a pointer to a valid Incidence to be associated with this message.
64  @param method an iTIPMethod.
65  @param status a Status.
66  */
67  ScheduleMessage(const IncidenceBase::Ptr &incidence, iTIPMethod method, Status status);
68 
69  /**
70  Destructor.
71  */
72  ~ScheduleMessage();
73 
74  /**
75  Returns the event associated with this message.
76  */
77  IncidenceBase::Ptr event() const;
78 
79  /**
80  Returns the iTIP method associated with this message.
81  */
82  Q_REQUIRED_RESULT iTIPMethod method() const;
83 
84  /**
85  Returns a machine-readable (not translatable) name for a iTIP method.
86  @param method an iTIPMethod.
87  */
88  Q_REQUIRED_RESULT static QString methodName(iTIPMethod method);
89 
90  /**
91  Returns the status of this message.
92  */
93  Q_REQUIRED_RESULT Status status() const;
94 
95  /**
96  Returns the error message if there is any.
97  */
98  Q_REQUIRED_RESULT QString error() const;
99 
100 private:
101  //@cond PRIVATE
102  Q_DISABLE_COPY(ScheduleMessage)
103  class Private;
104  Private *const d;
105  //@endcond
106 };
107 
108 }
109 
110 #endif
@ iTIPNoMethod
No method.
@ iTIPDeclineCounter
Event or to-do decline a counter proposal.
Namespace for all KCalendarCore types.
Definition: alarm.h:36
QSharedPointer< ScheduleMessage > Ptr
A shared pointer to a ScheduleMessage.
@ iTIPCancel
Event, to-do or journal cancellation notice.
@ iTIPPublish
Event, to-do, journal or freebusy posting.
@ iTIPAdd
Event, to-do or journal additional property request.
Q_SCRIPTABLE CaptureState status()
@ PublishNew
New message posting.
iTIPMethod
iTIP methods.
@ iTIPRefresh
Event or to-do description update request.
@ iTIPCounter
Event or to-do submit counter proposal.
@ iTIPReply
Event, to-do or freebusy reply to request.
@ RequestNew
Request new message posting.
@ iTIPRequest
Event, to-do or freebusy scheduling request.
A Scheduling message class.
@ RequestUpdate
Request updated message.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 28 2023 03:53:12 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.