diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/datetime/settings-live.h | 1 | ||||
-rw-r--r-- | include/datetime/settings-shared.h | 1 | ||||
-rw-r--r-- | include/datetime/settings.h | 1 | ||||
-rw-r--r-- | include/notifications/dbus-shared.h | 4 | ||||
-rw-r--r-- | include/notifications/haptic.h | 60 |
5 files changed, 67 insertions, 0 deletions
diff --git a/include/datetime/settings-live.h b/include/datetime/settings-live.h index 4db2d40..4850e69 100644 --- a/include/datetime/settings-live.h +++ b/include/datetime/settings-live.h @@ -58,6 +58,7 @@ private: void update_alarm_sound(); void update_alarm_volume(); void update_alarm_duration(); + void update_alarm_haptic(); GSettings* m_settings; diff --git a/include/datetime/settings-shared.h b/include/datetime/settings-shared.h index 23d2e1c..a211821 100644 --- a/include/datetime/settings-shared.h +++ b/include/datetime/settings-shared.h @@ -48,5 +48,6 @@ TimeFormatMode; #define SETTINGS_ALARM_SOUND_S "alarm-default-sound" #define SETTINGS_ALARM_VOLUME_S "alarm-default-volume" #define SETTINGS_ALARM_DURATION_S "alarm-duration-minutes" +#define SETTINGS_ALARM_HAPTIC_S "alarm-haptic-feedback" #endif // INDICATOR_DATETIME_SETTINGS_SHARED diff --git a/include/datetime/settings.h b/include/datetime/settings.h index e5f885e..c6fe13b 100644 --- a/include/datetime/settings.h +++ b/include/datetime/settings.h @@ -57,6 +57,7 @@ public: core::Property<TimeFormatMode> time_format_mode; core::Property<std::string> timezone_name; core::Property<std::string> alarm_sound; + core::Property<std::string> alarm_haptic; core::Property<unsigned int> alarm_volume; core::Property<unsigned int> alarm_duration; }; diff --git a/include/notifications/dbus-shared.h b/include/notifications/dbus-shared.h index 7738cb7..af714e7 100644 --- a/include/notifications/dbus-shared.h +++ b/include/notifications/dbus-shared.h @@ -29,4 +29,8 @@ #define BUS_POWERD_PATH "/com/canonical/powerd" #define BUS_POWERD_INTERFACE "com.canonical.powerd" +#define BUS_HAPTIC_NAME "com.canonical.usensord" +#define BUS_HAPTIC_PATH "/com/canonical/usensord/haptic" +#define BUS_HAPTIC_INTERFACE "com.canonical.usensord.haptic" + #endif /* INDICATOR_NOTIFICATIONS_DBUS_SHARED_H */ diff --git a/include/notifications/haptic.h b/include/notifications/haptic.h new file mode 100644 index 0000000..bfb5679 --- /dev/null +++ b/include/notifications/haptic.h @@ -0,0 +1,60 @@ +/* + * Copyright 2014 Canonical Ltd. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + * + * Authors: + * Charles Kerr <charles.kerr@canonical.com> + */ + +#ifndef UNITY_INDICATOR_NOTIFICATIONS_HAPTIC_H +#define UNITY_INDICATOR_NOTIFICATIONS_HAPTIC_H + +#include <memory> + +namespace unity { +namespace indicator { +namespace notifications { + +/*** +**** +***/ + +/** + * Tries to emit haptic feedback to match the user-specified mode. + */ +class Haptic +{ +public: + enum Mode + { + MODE_PULSE + }; + + Haptic(const Mode& mode = MODE_PULSE); + ~Haptic(); + +private: + class Impl; + std::unique_ptr<Impl> impl; +}; + +/*** +**** +***/ + +} // namespace notifications +} // namespace indicator +} // namespace unity + +#endif // UNITY_INDICATOR_NOTIFICATIONS_HAPTIC_H |