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

KCalCore Library

  • kcalcore
freebusyperiod.cpp
Go to the documentation of this file.
1/*
2 This file is part of the kcalcore library.
3
4 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (c) 2007 David Jarvie <software@astrojar.org.uk>
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*/
33#include "freebusyperiod.h"
34
35using namespace KCalCore;
36
37//@cond PRIVATE
38class KCalCore::FreeBusyPeriod::Private
39{
40public:
41 Private() {}
42
43 QString mSummary;
44 QString mLocation;
45};
46//@endcond
47
48FreeBusyPeriod::FreeBusyPeriod() : Period(), d(new KCalCore::FreeBusyPeriod::Private())
49{
50}
51
52FreeBusyPeriod::FreeBusyPeriod(const KDateTime &start, const KDateTime &end)
53 : Period(start, end), d(new KCalCore::FreeBusyPeriod::Private())
54{
55}
56
57FreeBusyPeriod::FreeBusyPeriod(const KDateTime &start, const Duration &duration)
58 : Period(start, duration), d(new KCalCore::FreeBusyPeriod::Private())
59{
60}
61
62FreeBusyPeriod::FreeBusyPeriod(const FreeBusyPeriod &period)
63 : Period(period), d(new KCalCore::FreeBusyPeriod::Private(*period.d))
64{
65}
66
67FreeBusyPeriod::FreeBusyPeriod(const Period &period)
68 : Period(period), d(new KCalCore::FreeBusyPeriod::Private())
69{
70}
71
72FreeBusyPeriod::~FreeBusyPeriod()
73{
74 delete d;
75}
76
77FreeBusyPeriod &FreeBusyPeriod::operator=(const FreeBusyPeriod &other)
78{
79 // check for self assignment
80 if (&other == this) {
81 return *this;
82 }
83
84 Period::operator=(other);
85 *d = *other.d;
86 return *this;
87}
88
89QString FreeBusyPeriod::summary() const
90{
91 return d->mSummary;
92}
93
94void FreeBusyPeriod::setSummary(const QString &summary)
95{
96 d->mSummary = summary;
97}
98
99QString FreeBusyPeriod::location() const
100{
101 return d->mLocation;
102}
103
104void FreeBusyPeriod::setLocation(const QString &location)
105{
106 d->mLocation = location;
107}
108
109QDataStream &KCalCore::operator<<(QDataStream &stream, const KCalCore::FreeBusyPeriod &period)
110{
111 KCalCore::Period periodParent = static_cast<KCalCore::Period>(period);
112 stream << periodParent;
113 stream << period.summary() << period.location();
114 return stream;
115}
116
117QDataStream &KCalCore::operator>>(QDataStream &stream, FreeBusyPeriod &period)
118{
119 KCalCore::Period periodParent;
120 QString summary, location;
121
122 stream >> periodParent >> summary >> location;
123
124 period = periodParent;
125 period.setLocation(location);
126 period.setSummary(summary);
127 return stream;
128}
129
KCalCore::Duration
Represents a span of time measured in seconds or days.
Definition duration.h:56
KCalCore::FreeBusyPeriod
The period can be defined by either a start time and an end time or by a start time and a duration.
Definition freebusyperiod.h:47
KCalCore::FreeBusyPeriod::FreeBusyPeriod
FreeBusyPeriod()
Constructs a period without a duration.
Definition freebusyperiod.cpp:48
KCalCore::FreeBusyPeriod::summary
QString summary() const
Returns the period summary.
Definition freebusyperiod.cpp:89
KCalCore::FreeBusyPeriod::setLocation
void setLocation(const QString &location)
Sets the period location.
Definition freebusyperiod.cpp:104
KCalCore::FreeBusyPeriod::operator=
FreeBusyPeriod & operator=(const FreeBusyPeriod &other)
Sets this period equal to the other one.
Definition freebusyperiod.cpp:77
KCalCore::FreeBusyPeriod::~FreeBusyPeriod
~FreeBusyPeriod()
Destroys a period.
Definition freebusyperiod.cpp:72
KCalCore::FreeBusyPeriod::setSummary
void setSummary(const QString &summary)
Sets the period summary.
Definition freebusyperiod.cpp:94
KCalCore::FreeBusyPeriod::location
QString location() const
Returns the period location.
Definition freebusyperiod.cpp:99
KCalCore::Period
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:50
KCalCore::Period::operator=
Period & operator=(const Period &other)
Sets this period equal to the other one.
Definition period.cpp:100
freebusyperiod.h
This file is part of the API for handling calendar data and defines the Period 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
qHash
static uint qHash(const KDateTime &dt)
Private class that helps to provide binary compatibility between releases.
Definition occurrenceiterator.cpp:157
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 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