• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

KCalCore Library

  • kcalcore
freebusy.h
Go to the documentation of this file.
1/*
2 This file is part of the kcalcore library.
3
4 Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
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*/
30
31#ifndef KCALCORE_FREEBUSY_H
32#define KCALCORE_FREEBUSY_H
33
34#include "kcalcore_export.h"
35#include "event.h"
36#include "freebusyperiod.h"
37#include "incidencebase.h"
38#include "period.h"
39
40#include <QtCore/QMetaType>
41
42namespace KCalCore {
43
44class FreeBusy;
45
52class KCALCORE_EXPORT FreeBusy : public IncidenceBase
53{
54 friend KCALCORE_EXPORT QDataStream &operator<<(QDataStream &s,
55 const KCalCore::FreeBusy::Ptr &freebusy);
56 friend KCALCORE_EXPORT QDataStream &operator>>(QDataStream &s,
57 KCalCore::FreeBusy::Ptr &freebusy);
58
59public:
60
64 typedef QSharedPointer<FreeBusy> Ptr;
65
69 typedef QVector<Ptr> List;
70
74 FreeBusy();
75
80 FreeBusy(const FreeBusy &other);
81
86 explicit FreeBusy(const Period::List &busyPeriods);
87
92 explicit FreeBusy(const FreeBusyPeriod::List &busyPeriods);
93
100 FreeBusy(const KDateTime &start, const KDateTime &end);
101
109 FreeBusy(const Event::List &events, const KDateTime &start, const KDateTime &end);
110
114 ~FreeBusy();
115
120 IncidenceType type() const;
121
126 QByteArray typeStr() const;
127
135 virtual void setDtStart(const KDateTime &start);
136
144 void setDtEnd(const KDateTime &end);
145
151 virtual KDateTime dtEnd() const;
152
157 virtual void shiftTimes(const KDateTime::Spec &oldSpec,
158 const KDateTime::Spec &newSpec);
159
163 Period::List busyPeriods() const;
164
168 FreeBusyPeriod::List fullBusyPeriods() const;
169
176 void addPeriod(const KDateTime &start, const KDateTime &end);
177
184 void addPeriod(const KDateTime &start, const Duration &duration);
185
193 void addPeriods(const Period::List &list);
194
202 void addPeriods(const FreeBusyPeriod::List &list);
203
207 void sortList();
208
214 void merge(FreeBusy::Ptr freebusy);
215
220 KDateTime dateTime(DateTimeRole role) const;
221
226 void setDateTime(const KDateTime &dateTime, DateTimeRole role);
227
232 QLatin1String mimeType() const;
233
237 static QLatin1String freeBusyMimeType();
238
239protected:
244 virtual bool equals(const IncidenceBase &freebusy) const;
245
250 virtual IncidenceBase &assign(const IncidenceBase &other);
251
256 virtual void virtual_hook(int id, void *data);
257
258private:
263 bool accept(Visitor &v, IncidenceBase::Ptr incidence);
264
271 FreeBusy &operator=(const FreeBusy &other);
272
273 //@cond PRIVATE
274 class Private;
275 Private *const d;
276 //@endcond
277};
278
282KCALCORE_EXPORT QDataStream &operator<<(QDataStream &stream,
283 const KCalCore::FreeBusy::Ptr &freebusy);
287KCALCORE_EXPORT QDataStream &operator>>(QDataStream &stream,
288 KCalCore::FreeBusy::Ptr &freebusy);
289}
290
291//@cond PRIVATE
292Q_DECLARE_TYPEINFO(KCalCore::FreeBusy::Ptr, Q_MOVABLE_TYPE);
293Q_DECLARE_METATYPE(KCalCore::FreeBusy::Ptr)
294//@endcond
295
296#endif
KCalCore::Duration
Represents a span of time measured in seconds or days.
Definition duration.h:56
KCalCore::Event::List
QVector< Ptr > List
List of events.
Definition event.h:60
KCalCore::FreeBusyPeriod::List
QVector< FreeBusyPeriod > List
List of periods.
Definition freebusyperiod.h:52
KCalCore::FreeBusy
Provides information about the free/busy time of a calendar.
Definition freebusy.h:53
KCalCore::FreeBusy::operator<<
friend KCALCORE_EXPORT QDataStream & operator<<(QDataStream &s, const KCalCore::FreeBusy::Ptr &freebusy)
Serializes the freebusy object into the stream.
KCalCore::FreeBusy::dtEnd
virtual KDateTime dtEnd() const
Returns the end datetime for the free/busy.
Definition freebusy.cpp:228
KCalCore::FreeBusy::equals
virtual bool equals(const IncidenceBase &freebusy) const
Compare this with freebusy for equality.
Definition freebusy.cpp:322
KCalCore::FreeBusy::busyPeriods
Period::List busyPeriods() const
Returns the list of all periods within the free/busy.
Definition freebusy.cpp:233
KCalCore::FreeBusy::sortList
void sortList()
Sorts the list of free/busy periods into ascending order.
Definition freebusy.cpp:249
KCalCore::FreeBusy::dateTime
KDateTime dateTime(DateTimeRole role) const
Definition freebusy.cpp:340
KCalCore::FreeBusy::setDateTime
void setDateTime(const KDateTime &dateTime, DateTimeRole role)
Definition freebusy.cpp:347
KCalCore::FreeBusy::Ptr
QSharedPointer< FreeBusy > Ptr
A shared pointer to a FreeBusy object.
Definition freebusy.h:64
KCalCore::FreeBusy::assign
virtual IncidenceBase & assign(const IncidenceBase &other)
Definition freebusy.cpp:312
KCalCore::FreeBusy::operator>>
friend KCALCORE_EXPORT QDataStream & operator>>(QDataStream &s, KCalCore::FreeBusy::Ptr &freebusy)
Initializes the freebusy object from the stream.
KCalCore::FreeBusy::fullBusyPeriods
FreeBusyPeriod::List fullBusyPeriods() const
Returns the list of all periods within the free/busy.
Definition freebusy.cpp:244
KCalCore::FreeBusy::addPeriods
void addPeriods(const Period::List &list)
Adds a list of periods to the freebusy object and then sorts that list.
Definition freebusy.cpp:255
KCalCore::FreeBusy::setDtEnd
void setDtEnd(const KDateTime &end)
Sets the end datetime for the free/busy.
Definition freebusy.cpp:223
KCalCore::FreeBusy::typeStr
QByteArray typeStr() const
Definition freebusy.cpp:212
KCalCore::FreeBusy::type
IncidenceType type() const
Definition freebusy.cpp:207
KCalCore::FreeBusy::mimeType
QLatin1String mimeType() const
Definition freebusy.cpp:397
KCalCore::FreeBusy::merge
void merge(FreeBusy::Ptr freebusy)
Merges another free/busy into this free/busy.
Definition freebusy.cpp:281
KCalCore::FreeBusy::FreeBusy
FreeBusy()
Constructs an free/busy without any periods.
Definition freebusy.cpp:78
KCalCore::FreeBusy::freeBusyMimeType
static QLatin1String freeBusyMimeType()
Returns the Akonadi specific sub MIME type of a KCalCore::FreeBusy.
Definition freebusy.cpp:402
KCalCore::FreeBusy::virtual_hook
virtual void virtual_hook(int id, void *data)
Definition freebusy.cpp:353
KCalCore::FreeBusy::setDtStart
virtual void setDtStart(const KDateTime &start)
Sets the start date/time for the free/busy.
Definition freebusy.cpp:217
KCalCore::FreeBusy::List
QVector< Ptr > List
List of FreeBusy objects.
Definition freebusy.h:69
KCalCore::FreeBusy::shiftTimes
virtual void shiftTimes(const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec)
Definition freebusy.cpp:299
KCalCore::FreeBusy::addPeriod
void addPeriod(const KDateTime &start, const KDateTime &end)
Adds a period to the freebusy list and sorts the list.
Definition freebusy.cpp:269
KCalCore::IncidenceBase::IncidenceType
IncidenceType
The different types of incidences, per RFC2445.
Definition incidencebase.h:121
KCalCore::IncidenceBase::duration
Duration duration() const
Returns the length of the incidence duration.
Definition incidencebase.cpp:555
KCalCore::IncidenceBase::IncidenceBase
IncidenceBase()
Constructs an empty IncidenceBase.
Definition incidencebase.cpp:123
KCalCore::IncidenceBase::Ptr
QSharedPointer< IncidenceBase > Ptr
A shared pointer to an IncidenceBase.
Definition incidencebase.h:115
KCalCore::IncidenceBase::DateTimeRole
DateTimeRole
The different types of incidence date/times roles.
Definition incidencebase.h:133
KCalCore::Period::List
QVector< Period > List
List of periods.
Definition period.h:55
KCalCore::Visitor
This class provides the interface for a visitor of calendar components.
Definition visitor.h:44
event.h
This file is part of the API for handling calendar data and defines the Event class.
freebusyperiod.h
This file is part of the API for handling calendar data and defines the Period class.
incidencebase.h
This file is part of the API for handling calendar data and defines the IncidenceBase class.
KCalCore
TODO: KDE5:
Definition alarm.h:47
KCalCore::operator>>
KCALCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalCore::Alarm::Ptr &)
Alarm deserializer.
Definition alarm.cpp:863
KCalCore::operator<<
KCALCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalCore::Alarm::Ptr &)
Alarm serializer.
Definition alarm.cpp:853
period.h
This file is part of the API for handling calendar data and defines the Period class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCalCore Library

Skip menu "KCalCore Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal