• 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 */
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 
42 namespace KCalCore {
43 
44 class FreeBusy;
45 
52 class 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 
59 public:
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 
239 protected:
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 
258 private:
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 
282 KCALCORE_EXPORT QDataStream &operator<<(QDataStream &stream,
283  const KCalCore::FreeBusy::Ptr &freebusy);
287 KCALCORE_EXPORT QDataStream &operator>>(QDataStream &stream,
288  KCalCore::FreeBusy::Ptr &freebusy);
289 }
290 
291 //@cond PRIVATE
292 Q_DECLARE_TYPEINFO(KCalCore::FreeBusy::Ptr, Q_MOVABLE_TYPE);
293 Q_DECLARE_METATYPE(KCalCore::FreeBusy::Ptr)
294 //@endcond
295 
296 #endif
KCalCore::IncidenceBase::Ptr
QSharedPointer< IncidenceBase > Ptr
A shared pointer to an IncidenceBase.
Definition: incidencebase.h:115
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
KCalCore::IncidenceBase::DateTimeRole
DateTimeRole
The different types of incidence date/times roles.
Definition: incidencebase.h:133
KCalCore::Duration
Represents a span of time measured in seconds or days.
Definition: duration.h:56
KCalCore::FreeBusy
Provides information about the free/busy time of a calendar.
Definition: freebusy.h:53
KCalCore::FreeBusyPeriod::List
QVector< FreeBusyPeriod > List
List of periods.
Definition: freebusyperiod.h:52
KCalCore::operator>>
KCALCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalCore::Alarm::Ptr &)
Alarm deserializer.
Definition: alarm.cpp:863
KCalCore::Event::List
QVector< Ptr > List
List of events.
Definition: event.h:60
KCalCore::IncidenceBase
An abstract class that provides a common base for all calendar incidence classes.
Definition: incidencebase.h:110
KCalCore::FreeBusy::operator>>
friend KCALCORE_EXPORT QDataStream & operator>>(QDataStream &s, KCalCore::FreeBusy::Ptr &freebusy)
Initializes the freebusy object from the stream.
KCalCore::FreeBusy::Ptr
QSharedPointer< FreeBusy > Ptr
A shared pointer to a FreeBusy object.
Definition: freebusy.h:64
event.h
KCalCore::IncidenceBase::IncidenceType
IncidenceType
The different types of incidences, per RFC2445.
Definition: incidencebase.h:121
freebusyperiod.h
Represents a period of time.
incidencebase.h
KCalCore::FreeBusy::List
QVector< Ptr > List
List of FreeBusy objects.
Definition: freebusy.h:69
KCalCore
TODO: KDE5:
Definition: alarm.h:47
period.h
Represents a period of time.
KCalCore::operator<<
KCALCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalCore::Alarm::Ptr &)
Alarm serializer.
Definition: alarm.cpp:853
KCalCore::FreeBusy::operator<<
friend KCALCORE_EXPORT QDataStream & operator<<(QDataStream &s, const KCalCore::FreeBusy::Ptr &freebusy)
Serializes the freebusy object into the stream.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 28 2020 00:00:00 by doxygen 1.8.18 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