Changeset View
Changeset View
Standalone View
Standalone View
src/calendar/reminder.h
| Show All 24 Lines | |||||
| 25 | 25 | | |||
| 26 | #include "object.h" | 26 | #include "object.h" | ||
| 27 | #include "types.h" | 27 | #include "types.h" | ||
| 28 | #include "kgapicalendar_export.h" | 28 | #include "kgapicalendar_export.h" | ||
| 29 | 29 | | |||
| 30 | #include <KCalendarCore/Alarm> | 30 | #include <KCalendarCore/Alarm> | ||
| 31 | #include <KCalendarCore/Incidence> | 31 | #include <KCalendarCore/Incidence> | ||
| 32 | 32 | | |||
| 33 | #include <QScopedPointer> | ||||
| 34 | | ||||
| 33 | namespace KGAPI2 | 35 | namespace KGAPI2 | ||
| 34 | { | 36 | { | ||
| 35 | 37 | | |||
| 36 | /** | 38 | /** | ||
| 37 | * @brief Represents a default calendar reminder. | 39 | * @brief Represents a default calendar reminder. | ||
| 38 | * | 40 | * | ||
| 39 | * @author Daniel Vrátil <dvratil@redhat.com> | 41 | * @author Daniel Vrátil <dvratil@redhat.com> | ||
| 40 | * @since 0.4 | 42 | * @since 0.4 | ||
| 41 | */ | 43 | */ | ||
| 42 | class KGAPICALENDAR_EXPORT Reminder | 44 | class KGAPICALENDAR_EXPORT Reminder | ||
| 43 | { | 45 | { | ||
| 44 | public: | 46 | public: | ||
| 45 | 47 | | |||
| 46 | /** | 48 | /** | ||
| 47 | * @brief Constructor | 49 | * @brief Constructor | ||
| 48 | */ | 50 | */ | ||
| 49 | explicit Reminder(); | 51 | explicit Reminder(); | ||
| 50 | 52 | | |||
| 51 | /** | 53 | /** | ||
| 52 | * @brief Constructor | 54 | * @brief Constructor | ||
| 53 | * | 55 | * | ||
| 54 | * @param type Type of the reminder (email, notification, etc.) | 56 | * @param type Type of the reminder (email, notification, etc.) | ||
| 55 | * @param startOffset How long before the event should the reminder be shown | 57 | * @param startOffset How long before the event should the reminder be shown | ||
| 56 | */ | 58 | */ | ||
| 57 | explicit Reminder( const KCalendarCore::Alarm::Type &type, | 59 | explicit Reminder(const KCalendarCore::Alarm::Type &type, | ||
| 58 | const KCalendarCore::Duration &startOffset = KCalendarCore::Duration( 0 ) ); | 60 | const KCalendarCore::Duration &startOffset = KCalendarCore::Duration(0)); | ||
| 59 | 61 | | |||
| 60 | /** | 62 | /** | ||
| 61 | * @brief Copy constructor | 63 | * @brief Copy constructor | ||
| 62 | */ | 64 | */ | ||
| 63 | Reminder( const Reminder &other ); | 65 | Reminder(const Reminder &other); | ||
| 64 | 66 | | |||
| 65 | /** | 67 | /** | ||
| 66 | * @brief Destructor | 68 | * @brief Destructor | ||
| 67 | */ | 69 | */ | ||
| 68 | virtual ~Reminder(); | 70 | virtual ~Reminder(); | ||
| 69 | 71 | | |||
| 70 | bool operator==(const Reminder &other) const; | 72 | bool operator==(const Reminder &other) const; | ||
| 71 | 73 | | |||
| 72 | /** | 74 | /** | ||
| 73 | * @brief Returns type of the reminder | 75 | * @brief Returns type of the reminder | ||
| 74 | */ | 76 | */ | ||
| 75 | KCalendarCore::Alarm::Type type() const; | 77 | KCalendarCore::Alarm::Type type() const; | ||
| 76 | 78 | | |||
| 77 | /** | 79 | /** | ||
| 78 | * @brief Sets type of the reminder | 80 | * @brief Sets type of the reminder | ||
| 79 | * | 81 | * | ||
| 80 | * @param type | 82 | * @param type | ||
| 81 | */ | 83 | */ | ||
| 82 | void setType(KCalendarCore::Alarm::Type type ); | 84 | void setType(KCalendarCore::Alarm::Type type); | ||
| 83 | 85 | | |||
| 84 | /** | 86 | /** | ||
| 85 | * @brief Returns how long before the event should reminder be shown | 87 | * @brief Returns how long before the event should reminder be shown | ||
| 86 | */ | 88 | */ | ||
| 87 | KCalendarCore::Duration startOffset() const; | 89 | KCalendarCore::Duration startOffset() const; | ||
| 88 | 90 | | |||
| 89 | /** | 91 | /** | ||
| 90 | * @brief Sets how long before the event should reminder be shown | 92 | * @brief Sets how long before the event should reminder be shown | ||
| 91 | */ | 93 | */ | ||
| 92 | void setStartOffset( const KCalendarCore::Duration &startOffset ); | 94 | void setStartOffset(const KCalendarCore::Duration &startOffset); | ||
| 93 | 95 | | |||
| 94 | /** | 96 | /** | ||
| 95 | * @brief Converts the reminder to a KCalendarCore::Alarm | 97 | * @brief Converts the reminder to a KCalendarCore::Alarm | ||
| 96 | * | 98 | * | ||
| 97 | * @param incidence An incidence on which the reminder should be applied | 99 | * @param incidence An incidence on which the reminder should be applied | ||
| 98 | * @return Returns a new KCalendarCore::Alarm | 100 | * @return Returns a new KCalendarCore::Alarm | ||
| 99 | */ | 101 | */ | ||
| 100 | KCalendarCore::Alarm *toAlarm( KCalendarCore::Incidence *incidence ) const; | 102 | KCalendarCore::Alarm *toAlarm(KCalendarCore::Incidence *incidence) const; | ||
| 101 | 103 | | |||
| 102 | private: | 104 | private: | ||
| 103 | class Private; | 105 | class Private; | ||
| 104 | Private *const d; | 106 | QScopedPointer<Private> const d; | ||
| 105 | }; | 107 | }; | ||
| 106 | 108 | | |||
| 107 | } // namespace KGAPI2 | 109 | } // namespace KGAPI2 | ||
| 108 | 110 | | |||
| 109 | #endif // LIBKGAPI2_REMINDER_H | 111 | #endif // LIBKGAPI2_REMINDER_H | ||