• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 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 
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 { return other.operator<( *this ); }
106 
115  bool operator==( const Period &other ) const;
116 
123  bool operator!=( const Period &other ) const { return !operator==( other ); }
124 
130  Period &operator=( const Period &other );
131 
135  KDateTime start() const;
136 
140  KDateTime end() const;
141 
154  Duration duration() const;
155 
167  Duration duration( Duration::Type type ) const;
168 
173  bool hasDuration() const;
174 
189  void shiftTimes( const KDateTime::Spec &oldSpec,
190  const KDateTime::Spec &newSpec );
191 
192  private:
193  //@cond PRIVATE
194  class Private;
195  Private *const d;
196  //@endcond
197 
198  friend KCALCORE_EXPORT QDataStream &operator<<( QDataStream &stream,
199  const KCalCore::Period &period );
200 
201  friend KCALCORE_EXPORT QDataStream &operator>>( QDataStream &stream,
202  KCalCore::Period &period );
203 };
204 
206 KCALCORE_EXPORT QDataStream &operator<<( QDataStream &stream, const KCalCore::Period &period );
207 
209 KCALCORE_EXPORT QDataStream &operator>>( QDataStream &stream, KCalCore::Period &period );
210 }
211 
216 KCALCORE_EXPORT uint qHash( const KCalCore::Period &key );
217 
218 //@cond PRIVATE
219 Q_DECLARE_METATYPE( KCalCore::Period )
220 //@endcond
221 
222 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:24:52 by doxygen 1.8.3.1 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.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 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