Changeset View
Changeset View
Standalone View
Standalone View
src/duration.h
Show All 33 Lines | |||||
34 | #include "kcalcore_export.h" | 34 | #include "kcalcore_export.h" | ||
35 | 35 | | |||
36 | #include <QDataStream> | 36 | #include <QDataStream> | ||
37 | #include <QHash> | 37 | #include <QHash> | ||
38 | #include <QMetaType> | 38 | #include <QMetaType> | ||
39 | 39 | | |||
40 | class QDateTime; | 40 | class QDateTime; | ||
41 | 41 | | |||
42 | namespace KCalCore | 42 | namespace KCalendarCore | ||
43 | { | 43 | { | ||
44 | 44 | | |||
45 | /** | 45 | /** | ||
46 | @brief | 46 | @brief | ||
47 | Represents a span of time measured in seconds or days. | 47 | Represents a span of time measured in seconds or days. | ||
48 | 48 | | |||
49 | A duration is a span of time measured in seconds or days. Construction can | 49 | A duration is a span of time measured in seconds or days. Construction can | ||
50 | be done by specifying a stop and end time, or simply by specifying the number | 50 | be done by specifying a stop and end time, or simply by specifying the number | ||
▲ Show 20 Lines • Show All 267 Lines • ▼ Show 20 Line(s) | 59 | public: | |||
318 | Q_REQUIRED_RESULT bool isNull() const; | 318 | Q_REQUIRED_RESULT bool isNull() const; | ||
319 | 319 | | |||
320 | private: | 320 | private: | ||
321 | //@cond PRIVATE | 321 | //@cond PRIVATE | ||
322 | class Private; | 322 | class Private; | ||
323 | Private *const d; | 323 | Private *const d; | ||
324 | //@endcond | 324 | //@endcond | ||
325 | 325 | | |||
326 | friend KCALCORE_EXPORT QDataStream &operator<<(QDataStream &s, const KCalCore::Duration &); | 326 | friend KCALCORE_EXPORT QDataStream &operator<<(QDataStream &s, const KCalendarCore::Duration &); | ||
327 | friend KCALCORE_EXPORT QDataStream &operator>>(QDataStream &s, KCalCore::Duration &); | 327 | friend KCALCORE_EXPORT QDataStream &operator>>(QDataStream &s, KCalendarCore::Duration &); | ||
328 | }; | 328 | }; | ||
329 | 329 | | |||
330 | /** | 330 | /** | ||
331 | * Duration serializer. | 331 | * Duration serializer. | ||
332 | * | 332 | * | ||
333 | * @since 4.12 | 333 | * @since 4.12 | ||
334 | */ | 334 | */ | ||
335 | KCALCORE_EXPORT QDataStream &operator<<(QDataStream &out, const KCalCore::Duration &); | 335 | KCALCORE_EXPORT QDataStream &operator<<(QDataStream &out, const KCalendarCore::Duration &); | ||
336 | 336 | | |||
337 | /** | 337 | /** | ||
338 | * Duration deserializer. | 338 | * Duration deserializer. | ||
339 | * | 339 | * | ||
340 | * @since 4.12 | 340 | * @since 4.12 | ||
341 | */ | 341 | */ | ||
342 | KCALCORE_EXPORT QDataStream &operator>>(QDataStream &in, KCalCore::Duration &); | 342 | KCALCORE_EXPORT QDataStream &operator>>(QDataStream &in, KCalendarCore::Duration &); | ||
343 | 343 | | |||
344 | inline uint qHash(const Duration &duration, uint seed = 0) | 344 | inline uint qHash(const Duration &duration, uint seed = 0) | ||
345 | { | 345 | { | ||
346 | return qHash(qMakePair(duration.isDaily(), duration.asSeconds()), seed); | 346 | return qHash(qMakePair(duration.isDaily(), duration.asSeconds()), seed); | ||
347 | } | 347 | } | ||
348 | 348 | | |||
349 | } | 349 | } | ||
350 | 350 | | |||
351 | Q_DECLARE_METATYPE(KCalCore::Duration) | 351 | Q_DECLARE_METATYPE(KCalendarCore::Duration) | ||
352 | 352 | | |||
353 | #endif | 353 | #endif |