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

KCalCore Library

  • kcalcore
period.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
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
31#ifndef KCALCORE_PERIOD_H
32#define KCALCORE_PERIOD_H
33
34#include "kcalcore_export.h"
35#include "duration.h"
36
37#include <KDE/KDateTime>
38
39#include <QtCore/QDataStream>
40#include <QtCore/QMetaType>
41#include <QtCore/QVector>
42
43namespace KCalCore {
44
49class KCALCORE_EXPORT Period
50{
51public:
55 typedef QVector<Period> List;
56
60 Period();
61
68 Period(const KDateTime &start, const KDateTime &end);
69
76 Period(const KDateTime &start, const Duration &duration);
77
84 Period(const Period &period);
85
89 ~Period();
90
97 bool operator<(const Period &other) const;
98
105 bool operator>(const Period &other) const {
106 return other.operator<(*this);
107 }
108
117 bool operator==(const Period &other) const;
118
125 bool operator!=(const Period &other) const {
126 return !operator==(other);
127 }
128
134 Period &operator=(const Period &other);
135
139 KDateTime start() const;
140
144 KDateTime end() const;
145
158 Duration duration() const;
159
171 Duration duration(Duration::Type type) const;
172
177 bool hasDuration() const;
178
193 void shiftTimes(const KDateTime::Spec &oldSpec,
194 const KDateTime::Spec &newSpec);
195
196private:
197 //@cond PRIVATE
198 class Private;
199 Private *const d;
200 //@endcond
201
202 friend KCALCORE_EXPORT QDataStream &operator<<(QDataStream &stream,
203 const KCalCore::Period &period);
204
205 friend KCALCORE_EXPORT QDataStream &operator>>(QDataStream &stream,
206 KCalCore::Period &period);
207};
208
210KCALCORE_EXPORT QDataStream &operator<<(QDataStream &stream, const KCalCore::Period &period);
211
213KCALCORE_EXPORT QDataStream &operator>>(QDataStream &stream, KCalCore::Period &period);
214}
215
220KCALCORE_EXPORT uint qHash(const KCalCore::Period &key);
221
222//@cond PRIVATE
223Q_DECLARE_METATYPE(KCalCore::Period)
224//@endcond
225
226#endif
KCalCore::Duration
Represents a span of time measured in seconds or days.
Definition: duration.h:56
KCalCore::Duration::Type
Type
The unit of time used to define the duration.
Definition: duration.h:61
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>
bool operator>(const Period &other) const
Returns true if the start of this period is later than the start of the other one.
Definition: period.h:105
KCalCore::Period::operator<<
friend KCALCORE_EXPORT QDataStream & operator<<(QDataStream &stream, const KCalCore::Period &period)
Write period to the datastream stream, in binary format.
KCalCore::Period::List
QVector< Period > List
List of periods.
Definition: period.h:55
KCalCore::Period::operator>>
friend KCALCORE_EXPORT QDataStream & operator>>(QDataStream &stream, KCalCore::Period &period)
Read a Period object into period from stream, in binary format.
KCalCore::Period::operator!=
bool operator!=(const Period &other) const
Returns true if this period is not equal to the other one.
Definition: period.h:125
duration.h
This file is part of the API for handling calendar data and defines the Duration 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
KCALCORE_EXPORT uint qHash(const KCalCore::Period &key)
Return a hash value for a Period argument.
Definition: period.cpp:169
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 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