diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/datetime/appointment.h | 1 | ||||
-rw-r--r-- | include/datetime/exporter.h | 27 | ||||
-rw-r--r-- | include/datetime/settings-live.h | 3 | ||||
-rw-r--r-- | include/datetime/settings-shared.h | 3 | ||||
-rw-r--r-- | include/datetime/settings.h | 3 | ||||
-rw-r--r-- | include/datetime/snap.h | 9 |
6 files changed, 26 insertions, 20 deletions
diff --git a/include/datetime/appointment.h b/include/datetime/appointment.h index 4778293..2e406a2 100644 --- a/include/datetime/appointment.h +++ b/include/datetime/appointment.h @@ -39,6 +39,7 @@ public: std::string summary; std::string url; std::string uid; + std::string audio_url; bool has_alarms = false; DateTime begin; DateTime end; diff --git a/include/datetime/exporter.h b/include/datetime/exporter.h index c228cc1..dd57263 100644 --- a/include/datetime/exporter.h +++ b/include/datetime/exporter.h @@ -22,11 +22,10 @@ #include <datetime/actions.h> #include <datetime/menu.h> +#include <datetime/settings.h> #include <core/signal.h> -#include <gio/gio.h> // GActionGroup - #include <memory> // std::shared_ptr #include <vector> @@ -40,31 +39,21 @@ namespace datetime { class Exporter { public: - Exporter() =default; + Exporter(const std::shared_ptr<Settings>&); ~Exporter(); - core::Signal<> name_lost; + core::Signal<>& name_lost(); void publish(const std::shared_ptr<Actions>& actions, const std::vector<std::shared_ptr<Menu>>& menus); private: - static void on_bus_acquired(GDBusConnection*, const gchar *name, gpointer gthis); - void on_bus_acquired(GDBusConnection*, const gchar *name); - - static void on_name_lost(GDBusConnection*, const gchar *name, gpointer gthis); - void on_name_lost(GDBusConnection*, const gchar *name); - - std::set<guint> m_exported_menu_ids; - guint m_own_id = 0; - guint m_exported_actions_id = 0; - GDBusConnection * m_dbus_connection = nullptr; - std::shared_ptr<Actions> m_actions; - std::vector<std::shared_ptr<Menu>> m_menus; + class Impl; + std::unique_ptr<Impl> p; - // we've got raw pointers and gsignal tags in here, so disable copying - Exporter(const Exporter&) =delete; - Exporter& operator=(const Exporter&) =delete; + // disable copying + Exporter(const Exporter&) =delete; + Exporter& operator=(const Exporter&) =delete; }; } // namespace datetime diff --git a/include/datetime/settings-live.h b/include/datetime/settings-live.h index 202c998..4db2d40 100644 --- a/include/datetime/settings-live.h +++ b/include/datetime/settings-live.h @@ -55,6 +55,9 @@ private: void update_show_year(); void update_time_format_mode(); void update_timezone_name(); + void update_alarm_sound(); + void update_alarm_volume(); + void update_alarm_duration(); GSettings* m_settings; diff --git a/include/datetime/settings-shared.h b/include/datetime/settings-shared.h index 17a8ef0..23d2e1c 100644 --- a/include/datetime/settings-shared.h +++ b/include/datetime/settings-shared.h @@ -45,5 +45,8 @@ TimeFormatMode; #define SETTINGS_SHOW_DETECTED_S "show-auto-detected-location" #define SETTINGS_LOCATIONS_S "locations" #define SETTINGS_TIMEZONE_NAME_S "timezone-name" +#define SETTINGS_ALARM_SOUND_S "alarm-default-sound" +#define SETTINGS_ALARM_VOLUME_S "alarm-default-volume" +#define SETTINGS_ALARM_DURATION_S "alarm-duration-minutes" #endif // INDICATOR_DATETIME_SETTINGS_SHARED diff --git a/include/datetime/settings.h b/include/datetime/settings.h index ce234d9..e5f885e 100644 --- a/include/datetime/settings.h +++ b/include/datetime/settings.h @@ -56,6 +56,9 @@ public: core::Property<bool> show_year; core::Property<TimeFormatMode> time_format_mode; core::Property<std::string> timezone_name; + core::Property<std::string> alarm_sound; + core::Property<unsigned int> alarm_volume; + core::Property<unsigned int> alarm_duration; }; } // namespace datetime diff --git a/include/datetime/snap.h b/include/datetime/snap.h index a493772..9b45b3f 100644 --- a/include/datetime/snap.h +++ b/include/datetime/snap.h @@ -21,6 +21,8 @@ #define INDICATOR_DATETIME_SNAP_H #include <datetime/appointment.h> +#include <datetime/clock.h> +#include <datetime/settings.h> #include <memory> #include <functional> @@ -35,13 +37,18 @@ namespace datetime { class Snap { public: - Snap(); + Snap(const std::shared_ptr<Clock>& clock, + const std::shared_ptr<const Settings>& settings); virtual ~Snap(); typedef std::function<void(const Appointment&)> appointment_func; void operator()(const Appointment& appointment, appointment_func show, appointment_func dismiss); + +private: + const std::shared_ptr<Clock> m_clock; + const std::shared_ptr<const Settings> m_settings; }; } // namespace datetime |