diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-03-14 17:37:09 +0000 |
---|---|---|
committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-03-14 17:37:09 +0000 |
commit | 8c4067b5484a81e2bb9158266601e30262bfb119 (patch) | |
tree | 11903c9a14e26e3247e9ad4dc9444db686d32ffe /include/datetime/planner-range.h | |
parent | 9f3136ba1c79020c10e58fa53e87a84bcce7dc29 (diff) | |
parent | 462e8e6d8e46475ea3222056f65ff40823e9e0bf (diff) | |
download | ayatana-indicator-datetime-8c4067b5484a81e2bb9158266601e30262bfb119.tar.gz ayatana-indicator-datetime-8c4067b5484a81e2bb9158266601e30262bfb119.tar.bz2 ayatana-indicator-datetime-8c4067b5484a81e2bb9158266601e30262bfb119.zip |
Don't use EDS if we're in the greeter. Fixes: 1256130
Diffstat (limited to 'include/datetime/planner-range.h')
-rw-r--r-- | include/datetime/planner-range.h | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/include/datetime/planner-range.h b/include/datetime/planner-range.h index 5306cdc..25334a6 100644 --- a/include/datetime/planner-range.h +++ b/include/datetime/planner-range.h @@ -23,6 +23,7 @@ #include <datetime/planner.h> #include <datetime/date-time.h> +#include <datetime/engine.h> namespace unity { namespace indicator { @@ -36,25 +37,46 @@ namespace datetime { class RangePlanner: public Planner { public: - virtual ~RangePlanner(); - core::Property<std::pair<DateTime,DateTime>>& range(); + virtual ~RangePlanner() =default; + virtual core::Property<std::pair<DateTime,DateTime>>& range() =0; protected: - RangePlanner(); + RangePlanner() =default; +}; - void rebuild_soon(); - virtual void rebuild_now() =0; +/** + * \brief A #RangePlanner that uses an #Engine to generate appointments + * + * @see Planner + */ +class SimpleRangePlanner: public RangePlanner +{ +public: + SimpleRangePlanner(const std::shared_ptr<Engine>& engine, + const std::shared_ptr<Timezone>& timezone); + virtual ~SimpleRangePlanner(); + + core::Property<std::vector<Appointment>>& appointments(); + core::Property<std::pair<DateTime,DateTime>>& range(); private: + // rebuild scaffolding + void rebuild_soon(); + virtual void rebuild_now(); static gboolean rebuild_now_static(gpointer); guint m_rebuild_tag = 0; + + std::shared_ptr<Engine> m_engine; + std::shared_ptr<Timezone> m_timezone; core::Property<std::pair<DateTime,DateTime>> m_range; + core::Property<std::vector<Appointment>> m_appointments; // we've got a GSignal tag here, so disable copying - RangePlanner(const RangePlanner&) =delete; - RangePlanner& operator=(const RangePlanner&) =delete; + SimpleRangePlanner(const RangePlanner&) =delete; + SimpleRangePlanner& operator=(const RangePlanner&) =delete; }; + } // namespace datetime } // namespace indicator } // namespace unity |