aboutsummaryrefslogtreecommitdiff
path: root/tests/planner-mock.h
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-03-09 21:08:47 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-03-09 21:08:47 -0500
commit3f4d409f21bbb1f79f149a5ee66dcddaa505ddb1 (patch)
treeab1f4ba4e7635b3ea2cb600cc8de9b3e52a6c9d1 /tests/planner-mock.h
parent375277fa6b2c8eaac2e2a824bd1e43bbd54b75e3 (diff)
downloadayatana-indicator-datetime-3f4d409f21bbb1f79f149a5ee66dcddaa505ddb1.tar.gz
ayatana-indicator-datetime-3f4d409f21bbb1f79f149a5ee66dcddaa505ddb1.tar.bz2
ayatana-indicator-datetime-3f4d409f21bbb1f79f149a5ee66dcddaa505ddb1.zip
decouple the planner's states; need three separate sets: upcoming-now (for alarms in the current time), upcoming-calendar (to show events coming from the selected calendar date), and calendar-month (all the appointments in the month displayed in the menu).
Diffstat (limited to 'tests/planner-mock.h')
-rw-r--r--tests/planner-mock.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/planner-mock.h b/tests/planner-mock.h
index 44d30c7..67e550c 100644
--- a/tests/planner-mock.h
+++ b/tests/planner-mock.h
@@ -20,12 +20,13 @@
#ifndef INDICATOR_DATETIME_PLANNER_MOCK_H
#define INDICATOR_DATETIME_PLANNER_MOCK_H
-#include <datetime/planner.h>
+#include <datetime/planner-range.h>
namespace unity {
namespace indicator {
namespace datetime {
+#if 0
/**
* \brief Planner which does nothing on its own.
* It requires its client must set its appointments property.
@@ -35,7 +36,31 @@ class MockPlanner: public Planner
public:
MockPlanner() =default;
virtual ~MockPlanner() =default;
+ core::Property<std::vector<Appointment>>& appointments() { return m_appointments; }
+
+private:
+ core::Property<std::vector<Appointment>> m_appointments;
+};
+#endif
+
+/**
+ * \brief #RangePlanner which does nothing on its own.
+ * Its controller must set its appointments property.
+ */
+class MockRangePlanner: public RangePlanner
+{
+public:
+ MockRangePlanner() =default;
+ ~MockRangePlanner() =default;
+ core::Property<std::vector<Appointment>>& appointments() { return m_appointments; }
+
+protected:
+ void rebuild_now(){}
+
+private:
+ core::Property<std::vector<Appointment>> m_appointments;
};
+
} // namespace datetime
} // namespace indicator