Changeset View
Changeset View
Standalone View
Standalone View
src/incidencebase.h
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | |||||
66 | #include <QSet> | 66 | #include <QSet> | ||
67 | #include <QUrl> | 67 | #include <QUrl> | ||
68 | #include <QDataStream> | 68 | #include <QDataStream> | ||
69 | 69 | | |||
70 | class QUrl; | 70 | class QUrl; | ||
71 | class QDate; | 71 | class QDate; | ||
72 | class QTimeZone; | 72 | class QTimeZone; | ||
73 | 73 | | |||
74 | namespace KCalCore { | 74 | namespace KCalendarCore { | ||
75 | /** List of dates */ | 75 | /** List of dates */ | ||
76 | typedef QList<QDate> DateList; | 76 | typedef QList<QDate> DateList; | ||
77 | 77 | | |||
78 | /** List of times */ | 78 | /** List of times */ | ||
79 | typedef QList<QDateTime> DateTimeList; | 79 | typedef QList<QDateTime> DateTimeList; | ||
80 | 80 | | |||
81 | class Event; | 81 | class Event; | ||
82 | class Todo; | 82 | class Todo; | ||
Show All 25 Lines | |||||
108 | */ | 108 | */ | ||
109 | class KCALCORE_EXPORT IncidenceBase : public CustomProperties | 109 | class KCALCORE_EXPORT IncidenceBase : public CustomProperties | ||
110 | { | 110 | { | ||
111 | Q_GADGET | 111 | Q_GADGET | ||
112 | Q_PROPERTY(QString uid READ uid WRITE setUid) | 112 | Q_PROPERTY(QString uid READ uid WRITE setUid) | ||
113 | Q_PROPERTY(QDateTime lastModified READ lastModified WRITE setLastModified) | 113 | Q_PROPERTY(QDateTime lastModified READ lastModified WRITE setLastModified) | ||
114 | Q_PROPERTY(QDateTime dtStart READ dtStart WRITE setDtStart) | 114 | Q_PROPERTY(QDateTime dtStart READ dtStart WRITE setDtStart) | ||
115 | Q_PROPERTY(bool allDay READ allDay WRITE setAllDay) | 115 | Q_PROPERTY(bool allDay READ allDay WRITE setAllDay) | ||
116 | Q_PROPERTY(KCalCore::Person organizer READ organizer WRITE setOrganizer) | 116 | Q_PROPERTY(KCalendarCore::Person organizer READ organizer WRITE setOrganizer) | ||
117 | Q_PROPERTY(QVariantList attendees READ attendeesVariant) | 117 | Q_PROPERTY(QVariantList attendees READ attendeesVariant) | ||
118 | 118 | | |||
119 | public: | 119 | public: | ||
120 | /** | 120 | /** | ||
121 | A shared pointer to an IncidenceBase. | 121 | A shared pointer to an IncidenceBase. | ||
122 | */ | 122 | */ | ||
123 | typedef QSharedPointer<IncidenceBase> Ptr; | 123 | typedef QSharedPointer<IncidenceBase> Ptr; | ||
124 | 124 | | |||
Show All 26 Lines | 141 | enum DateTimeRole { | |||
151 | RoleDisplayEnd, /**< Role used for display purposes, represents the end boundary | 151 | RoleDisplayEnd, /**< Role used for display purposes, represents the end boundary | ||
152 | if an incidence supports dtEnd */ | 152 | if an incidence supports dtEnd */ | ||
153 | RoleAlarm, /**< Role for determining the date/time of the first alarm. | 153 | RoleAlarm, /**< Role for determining the date/time of the first alarm. | ||
154 | Returns invalid time if the incidence doesn't have any alarm */ | 154 | Returns invalid time if the incidence doesn't have any alarm */ | ||
155 | RoleRecurrenceStart, /**< Role for determining the start of the recurrence. | 155 | RoleRecurrenceStart, /**< Role for determining the start of the recurrence. | ||
156 | Currently that's DTSTART for an event and DTDUE for a to-do. | 156 | Currently that's DTSTART for an event and DTDUE for a to-do. | ||
157 | (NOTE: If the incidence is a to-do, recurrence should be | 157 | (NOTE: If the incidence is a to-do, recurrence should be | ||
158 | calculated having DTSTART for a reference, not DT-DUE. | 158 | calculated having DTSTART for a reference, not DT-DUE. | ||
159 | This is one place KCalCore isn't compliant with RFC2445) */ | 159 | This is one place KCalendarCore isn't compliant with RFC2445) */ | ||
160 | RoleDisplayStart, /**< Role for display purposes, represents the start boundary of an | 160 | RoleDisplayStart, /**< Role for display purposes, represents the start boundary of an | ||
161 | incidence. To-dos return dtDue here, for historical reasons */ | 161 | incidence. To-dos return dtDue here, for historical reasons */ | ||
162 | RoleDnD /**< Role for determining new start and end dates after a DnD */ | 162 | RoleDnD /**< Role for determining new start and end dates after a DnD */ | ||
163 | }; | 163 | }; | ||
164 | 164 | | |||
165 | /** | 165 | /** | ||
166 | The different types of incidence fields. | 166 | The different types of incidence fields. | ||
167 | */ | 167 | */ | ||
▲ Show 20 Lines • Show All 472 Lines • ▼ Show 20 Line(s) | |||||
640 | /** | 640 | /** | ||
641 | Sets the date/time corresponding to the specified DateTimeRole. | 641 | Sets the date/time corresponding to the specified DateTimeRole. | ||
642 | @param dateTime is QDateTime value to set. | 642 | @param dateTime is QDateTime value to set. | ||
643 | @param role is a DateTimeRole. | 643 | @param role is a DateTimeRole. | ||
644 | */ | 644 | */ | ||
645 | virtual void setDateTime(const QDateTime &dateTime, DateTimeRole role) = 0; | 645 | virtual void setDateTime(const QDateTime &dateTime, DateTimeRole role) = 0; | ||
646 | 646 | | |||
647 | /** | 647 | /** | ||
648 | Returns the Akonadi specific sub MIME type of a KCalCore::IncidenceBase item, | 648 | Returns the Akonadi specific sub MIME type of a KCalendarCore::IncidenceBase item, | ||
649 | e.g. getting "application/x-vnd.akonadi.calendar.event" for a KCalCore::Event. | 649 | e.g. getting "application/x-vnd.akonadi.calendar.event" for a KCalendarCore::Event. | ||
650 | */ | 650 | */ | ||
651 | virtual QLatin1String mimeType() const = 0; | 651 | virtual QLatin1String mimeType() const = 0; | ||
652 | 652 | | |||
653 | /** | 653 | /** | ||
654 | Returns the incidence recurrenceId. | 654 | Returns the incidence recurrenceId. | ||
655 | @return incidences recurrenceId value | 655 | @return incidences recurrenceId value | ||
656 | @see setRecurrenceId(). | 656 | @see setRecurrenceId(). | ||
657 | */ | 657 | */ | ||
Show All 16 Lines | |||||
674 | 674 | | |||
675 | /** | 675 | /** | ||
676 | Resets dirty fields. | 676 | Resets dirty fields. | ||
677 | @see dirtyFields() | 677 | @see dirtyFields() | ||
678 | */ | 678 | */ | ||
679 | void resetDirtyFields(); | 679 | void resetDirtyFields(); | ||
680 | 680 | | |||
681 | /** | 681 | /** | ||
682 | * Constant that identifies KCalCore data in a binary stream. | 682 | * Constant that identifies KCalendarCore data in a binary stream. | ||
683 | * | 683 | * | ||
684 | * @since 4.12 | 684 | * @since 4.12 | ||
685 | */ | 685 | */ | ||
686 | Q_REQUIRED_RESULT static quint32 magicSerializationIdentifier(); | 686 | Q_REQUIRED_RESULT static quint32 magicSerializationIdentifier(); | ||
687 | 687 | | |||
688 | protected: | 688 | protected: | ||
689 | 689 | | |||
690 | /** | 690 | /** | ||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | |||||
755 | private: | 755 | private: | ||
756 | //@cond PRIVATE | 756 | //@cond PRIVATE | ||
757 | class Private; | 757 | class Private; | ||
758 | Private *const d; | 758 | Private *const d; | ||
759 | 759 | | |||
760 | Q_DECL_HIDDEN QVariantList attendeesVariant() const; | 760 | Q_DECL_HIDDEN QVariantList attendeesVariant() const; | ||
761 | //@endcond | 761 | //@endcond | ||
762 | 762 | | |||
763 | friend KCALCORE_EXPORT QDataStream &operator<<(QDataStream &stream, const KCalCore::IncidenceBase::Ptr &); | 763 | friend KCALCORE_EXPORT QDataStream &operator<<(QDataStream &stream, const KCalendarCore::IncidenceBase::Ptr &); | ||
764 | 764 | | |||
765 | friend KCALCORE_EXPORT QDataStream &operator>>(QDataStream &stream, KCalCore::IncidenceBase::Ptr &); | 765 | friend KCALCORE_EXPORT QDataStream &operator>>(QDataStream &stream, KCalendarCore::IncidenceBase::Ptr &); | ||
766 | }; | 766 | }; | ||
767 | 767 | | |||
768 | /** | 768 | /** | ||
769 | * Incidence serializer. | 769 | * Incidence serializer. | ||
770 | * | 770 | * | ||
771 | * @since 4.12 | 771 | * @since 4.12 | ||
772 | */ | 772 | */ | ||
773 | KCALCORE_EXPORT QDataStream &operator<<(QDataStream &out, const KCalCore::IncidenceBase::Ptr &); | 773 | KCALCORE_EXPORT QDataStream &operator<<(QDataStream &out, const KCalendarCore::IncidenceBase::Ptr &); | ||
774 | 774 | | |||
775 | /** | 775 | /** | ||
776 | * Incidence deserializer. | 776 | * Incidence deserializer. | ||
777 | * | 777 | * | ||
778 | * @since 4.12 | 778 | * @since 4.12 | ||
779 | */ | 779 | */ | ||
780 | KCALCORE_EXPORT QDataStream &operator>>(QDataStream &in, KCalCore::IncidenceBase::Ptr &); | 780 | KCALCORE_EXPORT QDataStream &operator>>(QDataStream &in, KCalendarCore::IncidenceBase::Ptr &); | ||
781 | } | 781 | } | ||
782 | 782 | | |||
783 | Q_DECLARE_METATYPE(KCalCore::IncidenceBase *) | 783 | Q_DECLARE_METATYPE(KCalendarCore::IncidenceBase *) | ||
784 | Q_DECLARE_METATYPE(KCalCore::IncidenceBase::Ptr) | 784 | Q_DECLARE_METATYPE(KCalendarCore::IncidenceBase::Ptr) | ||
785 | 785 | | |||
786 | #endif | 786 | #endif |