2 * Copyright 2018-2019 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.1 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef _WAKEUP_SETTINGS_H_
18 #define _WAKEUP_SETTINGS_H_
24 typedef void (*input_language_changed_cb)(void* data);
26 namespace multiassistant
33 #define WAKEUP_SETTINGS_KEY_DEFAULT_ASSISTANT_APPID "db/multi-assistant/default_assistant_appid"
34 #define WAKEUP_SETTINGS_KEY_UI_PANEL_ENABLED "db/multi-assistant/ui_panel_enabled"
35 #define WAKEUP_SETTINGS_KEY_CONVERSATION_TIMEOUT "db/multi-assistant/conversation_timeout"
36 #define WAKEUP_SETTINGS_KEY_MULTIPLE_MODE "db/multi-assistant/multiple_mode"
37 #define WAKEUP_SETTINGS_KEY_ENABLED_ASSISTANTS "db/multi-assistant/enabled_assistants"
38 #define WAKEUP_SETTINGS_KEY_WAKEUP_POLICY_DELAY "db/multi-assistant/wakeup_policy_delay"
39 #define WAKEUP_SETTINGS_KEY_WAKEUP_POLICY_PRIORITY "db/multi-assistant/wakeup_policy_priority"
40 #define WAKEUP_SETTINGS_KEY_STREAMING_DURATION_MAX "db/multi-assistant/streaming_duration_max"
41 #define WAKEUP_SETTINGS_KEY_VOICE_INPUT_LANGUAGE "db/multi-assistant/voice_input_language"
43 class ISettingsEventObserver
46 virtual ~ISettingsEventObserver() = default;
47 virtual bool on_voice_input_language_changed(const char* language) = 0;
48 virtual bool on_assistant_enabled_info_changed(const char* appid, bool enabled) = 0;
49 virtual bool on_default_assistant_appid_changed(const char* appid) = 0;
56 virtual ~CWakeupSettings();
58 CWakeupSettings(const CWakeupSettings&) = delete;
59 CWakeupSettings& operator=(const CWakeupSettings&) = delete;
64 void subscribe(ISettingsEventObserver *observer);
65 void unsubscribe(ISettingsEventObserver *observer);
66 vector<ISettingsEventObserver*> get_observers();
68 string get_default_assistant_appid();
69 bool get_ui_panel_enabled();
70 float get_conversation_timeout();
71 bool get_multiple_mode();
72 vector<string> get_enabled_assistants();
73 float get_wakeup_policy_delay();
74 vector<string> get_wakeup_policy_priority();
75 float get_streaming_duration_max();
76 string get_current_language(void);
78 vector<ISettingsEventObserver*> mObservers;
80 string mDefaultAssistantAppid;
81 bool mUiPanelEnabled{true};
82 float mConversationTimeout{5.0};
83 bool mMultipleMode{false};
84 vector<string> mEnabledAssistants;
85 float mWakeupPolicyDelay{0.1};
86 vector<string> mWakeupPolicyPriority; // No priority by default
87 float mStreamingDurationMax{10.0};
88 string mVoiceInputLanguage;
94 #endif /* _WAKEUP_SETTINGS_H_ */