KCalCore Library
period.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00031 #ifndef KCALCORE_PERIOD_H
00032 #define KCALCORE_PERIOD_H
00033
00034 #include "kcalcore_export.h"
00035 #include "duration.h"
00036
00037 #include <KDE/KDateTime>
00038
00039 #include <QtCore/QDataStream>
00040 #include <QtCore/QMetaType>
00041 #include <QtCore/QVector>
00042
00043 namespace KCalCore {
00044
00049 class KCALCORE_EXPORT Period
00050 {
00051 public:
00055 typedef QVector<Period> List;
00056
00060 Period();
00061
00068 Period( const KDateTime &start, const KDateTime &end );
00069
00076 Period( const KDateTime &start, const Duration &duration );
00077
00084 Period( const Period &period );
00085
00089 ~Period();
00090
00097 bool operator<( const Period &other ) const;
00098
00105 bool operator>( const Period &other ) const { return other.operator<( *this ); }
00106
00115 bool operator==( const Period &other ) const;
00116
00123 bool operator!=( const Period &other ) const { return !operator==( other ); }
00124
00130 Period &operator=( const Period &other );
00131
00135 KDateTime start() const;
00136
00140 KDateTime end() const;
00141
00154 Duration duration() const;
00155
00167 Duration duration( Duration::Type type ) const;
00168
00173 bool hasDuration() const;
00174
00189 void shiftTimes( const KDateTime::Spec &oldSpec,
00190 const KDateTime::Spec &newSpec );
00191
00192 private:
00193
00194 class Private;
00195 Private *const d;
00196
00197
00198 friend KCALCORE_EXPORT QDataStream &operator<<( QDataStream &stream,
00199 const KCalCore::Period &period );
00200
00201 friend KCALCORE_EXPORT QDataStream &operator>>( QDataStream &stream,
00202 KCalCore::Period &period );
00203 };
00204
00206 KCALCORE_EXPORT QDataStream &operator<<( QDataStream &stream, const KCalCore::Period &period );
00207
00209 KCALCORE_EXPORT QDataStream &operator>>( QDataStream &stream, KCalCore::Period &period );
00210 }
00211
00216 KCALCORE_EXPORT uint qHash( const KCalCore::Period &key );
00217
00218
00219 Q_DECLARE_METATYPE( KCalCore::Period )
00220
00221
00222 #endif