KCalendarCore

freebusyperiod.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 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 /**
9  @file
10  This file is part of the API for handling calendar data and
11  defines the Period class.
12 
13  @brief
14  Represents a period of time.
15 
16  @author Cornelius Schumacher <[email protected]>
17 */
18 
19 #ifndef KCALCORE_FREEBUSYPERIOD_H
20 #define KCALCORE_FREEBUSYPERIOD_H
21 
22 #include "kcalendarcore_export.h"
23 #include "period.h"
24 
25 #include <QMetaType>
26 
27 namespace KCalendarCore
28 {
29 
30 /**
31  The period can be defined by either a start time and an end time or
32  by a start time and a duration.
33 */
34 class KCALENDARCORE_EXPORT FreeBusyPeriod : public Period
35 {
36 public:
37  enum FreeBusyType {
38  Free,
39  Busy,
40  BusyUnavailable,
41  BusyTentative,
42  Unknown
43  };
44 
45  /**
46  List of periods.
47  */
49 
50  /**
51  Constructs a period without a duration.
52  */
54 
55  /**
56  Constructs a period from @p start to @p end.
57 
58  @param start the time the period begins.
59  @param end the time the period ends.
60  */
61  FreeBusyPeriod(const QDateTime &start, const QDateTime &end);
62 
63  /**
64  Constructs a period from @p start and lasting @p duration.
65 
66  @param start the time when the period starts.
67  @param duration how long the period lasts.
68  */
69  FreeBusyPeriod(const QDateTime &start, const Duration &duration);
70 
71  /**
72  Constructs a period by copying another period object
73 
74  @param period the period to copy
75  */
76 
77  FreeBusyPeriod(const FreeBusyPeriod &period);
78 
79  /**
80  Constructs a period by copying another period object
81 
82  @param period the period to copy
83  */
84 
85  FreeBusyPeriod(const Period &period); //krazy:exclude=explicit
86 
87  /**
88  Destroys a period.
89  */
90  ~FreeBusyPeriod();
91 
92  /**
93  Sets this period equal to the @p other one.
94 
95  @param other is the other period to compare.
96  */
97  FreeBusyPeriod &operator=(const FreeBusyPeriod &other);
98 
99  /**
100  Sets the period summary.
101  @param summary is the period summary string.
102  @see summary().
103  */
104  void setSummary(const QString &summary);
105 
106  /**
107  Returns the period summary.
108  @see setSummary()
109  */
110  Q_REQUIRED_RESULT QString summary() const;
111 
112  /**
113  Sets the period location.
114  @param location is the period location string.
115  @see location().
116  */
117  void setLocation(const QString &location);
118 
119  /**
120  Returns the period location.
121  @see setLocation()
122  */
123  Q_REQUIRED_RESULT QString location() const;
124 
125  /**
126  Sets the free/busy type.
127  @param type is the type of free/busy period
128  @see type().
129  @since 5.0
130  */
131  void setType(FreeBusyType type);
132 
133  /**
134  Returns free/busy type
135  @see setType().
136  @since 5.0
137  */
138  Q_REQUIRED_RESULT FreeBusyType type() const;
139 
140 private:
141  //@cond PRIVATE
142  class Private;
143  Private *const d;
144  //@endcond
145 
146  friend KCALENDARCORE_EXPORT QDataStream &operator<<(QDataStream &stream,
147  const KCalendarCore::FreeBusyPeriod &period);
148  friend KCALENDARCORE_EXPORT QDataStream &operator>>(QDataStream &stream,
150 };
151 
152 /** Write @p period to the datastream @p stream, in binary format. */
153 KCALENDARCORE_EXPORT QDataStream &operator<<(QDataStream &stream,
154  const KCalendarCore::FreeBusyPeriod &period);
155 
156 /** Read a Period object into @p period from @p stream, in binary format. */
157 KCALENDARCORE_EXPORT QDataStream &operator>>(QDataStream &stream, KCalendarCore::FreeBusyPeriod &period);
158 }
159 
160 //@cond PRIVATE
161 Q_DECLARE_METATYPE(KCalendarCore::FreeBusyPeriod)
162 //@endcond
163 
164 #endif
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
Alarm serializer.
Definition: alarm.cpp:825
This file is part of the API for handling calendar data and defines the Period class.
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
Alarm deserializer.
Definition: alarm.cpp:849
Represents a span of time measured in seconds or days.
Definition: duration.h:44
The period can be defined by either a start time and an end time or by a start time and a duration...
Definition: period.h:38
QVector< FreeBusyPeriod > List
List of periods.
The period can be defined by either a start time and an end time or by a start time and a duration...
Namespace for all KCalendarCore types.
Definition: alarm.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Mar 4 2021 22:52:01 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.