From fff19d70649589b81a896e4deb032a7bd4bdca1e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 31 Mar 2015 18:54:04 -0500 Subject: add an Alarm class to represent ical valarm components; change the Appointment class to hold an arbitrary number of Alarms. --- include/datetime/appointment.h | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'include/datetime/appointment.h') diff --git a/include/datetime/appointment.h b/include/datetime/appointment.h index ab89c2f..337d9b8 100644 --- a/include/datetime/appointment.h +++ b/include/datetime/appointment.h @@ -21,14 +21,31 @@ #define INDICATOR_DATETIME_APPOINTMENT_H #include + +#include #include +#include +#include namespace unity { namespace indicator { namespace datetime { /** - * \brief Plain Old Data Structure that represents a calendar appointment. + * \brief Basic information required to raise a notification about some Appointment. + */ +struct Alarm +{ + std::string text; + std::string audio_url; + DateTime time; + std::chrono::seconds duration; + + bool operator== (const Alarm& that) const; +}; + +/** + * \brief An instance of an appointment; e.g. a calendar event or clock-app alarm * * @see Planner */ @@ -39,14 +56,15 @@ public: Type type = EVENT; bool is_ubuntu_alarm() const { return type == UBUNTU_ALARM; } + std::string uid; std::string color; std::string summary; - std::string url; - std::string uid; - std::string audio_url; + std::string activation_url; DateTime begin; DateTime end; + std::vector alarms; + bool operator== (const Appointment& that) const; }; -- cgit v1.2.3 From 62d68e6453c0ad69ff4d71099441a8151e9a9bea Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 5 Apr 2015 17:27:52 -0500 Subject: fix misuse of ECalComponentAlarmInstance's fields. --- include/datetime/appointment.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/datetime/appointment.h') diff --git a/include/datetime/appointment.h b/include/datetime/appointment.h index 337d9b8..e9c1bc2 100644 --- a/include/datetime/appointment.h +++ b/include/datetime/appointment.h @@ -39,7 +39,6 @@ struct Alarm std::string text; std::string audio_url; DateTime time; - std::chrono::seconds duration; bool operator== (const Alarm& that) const; }; -- cgit v1.2.3 From 38a39c03d5b44c825afe0d10f67cc0802dcf2573 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 5 Apr 2015 21:12:01 -0500 Subject: remove some new bits that turned out to be unneeded after all --- include/datetime/appointment.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/datetime/appointment.h') diff --git a/include/datetime/appointment.h b/include/datetime/appointment.h index e9c1bc2..e323c9c 100644 --- a/include/datetime/appointment.h +++ b/include/datetime/appointment.h @@ -22,9 +22,7 @@ #include -#include #include -#include #include namespace unity { -- cgit v1.2.3