aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-03-31 18:54:04 -0500
committerCharles Kerr <charles.kerr@canonical.com>2015-03-31 18:54:04 -0500
commitfff19d70649589b81a896e4deb032a7bd4bdca1e (patch)
tree3b1db77981d5561aaec31c308c69c6dbbf9ded68 /include
parent3c5eda144d9d83be1aef24afaa307999975ec617 (diff)
downloadayatana-indicator-datetime-fff19d70649589b81a896e4deb032a7bd4bdca1e.tar.gz
ayatana-indicator-datetime-fff19d70649589b81a896e4deb032a7bd4bdca1e.tar.bz2
ayatana-indicator-datetime-fff19d70649589b81a896e4deb032a7bd4bdca1e.zip
add an Alarm class to represent ical valarm components; change the Appointment class to hold an arbitrary number of Alarms.
Diffstat (limited to 'include')
-rw-r--r--include/datetime/appointment.h26
-rw-r--r--include/datetime/snap.h3
2 files changed, 24 insertions, 5 deletions
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 <datetime/date-time.h>
+
+#include <chrono>
#include <string>
+#include <utility>
+#include <vector>
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<Alarm> alarms;
+
bool operator== (const Appointment& that) const;
};
diff --git a/include/datetime/snap.h b/include/datetime/snap.h
index 572158d..cc091d3 100644
--- a/include/datetime/snap.h
+++ b/include/datetime/snap.h
@@ -42,8 +42,9 @@ public:
const std::shared_ptr<const Settings>& settings);
virtual ~Snap();
- typedef std::function<void(const Appointment&)> appointment_func;
+ typedef std::function<void(const Appointment&, const Alarm&)> appointment_func;
void operator()(const Appointment& appointment,
+ const Alarm& alarm,
appointment_func snooze,
appointment_func ok);