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

KCalCore Library

  • sources
  • kde-4.12
  • kdepimlibs
  • 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 
43 namespace KCalCore {
44 
49 class KCALCORE_EXPORT Period
50 {
51 public:
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 
196 private:
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 
210 KCALCORE_EXPORT QDataStream &operator<<(QDataStream &stream, const KCalCore::Period &period);
211 
213 KCALCORE_EXPORT QDataStream &operator>>(QDataStream &stream, KCalCore::Period &period);
214 }
215 
220 KCALCORE_EXPORT uint qHash(const KCalCore::Period &key);
221 
222 //@cond PRIVATE
223 Q_DECLARE_METATYPE(KCalCore::Period)
224 //@endcond
225 
226 #endif
KCalCore::Duration
Represents a span of time measured in seconds or days.
Definition: duration.h:55
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:49
KCalCore::Period::List
QVector< Period > List
List of periods.
Definition: period.h:55
KCalCore::Duration::Type
Type
The unit of time used to define the duration.
Definition: duration.h:61
KCalCore::operator>>
KCALCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalCore::Alarm::Ptr &)
Alarm deserializer.
Definition: alarm.cpp:863
qHash
KCALCORE_EXPORT uint qHash(const KCalCore::Period &key)
Return a hash value for a Period argument.
Definition: period.cpp:169
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::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::operator<<
KCALCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalCore::Alarm::Ptr &)
Alarm serializer.
Definition: alarm.cpp:853
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:57 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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