Remove unnecessary code 66/208966/3
authorOskar Chodowicz <o.chodowicz@samsung.com>
Mon, 1 Jul 2019 15:00:33 +0000 (17:00 +0200)
committerOskar Chodowicz <o.chodowicz@samsung.com>
Tue, 2 Jul 2019 07:58:08 +0000 (09:58 +0200)
Change-Id: I1f8b447eb7b074de052dbd06f0c59afd5c1b9045

40 files changed:
src/AccessoriesSwitchesPage.cpp [deleted file]
src/AccessoriesSwitchesPage.hpp [deleted file]
src/ActionPage.cpp [deleted file]
src/ActionPage.hpp [deleted file]
src/AddSwitchPage.cpp [deleted file]
src/AddSwitchPage.hpp [deleted file]
src/CameraSwitchesPage.cpp [deleted file]
src/CameraSwitchesPage.hpp [deleted file]
src/RemoveSwitchPage.cpp [deleted file]
src/RemoveSwitchPage.hpp [deleted file]
src/ScanningProperties.cpp [deleted file]
src/ScanningProperties.hpp [deleted file]
src/ScreenSwitchPage.cpp [deleted file]
src/ScreenSwitchPage.hpp [deleted file]
src/SetValuePage.cpp [deleted file]
src/SetValuePage.hpp [deleted file]
src/SwitchesPage.cpp [deleted file]
src/SwitchesPage.hpp [deleted file]
src/UniversalSwitchPage.cpp [deleted file]
src/UniversalSwitchPage.hpp [deleted file]
src/UniversalSwitchSettingsPage.cpp [deleted file]
src/UniversalSwitchSettingsPage.hpp [deleted file]
src/UpdateSwitchPage.cpp [deleted file]
src/UpdateSwitchPage.hpp [deleted file]
src/main.cpp
src/model/AccessibilityLauncherModel.cpp
src/model/SingleInteractionIntervalModel.cpp
src/model/TapDurationModel.cpp
src/model/UniversalSwitchSettingsPageModel.hpp
src/presenter/AccessibilityLauncherPagePresenter.cpp
src/presenter/AppContext.hpp
src/presenter/MainPagePresenter.cpp
src/presenter/UniversalSwitchPagePresenter.cpp
src/presenter/UniversalSwitchPagePresenter.hpp
src/presenter/UniversalSwitchSettingsPagePresenter.cpp
src/presenter/UniversalSwitchSettingsPagePresenter.hpp
src/setting-accessibility-universal-switch-dbus.cpp [deleted file]
src/setting-accessibility-universal-switch-dbus.h [deleted file]
src/setting-accessibility.h [deleted file]
src/utils/UniversalSwitchTypes.hpp

diff --git a/src/AccessoriesSwitchesPage.cpp b/src/AccessoriesSwitchesPage.cpp
deleted file mode 100644 (file)
index 7239325..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "AccessoriesSwitchesPage.hpp"
-
-#include "AccessibilitySettingLog.hpp"
-#include "Button.hpp"
-#include "Entry.hpp"
-#include "Layout.hpp"
-#include "NavigationContext.hpp"
-#include "Popup.hpp"
-#include "Singleton.hpp"
-
-AccessoriesSwitchesPage::AccessoriesSwitchesPage(NaviframeItem targetItem)
-       : context_(Singleton<AppContext>::instance()), targetItem_(targetItem)
-{
-       auto naviframe = Singleton<NavigationContext>::instance().getNaviframe();
-       auto layout = Widget::make<Layout>(naviframe, EDJ_ACCESSORY, GRP_ACCESSORY);
-       layout->setText(PRT_ACCESSORY_LABEL, "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_ACCESSORIES_DESC");
-
-       naviframe->pushBack("IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_ACCESSORIES_TITLE", layout, [this]() {
-               setting_accessibility_universal_switch_dbus_config_cancelCaptureSwitch(&context_.config);
-               switchId = {};
-       });
-
-       auto prevBtn = Widget::make<Button>(
-               naviframe, [naviframe]() { naviframe->popBack(); }, std::string{}, Button::BACK_BUTTON_ARROW_STYLE);
-       naviframe->setPartContent("prev_btn", prevBtn);
-
-       setting_accessibility_universal_switch_dbus_config_captureSwitch(
-               &context_.config, ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER, -1, captureSwitchCb, this);
-}
-
-void AccessoriesSwitchesPage::attachActionCallback(UniversalSwitchCb cb, void *cbData)
-{
-       accessories_switch_added_cb = cb;
-       accessories_switch_added_cb_data = cbData;
-}
-
-void AccessoriesSwitchesPage::captureSwitchCb(void *user_data, const std::string &switch_id)
-{
-       RETURN_IF(!user_data, "Input argument user_data is NULL");
-       RETURN_IF(switch_id.empty(), "Input argument switch_id is an empty string");
-
-       auto self = static_cast<AccessoriesSwitchesPage *>(user_data);
-
-       for (auto &it : self->context_.config.configuration_items) {
-               if (switch_id == it->switch_id) {
-                       self->alreadyMappedSwitchPopup();
-                       return;
-               }
-       }
-       self->switchId = switch_id;
-       self->newSwitchPopup();
-}
-
-void AccessoriesSwitchesPage::newSwitchPopup()
-{
-       auto popup = Widget::make<Popup>(Singleton<NavigationContext>::instance().getNaviframe(), "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH");
-       popup->setEextEventCallback(EEXT_CALLBACK_BACK, []() {});
-
-       auto layout = Widget::make<Layout>(popup, EDJ_ACCESSORY_POPUP, GRP_ACCESSORY_POPUP);
-       popup->setContent(layout);
-
-       auto entry = Widget::make<Entry>(layout);
-       entry->setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       entry->setPartText("guide", "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_NAME");
-       layout->setPartContent(PRT_ACCESSORY_POPUP_ENTRY, entry);
-
-       auto cancelBtnCb = [popup, this]() {
-               auto parent = popup->getParent();
-               parent->removeChild(popup);
-               setting_accessibility_universal_switch_dbus_config_captureSwitch(
-                       &context_.config, ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER, -1, captureSwitchCb, this);
-       };
-
-       auto cancelBtn = Widget::make<Button>(popup, cancelBtnCb, "IDS_ACCS_UNIVERSAL_SWITCH_CANCEL");
-       cancelBtn->setStyle("popup");
-       popup->setPartContent("button1", cancelBtn);
-
-       auto saveBtnCb = [popup, entry, this]() {
-               if ((switchName_ = entry->getEntryText()).empty()) {
-                       DEBUG("Empty switch name entry");
-                       return;
-               }
-
-               actionPage_ = std::make_unique<ActionPage>(targetItem_);
-               actionPage_->attachCallback(accessorySwitchActionCb, this);
-               elm_naviframe_item_pop_cb_set(
-                       elm_naviframe_top_item_get(Singleton<NavigationContext>::instance().getNaviframe()->getObject()), renewCaptureSwitchCb, this); // TODO
-
-               auto parent = popup->getParent();
-               parent->removeChild(popup);
-       };
-
-       auto saveBtn = Widget::make<Button>(popup, saveBtnCb, "IDS_ACCS_UNIVERSAL_SWITCH_SAVE");
-       saveBtn->setStyle("popup");
-       popup->setPartContent("button2", saveBtn);
-}
-
-void AccessoriesSwitchesPage::alreadyMappedSwitchPopup()
-{
-       auto popup = Widget::make<Popup>(Singleton<NavigationContext>::instance().getNaviframe(), "IDS_ACCS_UNIVERSAL_SWITCH_UNABLE_TO_ADD");
-       popup->setEextEventCallback(EEXT_CALLBACK_BACK, []() {});
-
-       auto okBtnCb = [popup, this]() {
-               setting_accessibility_universal_switch_dbus_config_captureSwitch(
-                       &context_.config, ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER, -1, captureSwitchCb, this);
-               auto parent = popup->getParent();
-               parent->removeChild(popup);
-       };
-
-       auto okBtn = Widget::make<Button>(popup, okBtnCb, "IDS_ACCS_UNIVERSAL_SWITCH_OK");
-       okBtn->setStyle("popup");
-       popup->setPartContent("button1", okBtn);
-
-       auto layout = Widget::make<Layout>(popup, EDJ_ACCESSORY_POPUP, GRP_ACCESSORY_POPUP);
-       layout->setPartText(PRT_ACCESSORY_POPUP_LABEL, "IDS_ACCS_UNIVERSAL_SWITCH_ALREADY_ADDED");
-       popup->setContent(layout);
-}
-
-void AccessoriesSwitchesPage::accessorySwitchActionCb(const std::string &action, void *user_data)
-{
-       auto self = static_cast<AccessoriesSwitchesPage *>(user_data);
-
-       if (self->accessories_switch_added_cb)
-               self->accessories_switch_added_cb(self->accessories_switch_added_cb_data,
-                       self->switchId.c_str(),
-                       action,
-                       self->switchName_.c_str());
-}
-
-Eina_Bool AccessoriesSwitchesPage::renewCaptureSwitchCb(void *data, Elm_Object_Item *it)
-{
-       RETURN_DEFAULT_IF(!data, "Input is empty");
-       auto self = static_cast<AccessoriesSwitchesPage *>(data);
-       setting_accessibility_universal_switch_dbus_config_captureSwitch(
-               &self->context_.config, ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER, -1, captureSwitchCb, self);
-
-       return EINA_TRUE;
-}
\ No newline at end of file
diff --git a/src/AccessoriesSwitchesPage.hpp b/src/AccessoriesSwitchesPage.hpp
deleted file mode 100644 (file)
index 6bc4efe..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ACCESSORIES_SWITCHES_PAGE_HPP
-#define ACCESSORIES_SWITCHES_PAGE_HPP
-
-#include "ActionPage.hpp"
-#include "AppContext.hpp"
-#include "setting-accessibility.h"
-
-#include <Elementary.h>
-
-/**
- * View allowing to configure switches provided by AccessoriesSwitchProvider.
- *
- * @param ad global context of application
- *
- * TODO:
- *  replace classical callbacks with lambda expressions
- */
-class AccessoriesSwitchesPage
-{
-       public:
-       AccessoriesSwitchesPage(NaviframeItem targetItem);
-       void attachActionCallback(UniversalSwitchCb cb, void *cbData);
-
-       private:
-       static void captureSwitchCb(void *user_data, const std::string &switch_id);
-       static void accessorySwitchActionCb(const std::string &action, void *user_data);
-       static Eina_Bool renewCaptureSwitchCb(void *data, Elm_Object_Item *it);
-       void alreadyMappedSwitchPopup(); // TODO rename
-       void newSwitchPopup();
-
-       AppContext &context_;
-       UniversalSwitchCb accessories_switch_added_cb;
-       void *accessories_switch_added_cb_data = nullptr;
-       std::string switchName_; // TODO remove when lambda expression would be added
-       std::unique_ptr<ActionPage> actionPage_;
-       NaviframeItem targetItem_;
-       std::string switchId;
-
-       const std::string EDJ_ACCESSORY = "edje/accessibility-smart-switch-accessory.edj";
-       const std::string PRT_ACCESSORY_LABEL = "accessory_label";
-       const std::string EDJ_ACCESSORY_POPUP = "edje/accessibility-smart-switch-accessory-popup.edj";
-       const std::string PRT_ACCESSORY_POPUP_ENTRY = "accessory_popup_entry";
-       const std::string GRP_ACCESSORY_POPUP = "accessory_popup";
-       const std::string GRP_ACCESSORY = "accessory";
-       const std::string PRT_ACCESSORY_POPUP_LABEL = "accessory_popup_label";
-};
-
-#endif
diff --git a/src/ActionPage.cpp b/src/ActionPage.cpp
deleted file mode 100644 (file)
index 4fa06fc..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ActionPage.hpp"
-
-#include "AccessibilitySettingLog.hpp"
-#include "Singleton.hpp"
-#include "setting-accessibility.h"
-
-#include <app.h>
-
-ActionPage::ActionPage(NaviframeItem targetItem)
-       : context_(Singleton<AppContext>::instance())
-{
-       setValuePage_ = std::make_unique<SetValuePage>(ValueEditorType::RADIOS, "IDS_ACCS_UNIVERSAL_SWITCH_SELECT_ACTION", targetItem);
-       setValuePage_->addRadioItemChangedCb([this](auto val) { this->actionChangedCb(val); });
-       for (auto i = 0u; i < context_.config.activity_types.size(); ++i)
-               setValuePage_->addRadioItem(context_.config.activity_types[i]->name, i, false);
-}
-
-void ActionPage::actionChangedCb(size_t item_id)
-{
-       if (item_id >= context_.config.activity_types.size()) {
-               DEBUG("Unknown item id");
-               return;
-       }
-
-       auto activity = context_.config.activity_types[item_id];
-       DEBUG("Selected activity type, id: %s, name: %s, description: %s",
-               activity->id.c_str(),
-               activity->name.c_str(),
-               activity->description.c_str());
-       if (actionCb_)
-               actionCb_(activity->id, actionCbData_);
-}
-
-void ActionPage::attachCallback(switch_action_cb cb, void *user_data)
-{
-       actionCb_ = cb;
-       actionCbData_ = user_data;
-}
diff --git a/src/ActionPage.hpp b/src/ActionPage.hpp
deleted file mode 100644 (file)
index 2adee7d..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ACTION_PAGE_HPP
-#define ACTION_PAGE_HPP
-
-#include "AppContext.hpp"
-#include "SetValuePage.hpp"
-
-#include <memory>
-
-/**
- * View allowing to select action and bind it to currently selected switch
- *
- * @param ad global context of application
- *
- * TODO:
- *  replace classical callbacks with lambda expressions
- */
-class ActionPage
-{
-       public:
-       using switch_action_cb = void (*)(const std::string &action, void *user_data); // TODO probably to remove
-       ActionPage(NaviframeItem targetItem = {});
-       void attachCallback(switch_action_cb cb, void *user_data);
-
-       private:
-       void actionChangedCb(size_t item_id);
-
-       AppContext &context_;
-       switch_action_cb actionCb_ = nullptr;
-       void *actionCbData_ = nullptr;
-       std::unique_ptr<SetValuePage> setValuePage_;
-};
-
-#endif
diff --git a/src/AddSwitchPage.cpp b/src/AddSwitchPage.cpp
deleted file mode 100644 (file)
index 1935013..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "AddSwitchPage.hpp"
-
-#include "Button.hpp"
-#include "Genlist.hpp"
-#include "NavigationContext.hpp"
-#include "Singleton.hpp"
-#include "setting-accessibility.h"
-
-#include <app.h>
-
-AddSwitchPage::AddSwitchPage()
-       : context_(Singleton<AppContext>::instance())
-{
-       auto naviframe = Singleton<NavigationContext>::instance().getNaviframe();
-       auto genlist = Widget::make<Genlist>(naviframe);
-       genlist->setMode(ELM_LIST_COMPRESS);
-       genlist->setStyle("dialogue");
-       genlist->clear(); // TODO check if necessary
-
-       for (auto &it : context_.config.switch_providers) {
-               auto item = genlist->appendItem({"multiline", it->info->name, it->info->description, [=](auto item) {
-                                                                                        auto providerId = *static_cast<std::string *>(&it->info->id);
-                                                                                        this->showSwitchesPage(providerId);
-                                                                                }});
-
-               DEBUG("provider_id %s", it->info->id.c_str());
-
-               this->disableSwitchProviderWhenAllSwitchesConfigured(it, item);
-       }
-
-       auto prevBtn = Widget::make<Button>(
-               naviframe, [naviframe]() { naviframe->popBack(); }, std::string{}, Button::BACK_BUTTON_ARROW_STYLE);
-
-       previousTopItem_ = naviframe->top();
-       naviframe->pushBack("IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH", genlist, {}, prevBtn);
-}
-
-void AddSwitchPage::attachCallbackOnSwitchAttach(UniversalSwitchCb cb, void *cbData)
-{
-       switch_added_cb = cb;
-       switch_added_cb_data = cbData;
-}
-
-void AddSwitchPage::disableSwitchProviderWhenAllSwitchesConfigured(
-       UniversalSwitchSwitchProvider *switchProvider,
-       GenlistItem *switchProviderView)
-{
-       auto allSwitches = setting_accessibility_universal_switch_dbus_config_get_switches(
-               &context_.config, switchProvider->info->id);
-       if (areAllSwitchesConfigured(context_.config.configuration_items, allSwitches))
-               switchProviderView->disable();
-}
-
-bool AddSwitchPage::areAllSwitchesConfigured(const std::vector<UniversalSwitchConfigurationItem *> &switchConfigurationItems,
-       const std::vector<UniversalSwitchInfoType *> &switchAllItems)
-{
-       auto findConfigurationItemBySwitch = [&](UniversalSwitchInfoType *switchItem) {
-               for (auto &configured : switchConfigurationItems) {
-                       if (switchItem->id == configured->switch_id)
-                               return true;
-               }
-               return false;
-       };
-       for (auto &aSwitch : switchAllItems) {
-               if (!findConfigurationItemBySwitch(aSwitch))
-                       return false;
-       }
-       return true;
-}
-
-void AddSwitchPage::showSwitchesPage(const std::string &providerId)
-{
-       DEBUG("Create add switch page for %s", providerId.c_str());
-
-       if (providerId == ACCESSIBILITY_UNIVERSAL_SWITCH_SCREEN_SWITCH_PROVIDER) {
-               screenSwitchPage_ = std::make_unique<ScreenSwitchPage>(previousTopItem_);
-               screenSwitchPage_->attachActionCallback(switch_added_cb, switch_added_cb_data);
-       } else if (providerId == ACCESSIBILITY_UNIVERSAL_SWITCH_CAMERA_SWITCH_PROVIDER) {
-               cameraSwitchesPage_ = std::make_unique<CameraSwitchesPage>(previousTopItem_);
-               cameraSwitchesPage_->attachActionCallback(switch_added_cb, switch_added_cb_data);
-       } else if (providerId == ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER) {
-               accessoriesSwitchesPage_ = std::make_unique<AccessoriesSwitchesPage>(previousTopItem_);
-               accessoriesSwitchesPage_->attachActionCallback(switch_added_cb, switch_added_cb_data);
-       } else {
-               ERROR("Unknown provider: %s", providerId.c_str());
-       }
-}
diff --git a/src/AddSwitchPage.hpp b/src/AddSwitchPage.hpp
deleted file mode 100644 (file)
index 05367ad..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ADD_SWITCH_PAGE_HPP
-#define ADD_SWITCH_PAGE_HPP
-
-#include "AccessibilitySettingLog.hpp"
-#include "AccessoriesSwitchesPage.hpp"
-#include "AppContext.hpp"
-#include "CameraSwitchesPage.hpp"
-#include "ScreenSwitchPage.hpp"
-
-#include <Elementary.h>
-
-/**
- * View that supports searching of switches by narrowing search space to particular SwitchProvider
- *
- * @param ad global context of application
- *
- * TODO:
- *  replace classical callbacks with lambda expressions
- */
-class AddSwitchPage
-{
-       public:
-       AddSwitchPage();
-       void attachCallbackOnSwitchAttach(UniversalSwitchCb cb, void *cbData); // TODO: rename
-
-       private:
-       void disableSwitchProviderWhenAllSwitchesConfigured(
-               UniversalSwitchSwitchProvider *switchProvider, GenlistItem *switchProviderView);
-       bool areAllSwitchesConfigured(const std::vector<UniversalSwitchConfigurationItem *> &switchConfigurationItems,
-               const std::vector<UniversalSwitchInfoType *> &switchAllItems);
-       void showSwitchesPage(const std::string &providerId);
-
-       AppContext &context_;
-       std::unique_ptr<ScreenSwitchPage> screenSwitchPage_;
-       std::unique_ptr<CameraSwitchesPage> cameraSwitchesPage_;
-       std::unique_ptr<AccessoriesSwitchesPage> accessoriesSwitchesPage_;
-       NaviframeItem previousTopItem_;
-
-       UniversalSwitchCb switch_added_cb = nullptr;
-       void *switch_added_cb_data = nullptr;
-};
-
-#endif
diff --git a/src/CameraSwitchesPage.cpp b/src/CameraSwitchesPage.cpp
deleted file mode 100644 (file)
index 447acf4..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "CameraSwitchesPage.hpp"
-
-#include "AccessibilitySettingLog.hpp"
-#include "Button.hpp"
-#include "Genlist.hpp"
-#include "NavigationContext.hpp"
-#include "Singleton.hpp"
-#include "setting-accessibility.h"
-
-#include <app.h>
-
-CameraSwitchesPage::CameraSwitchesPage(NaviframeItem targetItem)
-       : context_(Singleton<AppContext>::instance()), targetItem_(targetItem)
-{
-       auto naviframe = Singleton<NavigationContext>::instance().getNaviframe();
-       auto genlist = Widget::make<Genlist>(naviframe);
-       genlist->setMode(ELM_LIST_COMPRESS);
-       genlist->setStyle("dialogue");
-       genlist->clear(); // TODO check if necessary
-
-       genlist->appendItem({"multiline", {}, "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_CAMERA_COMMENT", GenlistItem::Type::regular});
-       genlist->appendItem({"group_index", "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_CAMERA_GROUP_HEAD"});
-
-       auto switches = setting_accessibility_universal_switch_dbus_config_get_switches(
-               &context_.config, ACCESSIBILITY_UNIVERSAL_SWITCH_CAMERA_SWITCH_PROVIDER);
-       for (auto &it : switches) {
-               auto item = genlist->appendItem({"multiline", it->name, it->description, [=](auto item) {
-                                                                                        this->chosenSwitch_ = it;
-                                                                                        DEBUG("Camera switch, id: %s, name: %s",
-                                                                                                this->chosenSwitch_->id.c_str(),
-                                                                                                this->chosenSwitch_->name.c_str());
-                                                                                        this->actionPage_ = std::make_unique<ActionPage>(this->targetItem_);
-                                                                                        this->actionPage_->attachCallback(switchActionCb, this);
-                                                                                }});
-
-               for (auto &it2 : context_.config.configuration_items) {
-                       if (it->id == it2->switch_id)
-                               item->disable();
-               }
-       }
-
-       auto prevBtn = Widget::make<Button>(
-               naviframe, [naviframe]() { naviframe->popBack(); }, std::string{}, Button::BACK_BUTTON_ARROW_STYLE);
-       naviframe->pushBack("IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_CAMERA_TITLE", genlist, {}, prevBtn);
-}
-
-void CameraSwitchesPage::attachActionCallback(UniversalSwitchCb cb, void *cbData)
-{
-       camera_switch_added_cb = cb;
-       camera_switch_added_cb_data = cbData;
-}
-
-void CameraSwitchesPage::switchActionCb(const std::string &action, void *user_data)
-{
-       RETURN_IF(!user_data, "User data parameter is NULL");
-       auto self = static_cast<CameraSwitchesPage *>(user_data);
-
-       if (self->camera_switch_added_cb)
-               self->camera_switch_added_cb(
-                       self->camera_switch_added_cb_data, self->chosenSwitch_->id, action, self->chosenSwitch_->name);
-       self->chosenSwitch_ = nullptr;
-}
diff --git a/src/CameraSwitchesPage.hpp b/src/CameraSwitchesPage.hpp
deleted file mode 100644 (file)
index 8fd340f..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef CAMERA_SWITCHES_PAGE
-#define CAMERA_SWITCHES_PAGE
-
-#include "ActionPage.hpp"
-#include "AppContext.hpp"
-
-/**
- * View allowing to configure switches provided by CameraSwitchProvider.
- *
- * @param ad global context of application
- *
- * TODO:
- *  replace classical callbacks with lambda expressions
- */
-class CameraSwitchesPage
-{
-       public:
-       CameraSwitchesPage(NaviframeItem targetItem);
-       void attachActionCallback(UniversalSwitchCb cb, void *cbData);
-
-       private:
-       static void switchActionCb(const std::string &action, void *user_data);
-
-       AppContext &context_;
-       UniversalSwitchCb camera_switch_added_cb = nullptr;
-       void *camera_switch_added_cb_data = nullptr;
-       UniversalSwitchInfoType *chosenSwitch_ = nullptr;
-       std::unique_ptr<ActionPage> actionPage_;
-       NaviframeItem targetItem_;
-};
-
-#endif
diff --git a/src/RemoveSwitchPage.cpp b/src/RemoveSwitchPage.cpp
deleted file mode 100644 (file)
index 30bccf5..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "RemoveSwitchPage.hpp"
-
-#include "AccessibilitySettingLog.hpp"
-#include "Button.hpp"
-#include "Genlist.hpp"
-#include "NavigationContext.hpp"
-#include "Popup.hpp"
-#include "Singleton.hpp"
-#include "VConf.hpp"
-#include "setting-accessibility.h"
-
-#include <app.h>
-#include <efl_extension.h>
-
-#define SWITCH_COUNTER_MAX 99
-#define SWITCH_COUNTER_TITLE_LENGTH 4
-
-RemoveSwitchPage::RemoveSwitchPage()
-       : context_(Singleton<AppContext>::instance())
-{
-       auto naviframe = Singleton<NavigationContext>::instance().getNaviframe();
-       layout_ = Widget::make<Layout>(naviframe, "edje/accessibility-settings-set-value.edj", "set-value-switches");
-       genlist_ = Widget::make<Genlist>(layout_);
-       genlist_->setMode(ELM_LIST_COMPRESS);
-       genlist_->setStyle("dialogue");
-       layout_->setPartContent("set-value-list", genlist_);
-
-       allCheckbox_ = Widget::make<Check>(naviframe, false, std::string{}, [this]() {
-               auto genlist_size = genlist_->size();
-               bool all_selected = (switchesToRemoveCounter_ == genlist_size);
-
-               auto item = genlist_->getFirst();
-               while (item) {
-                       item->setState(!all_selected);
-                       item = item->next();
-               }
-
-               switchesToRemoveCounter_ = all_selected ? 0 : genlist_size;
-               removeSwitchPopupBtn_->disable(switchesToRemoveCounter_ ? false : true);
-       });
-
-       removeSwitchPopupBtn_ = Widget::make<Button>(
-               naviframe, [this]() { createPopupForSwitchesRemoving(); }, "IDS_ACCS_DELETE_CAPS", "naviframe/title_right");
-       removeSwitchPopupBtn_->disable(true);
-
-       naviframe->pushBack("IDS_ACCS_SELECT_ITEMS", layout_, {}, allCheckbox_);
-       naviframe->setPartContent("title_right_btn", removeSwitchPopupBtn_);
-
-       for (auto i = 0u; i < context_.config.configuration_items.size(); ++i) {
-               auto activity_name = setting_accessibility_universal_switch_dbus_config_get_activity_name(
-                       &context_.config, context_.config.configuration_items[i]->activity_type);
-               genlist_->appendItem({"type1",
-                       context_.config.configuration_items[i]->user_name,
-                       activity_name,
-                       [this](auto item) {
-                               if (item->getState())
-                                       switchesToRemoveCounter_++;
-                               else
-                                       switchesToRemoveCounter_--;
-
-                               auto state = switchesToRemoveCounter_ == genlist_->size();
-                               allCheckbox_->setState(state);
-
-                               removeSwitchPopupBtn_->disable(switchesToRemoveCounter_ ? false : true);
-                       },
-                       GenlistItem::WidgetType::check});
-       }
-}
-
-void RemoveSwitchPage::attachCallback(UniversalSwitchCb cb, void *cbData)
-{
-       switch_removed_cb = cb;
-       switch_removed_cb_data = cbData;
-}
-
-void RemoveSwitchPage::createPopupForSwitchesRemoving()
-{
-       auto popup = Widget::make<Popup>(Singleton<NavigationContext>::instance().getNaviframe(), "IDS_ACCS_UNIVERSAL_SWITCH_DELETE_SWITCHES");
-
-       popup->setOrientation(ELM_POPUP_ORIENT_CENTER);
-       auto areAllSwitchesSelectedToRemove = switchesToRemoveCounter_ == genlist_->size();
-
-       if (Singleton<VConfInterface>::instance().get(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_INTERACTION_SERVICE, false) &&
-               areAllSwitchesSelectedToRemove) {
-               popup->setText("IDS_ACCS_UNIVERSAL_SWITCH_DELETE_ALL_SWITCHES_DESC");
-       } else {
-               auto s = std::to_string(switchesToRemoveCounter_) + " " +
-                                TranslatedString{"IDS_ACCS_UNIVERSAL_SWITCH_DELETE_SWITCHES_DESC"}.str();
-               popup->setText(s);
-       }
-       auto removeCb = [p = popup, nf = Singleton<NavigationContext>::instance().getNaviframe()]() { nf->removeChild(p); };
-       popup->setEextEventCallback(EEXT_CALLBACK_BACK, removeCb);
-       popup->setEvasSmartCallback("dismissed", removeCb);
-       popup->setEvasSmartCallback("block,clicked", removeCb);
-
-       auto cancelBtn = Widget::make<Button>(popup, removeCb, "IDS_ST_BUTTON_CANCEL", "bottom");
-       popup->setPartContent("button1", cancelBtn);
-
-       auto removeSwitchCb = [removeCb, areAllSwitchesSelectedToRemove, this]() {
-               auto item = genlist_->getLast();
-               size_t i = genlist_->size() - 1;
-               while (item) {
-                       if (item->getState())
-                               removeSwitch(i);
-
-                       item = item->prev();
-                       --i;
-               }
-
-               removeCb();
-               Singleton<NavigationContext>::instance().getNaviframe()->removeChild(removeSwitchPopupBtn_);
-               Singleton<NavigationContext>::instance().getNaviframe()->popBack();
-
-               if (areAllSwitchesSelectedToRemove)
-                       Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_INTERACTION_SERVICE, false);
-       };
-
-       auto deleteSwitchBtn = Widget::make<Button>(popup, removeSwitchCb, "IDS_ACCS_DELETE", "bottom");
-       popup->setPartContent("button2", deleteSwitchBtn);
-}
-
-void RemoveSwitchPage::removeSwitch(size_t item_id)
-{
-       if (item_id >= context_.config.configuration_items.size()) {
-               WARNING("Wrong item id");
-               return;
-       }
-
-       auto config_item = context_.config.configuration_items[item_id];
-       DEBUG("Removing switch, switch_id: %s", config_item->switch_id.c_str());
-
-       switch_removed_cb(switch_removed_cb_data,
-               config_item->switch_id,
-               config_item->activity_type,
-               config_item->user_name); // TODO try to do this without callback
-}
diff --git a/src/RemoveSwitchPage.hpp b/src/RemoveSwitchPage.hpp
deleted file mode 100644 (file)
index 217dab5..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef REMOVE_SWITCH_PAGE_HPP
-#define REMOVE_SWITCH_PAGE_HPP
-
-#include "AppContext.hpp"
-#include "Button.hpp"
-#include "Check.hpp"
-#include "Popup.hpp"
-#include "SetValuePage.hpp"
-
-/**
- * View allowing to remove existing configurations of switches.
- *
- * Removal of multiple switch configurations is supported.
- *
- * @param ad global context of application
- *
- * TODO:
- *  replace classical callbacks with lambda expressions
- */
-class RemoveSwitchPage
-{
-       public:
-       RemoveSwitchPage();
-       void attachCallback(UniversalSwitchCb cb, void *cbData);
-
-       private:
-       void createPopupForSwitchesRemoving();
-       static void onRemoveSelectedSwitches(void *data, Evas_Object *obj, void *event_info);
-       static void onRemovePopup(void *data, Evas_Object *obj, void *event_info);
-       void removeSwitch(size_t item_id);
-
-       AppContext &context_;
-       std::unique_ptr<SetValuePage> setValuePage_;
-       UniversalSwitchCb switch_removed_cb;
-       void *switch_removed_cb_data = nullptr;
-       Button *removeSwitchPopupBtn_ = nullptr;
-       Check *allCheckbox_ = nullptr;
-       Layout *layout_ = nullptr;
-       Genlist *genlist_ = nullptr;
-       size_t switchesToRemoveCounter_ = 0;
-};
-
-#endif
diff --git a/src/ScanningProperties.cpp b/src/ScanningProperties.cpp
deleted file mode 100644 (file)
index 742e122..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-#include "ScanningProperties.hpp"
-
-#include "Singleton.hpp"
-
-#include <utility>
-
-#define VCONF_MEMORY_TYPE "db/"
-#define VCONF_PROJECT_NAME "setting/accessibility/universal-switch/"
-#define VCONF_PROJECT_PREFIX VCONF_MEMORY_TYPE VCONF_PROJECT_NAME
-
-#define VCONFKEY_AUTO_SCAN_ENABLED VCONF_PROJECT_PREFIX "AUTO_SCAN_ENABLED"
-#define VCONFKEY_AUTO_SCAN_INT VCONF_PROJECT_PREFIX "AUTO_SCAN_INTERVAL"
-#define VCONFKEY_NUM_OF_SCANS VCONF_PROJECT_PREFIX "LOOP_LIMIT_TO_INACTION"
-#define VCONFKEY_SCAN_METHOD VCONF_PROJECT_PREFIX "SCAN_METHOD"
-#define VCONFKEY_SCAN_DIR_VERTICAL VCONF_PROJECT_PREFIX "SCAN_DIRECTION_VERTICAL"
-#define VCONFKEY_SCAN_DIR_HORIZONTA VCONF_PROJECT_PREFIX "SCAN_DIRECTION_HORIZONTAL"
-#define VCONFKEY_SCAN_PT_SPEED VCONF_PROJECT_PREFIX "SCAN_PT_SPEED"
-#define VCONFKEY_PAUSE_ON_FIRST_STATE VCONF_PROJECT_PREFIX "PAUSE_ON_FIRST_ELEMENT_ENABLED"
-#define VCONFKEY_PAUSE_ON_FIRST_VALUE VCONF_PROJECT_PREFIX "PAUSE_ON_FIRST_ELEMENT_TIME"
-#define VCONFKEY_TAP_DURATION_STATE VCONF_PROJECT_PREFIX "TAP_DURATION_ENABLED"
-#define VCONFKEY_TAP_DURATION_VALUE VCONF_PROJECT_PREFIX "TAP_DURATION_VALUE"
-#define VCONFKEY_SGL_IACTION_INT_STATE VCONF_PROJECT_PREFIX "SGL_INACTION_INT_ENABLED"
-#define VCONFKEY_SGL_IACTION_INT_VALUE VCONF_PROJECT_PREFIX "SGL_INACTION_INT_VALUE"
-#define VCONFKEY_AUTO_TAP_STATE VCONF_PROJECT_PREFIX "AUTO_TAP_ENABLED"
-#define VCONFKEY_AUTO_TAP_VALUE VCONF_PROJECT_PREFIX "AUTO_TAP_WAITING_TIME"
-#define VCONFKEY_AUTO_MOVE_INT_STATE VCONF_PROJECT_PREFIX "AUTO_MOVE_INT_ENABLED"
-#define VCONFKEY_AUTO_MOVE_INT_VALUE VCONF_PROJECT_PREFIX "AUTO_MOVE_INT_VALUE"
-#define VCONFKEY_AUTO_TAP_KBD_STATE VCONF_PROJECT_PREFIX "AUTO_TAP_KBD_ENABLED"
-#define VCONFKEY_FEEDBACK_CURSOR_COLOR VCONF_PROJECT_PREFIX "FEEDBACK_CURSOR_COLOR"
-#define VCONFKEY_FEEDBACK_SOUND_STATE VCONF_PROJECT_PREFIX "FEEDBACK_SOUND_ENABLED"
-#define VCONFKEY_FEEDBACK_SOUND_VOLUME VCONF_PROJECT_PREFIX "FEEDBACK_SOUND_VOLUME"
-#define VCONFKEY_FEEDBACK_VOICE_STATE VCONF_PROJECT_PREFIX "FEEDBACK_VOICE_ENABLED"
-#define VCONFKEY_FEEDBACK_VOICE_SPEECH_RATE VCONF_PROJECT_PREFIX "FEEDBACK_VOICE_SPEECH_RATE"
-#define VCONFKEY_FEEDBACK_VOICE_SPEECH_VOLUME VCONF_PROJECT_PREFIX "FEEDBACK_VOICE_SPEECH_VOLUME"
-#define VCONFKEY_AUTO_SCROLL_ENABLED VCONF_PROJECT_PREFIX "AUTO_SCROLL_ENABLED"
-#define VCONFKEY_GRANULARITY_UNIT VCONF_PROJECT_PREFIX "GRANULARITY_UNIT"
-#define VCONFKEY_MANAGE_ACTIONS VCONF_PROJECT_PREFIX "SHOW_ACTIONS_MENU_ITEM"
-#define VCONFKEY_MANAGE_SETTINGS VCONF_PROJECT_PREFIX "SHOW_SETTINGS_MENU_ITEM"
-#define VCONFKEY_MANAGE_HOMESCREEN VCONF_PROJECT_PREFIX "SHOW_HOME_SCREEN_MENU_ITEM"
-#define VCONFKEY_MANAGE_KEYS VCONF_PROJECT_PREFIX "SHOW_BUTTONS_AND_KEYS_MENU_ITEM"
-#define VCONFKEY_MANAGE_CONTEXTUAL_MENU VCONF_PROJECT_PREFIX "SHOW_CONTEXTUAL_MENU"
-#define VCONFKEY_MANAGE_GESTURES VCONF_PROJECT_PREFIX "SHOW_GESTURES_MENU_ITEM"
-#define VCONFKEY_MANAGE_RECENT_APPS VCONF_PROJECT_PREFIX "SHOW_RECENT_APPS_MENU_ITEM"
-#define VCONFKEY_MANAGE_BACK VCONF_PROJECT_PREFIX "SHOW_BACK_MENU_ITEM"
-
-#define DEFAULT_AUTO_SCAN_INTERVAL 2.0
-#define DEFAULT_AUTO_SCAN_NUMBER 5
-#define DEFAULT_SCAN_METHOD ScanMethod::POINT
-#define DEFAULT_SCAN_DIR ScanDirection::TO_BOTTOM
-#define DEFAULT_SCAN_PT_SPEED 10
-#define DEFAULT_PAUSE_ON_FIRST_VALUE 1.0
-#define DEFAULT_TAP_DURATION_VALUE 0.5
-#define DEFAULT_SGL_IACTION_INT_VALUE 0.5
-#define DEFAULT_AUTO_TAP_VALUE 1.0
-#define DEFAULT_AUTO_MOVE_INT_VALUE 1.0
-#define DEFAULT_FEEDBACK_CURSOR_COLOR 0xffff0000
-#define DEFAULT_FEEDBACK_SOUND_VOLUME 0.5
-#define DEFAULT_FEEDBACK_VOICE_SPEECH_RATE 0.5
-#define DEFAULT_FEEDBACK_VOICE_SPEECH_VOLUME 0.5
-
-ScanningProperty::ScanningProperty(const std::string &stateVConfKey)
-{
-       callbackHandle_.resize(static_cast<size_t>(Members::COUNT));
-       vconfKeys_.resize(static_cast<size_t>(Members::COUNT));
-       if (!stateVConfKey.empty())
-               syncValueWithVConf(stateVConfKey, false, Members::STATE, state_);
-}
-
-bool ScanningProperty::getState() const
-{
-       return state_;
-}
-
-void ScanningProperty::setState(bool state)
-{
-       setValue(state, Members::STATE, state_);
-}
-
-void ScanningProperty::registerOnValueChangeCallback(std::function<void(ScanningProperty *)> callback)
-{
-       onValueChangeCallback_ = std::move(callback);
-}
-
-void ScanningProperty::unregisterOnValueChangeCallback()
-{
-       onValueChangeCallback_ = {};
-}
-
-void ScanningProperty::onValueChange()
-{
-       if (onValueChangeCallback_)
-               onValueChangeCallback_(this);
-}
-
-ScanningProperties::ScanningProperties()
-{
-       properties_.resize(static_cast<int>(Property::COUNT));
-
-       properties_[static_cast<int>(Property::AUTO_SCAN)] = std::make_unique<ScanningProperty>(VCONFKEY_AUTO_SCAN_ENABLED);
-       properties_[static_cast<int>(Property::AUTO_SCAN)]->syncFirstValueWithVConf(VCONFKEY_AUTO_SCAN_INT, DEFAULT_AUTO_SCAN_INTERVAL);
-       properties_[static_cast<int>(Property::AUTO_SCAN)]->syncSecondValueWithVConf(VCONFKEY_NUM_OF_SCANS, DEFAULT_AUTO_SCAN_NUMBER);
-       properties_[static_cast<int>(Property::SCAN_METHOD)] = std::make_unique<ScanningProperty>();
-       properties_[static_cast<int>(Property::SCAN_METHOD)]->syncFirstValueWithVConf(VCONFKEY_SCAN_METHOD, DEFAULT_SCAN_METHOD);
-       properties_[static_cast<int>(Property::SCAN_DIRECTION)] = std::make_unique<ScanningProperty>();
-       properties_[static_cast<int>(Property::SCAN_DIRECTION)]->syncFirstValueWithVConf(VCONFKEY_SCAN_DIR_VERTICAL, DEFAULT_SCAN_DIR);
-       properties_[static_cast<int>(Property::POINT_SCAN_SPEED)] = std::make_unique<ScanningProperty>();
-       properties_[static_cast<int>(Property::POINT_SCAN_SPEED)]->syncFirstValueWithVConf(VCONFKEY_SCAN_PT_SPEED, DEFAULT_SCAN_PT_SPEED);
-       properties_[static_cast<int>(Property::PAUSE_ON_FIRST_ITEM)] = std::make_unique<ScanningProperty>(VCONFKEY_PAUSE_ON_FIRST_STATE);
-       properties_[static_cast<int>(Property::PAUSE_ON_FIRST_ITEM)]->syncFirstValueWithVConf(VCONFKEY_PAUSE_ON_FIRST_VALUE, DEFAULT_PAUSE_ON_FIRST_VALUE);
-       properties_[static_cast<int>(Property::TAP_DURATION)] = std::make_unique<ScanningProperty>(VCONFKEY_TAP_DURATION_STATE);
-       properties_[static_cast<int>(Property::TAP_DURATION)]->syncFirstValueWithVConf(VCONFKEY_TAP_DURATION_VALUE, DEFAULT_TAP_DURATION_VALUE);
-       properties_[static_cast<int>(Property::SINGLE_INTERACTION_INTERVAL)] = std::make_unique<ScanningProperty>(VCONFKEY_SGL_IACTION_INT_STATE);
-       properties_[static_cast<int>(Property::SINGLE_INTERACTION_INTERVAL)]->syncFirstValueWithVConf(VCONFKEY_SGL_IACTION_INT_VALUE, DEFAULT_SGL_IACTION_INT_VALUE);
-       properties_[static_cast<int>(Property::AUTO_TAP)] = std::make_unique<ScanningProperty>(VCONFKEY_AUTO_TAP_STATE);
-       properties_[static_cast<int>(Property::AUTO_TAP)]->syncFirstValueWithVConf(VCONFKEY_AUTO_TAP_VALUE, DEFAULT_AUTO_TAP_VALUE);
-       properties_[static_cast<int>(Property::AUTO_MOVE_INTERVAL)] = std::make_unique<ScanningProperty>(VCONFKEY_AUTO_MOVE_INT_STATE);
-       properties_[static_cast<int>(Property::AUTO_MOVE_INTERVAL)]->syncFirstValueWithVConf(VCONFKEY_AUTO_MOVE_INT_VALUE, DEFAULT_AUTO_MOVE_INT_VALUE);
-       properties_[static_cast<int>(Property::KEYBOARD_AUTO_TAP)] = std::make_unique<ScanningProperty>(VCONFKEY_AUTO_TAP_KBD_STATE);
-       properties_[static_cast<int>(Property::CURSOR_COLOR)] = std::make_unique<ScanningProperty>();
-       properties_[static_cast<int>(Property::CURSOR_COLOR)]->syncFirstValueWithVConf(VCONFKEY_FEEDBACK_CURSOR_COLOR, static_cast<int>(DEFAULT_FEEDBACK_CURSOR_COLOR));
-       properties_[static_cast<int>(Property::FEEDBACK_SOUND)] = std::make_unique<ScanningProperty>(VCONFKEY_FEEDBACK_SOUND_STATE);
-       properties_[static_cast<int>(Property::FEEDBACK_SOUND)]->syncFirstValueWithVConf(VCONFKEY_FEEDBACK_SOUND_VOLUME, DEFAULT_FEEDBACK_SOUND_VOLUME);
-       properties_[static_cast<int>(Property::FEEDBACK_VOICE)] = std::make_unique<ScanningProperty>(VCONFKEY_FEEDBACK_VOICE_STATE);
-       properties_[static_cast<int>(Property::FEEDBACK_VOICE)]->syncFirstValueWithVConf(VCONFKEY_FEEDBACK_VOICE_SPEECH_RATE, DEFAULT_FEEDBACK_VOICE_SPEECH_RATE);
-       properties_[static_cast<int>(Property::FEEDBACK_VOICE)]->syncSecondValueWithVConf(VCONFKEY_FEEDBACK_VOICE_SPEECH_VOLUME, DEFAULT_FEEDBACK_VOICE_SPEECH_VOLUME);
-       properties_[static_cast<int>(Property::ACTIONS)] = std::make_unique<ScanningProperty>(VCONFKEY_MANAGE_ACTIONS);
-       properties_[static_cast<int>(Property::SETTINGS)] = std::make_unique<ScanningProperty>(VCONFKEY_MANAGE_SETTINGS);
-       properties_[static_cast<int>(Property::HOME_SCREEN)] = std::make_unique<ScanningProperty>(VCONFKEY_MANAGE_HOMESCREEN);
-       properties_[static_cast<int>(Property::BUTTONS_AND_KEYS)] = std::make_unique<ScanningProperty>(VCONFKEY_MANAGE_KEYS);
-       properties_[static_cast<int>(Property::CONTEXTUAL_MENU)] = std::make_unique<ScanningProperty>(VCONFKEY_MANAGE_CONTEXTUAL_MENU);
-       properties_[static_cast<int>(Property::GESTURES)] = std::make_unique<ScanningProperty>(VCONFKEY_MANAGE_GESTURES);
-       properties_[static_cast<int>(Property::RECENT_APPS)] = std::make_unique<ScanningProperty>(VCONFKEY_MANAGE_RECENT_APPS);
-       properties_[static_cast<int>(Property::BACK)] = std::make_unique<ScanningProperty>(VCONFKEY_MANAGE_BACK);
-}
-
-ScanningProperty *ScanningProperties::getScanningProperty(Property property)
-{
-       return properties_[static_cast<int>(property)].get();
-}
\ No newline at end of file
diff --git a/src/ScanningProperties.hpp b/src/ScanningProperties.hpp
deleted file mode 100644 (file)
index 62b9c6a..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-#ifndef SCANNING_PROPERTIES
-#define SCANNING_PROPERTIES
-
-#include "AccessibilitySettingLog.hpp"
-#include "Geometry.hpp"
-#include "VConf.hpp"
-
-#include <experimental/any>
-#include <functional>
-#include <string>
-#include <vector>
-
-enum class ScanMethod
-{
-       POINT = 1,
-       ROW
-};
-
-enum class ScanDirection
-{
-       TO_BOTTOM = 1,
-       TO_TOP
-};
-
-using UniversalSwitchCb = std::function<void(void *, const std::string &, const std::string &, const std::string &)>;
-
-class ScanningProperty
-{
-       public:
-       ScanningProperty(const std::string &stateVConfKey = {});
-       friend class ScanningProperties;
-       bool getState() const;
-       void setState(bool state);
-
-       template <typename T>
-       T getFirstValue() const
-       {
-               return getValue<T>(firstValue_);
-       }
-
-       template <typename T>
-       T getSecondValue() const
-       {
-               return getValue<T>(secondValue_);
-       }
-
-       template <typename T>
-       void setFirstValue(T value)
-       {
-               setValue<T>(value, Members::FIRST_VALUE, firstValue_);
-       }
-
-       template <typename T>
-       void setSecondValue(T value)
-       {
-               setValue(value, Members::SECOND_VALUE, secondValue_);
-       }
-
-       void registerOnValueChangeCallback(std::function<void(ScanningProperty *)> callback);
-       void unregisterOnValueChangeCallback();
-
-       private:
-       enum class Members : size_t
-       {
-               STATE,
-               FIRST_VALUE,
-               SECOND_VALUE,
-               COUNT
-       };
-
-       template <typename T>
-       T getValue(const std::experimental::any &value) const
-       {
-               try {
-                       ASSERT(!value.empty(), "no value");
-                       return std::experimental::any_cast<T>(value);
-               } catch (const std::experimental::bad_any_cast &e) {
-                       ERROR("%s", e.what());
-                       return {};
-               }
-       }
-
-       template <typename T, typename U>
-       void setValue(T value, Members member, U &field)
-       {
-               ASSERT(static_cast<size_t>(member) < static_cast<size_t>(Members::COUNT), "Wrong class member");
-               ASSERT(!vconfKeys_[static_cast<size_t>(member)].empty(), "Property not synced with vconf");
-               field = value;
-               Singleton<VConfInterface>::instance().set(vconfKeys_[static_cast<size_t>(member)], value);
-       }
-
-       template <typename T>
-       void syncFirstValueWithVConf(const std::string &vConfKey, const T defaultValue)
-       {
-               syncValueWithVConf<T>(vConfKey, defaultValue, Members::FIRST_VALUE, firstValue_);
-       }
-
-       template <typename T>
-       void syncSecondValueWithVConf(const std::string &vConfKey, const T defaultValue)
-       {
-               syncValueWithVConf<T>(vConfKey, defaultValue, Members::SECOND_VALUE, secondValue_);
-       }
-
-       template <typename T, typename U>
-       void syncValueWithVConf(const std::string &vConfKey, const T defaultValue, Members member, U &field)
-       {
-               ASSERT(static_cast<size_t>(member) < static_cast<size_t>(Members::COUNT), "Wrong class member");
-               callbackHandle_[static_cast<size_t>(member)] = std::move(Singleton<VConfInterface>::instance().registerAndGet<T>(vConfKey, defaultValue, [this, &field](auto value) {
-                       field = value;
-                       this->onValueChange();
-               }));
-               vconfKeys_[static_cast<size_t>(member)] = vConfKey;
-       }
-
-       void onValueChange();
-
-       bool state_ = true;
-       std::experimental::any firstValue_;
-       std::experimental::any secondValue_;
-       std::vector<VConfInterface::CallbackHandle> callbackHandle_;
-       std::vector<std::string> vconfKeys_;
-       std::function<void(ScanningProperty *)> onValueChangeCallback_;
-};
-
-enum class Property
-{
-       AUTO_SCAN,
-       SCAN_METHOD,
-       SCAN_DIRECTION,
-       POINT_SCAN_SPEED,
-       PAUSE_ON_FIRST_ITEM,
-       TAP_DURATION,
-       SINGLE_INTERACTION_INTERVAL,
-       AUTO_TAP,
-       AUTO_MOVE_INTERVAL,
-       KEYBOARD_AUTO_TAP,
-       CURSOR_COLOR,
-       FEEDBACK_SOUND,
-       FEEDBACK_VOICE,
-       GESTURES,
-       ACTIONS,
-       SETTINGS,
-       RECENT_APPS,
-       HOME_SCREEN,
-       BACK,
-       BUTTONS_AND_KEYS,
-       CONTEXTUAL_MENU,
-       COUNT
-};
-
-class ScanningProperties
-{
-       public:
-       ScanningProperties();
-       ScanningProperty *getScanningProperty(Property property);
-
-       protected:
-       ScanningProperties(const ScanningProperties &) = delete;
-       ScanningProperties(ScanningProperties &&) = delete;
-       ScanningProperties &operator=(const ScanningProperties &) = delete;
-       ScanningProperties &operator=(ScanningProperties &&) = delete;
-
-       private:
-       std::vector<std::unique_ptr<ScanningProperty>> properties_;
-};
-
-#endif
\ No newline at end of file
diff --git a/src/ScreenSwitchPage.cpp b/src/ScreenSwitchPage.cpp
deleted file mode 100644 (file)
index 9be6913..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ScreenSwitchPage.hpp"
-
-#include "AccessibilitySettingLog.hpp"
-#include "Singleton.hpp"
-#include "setting-accessibility.h"
-
-ScreenSwitchPage::ScreenSwitchPage(NaviframeItem targetItem)
-       : context_(Singleton<AppContext>::instance())
-{
-       actionPage_ = std::make_unique<ActionPage>(targetItem);
-       actionPage_->attachCallback(actionCb, this);
-}
-
-void ScreenSwitchPage::attachActionCallback(UniversalSwitchCb cb, void *cbData)
-{
-       switch_added_cb = cb;
-       switch_added_cb_data = cbData;
-}
-
-void ScreenSwitchPage::actionCb(const std::string &action, void *user_data)
-{
-       auto self = static_cast<ScreenSwitchPage *>(user_data);
-
-       if (self->switch_added_cb) {
-               auto switches = setting_accessibility_universal_switch_dbus_config_get_switches(
-                       &self->context_.config, ACCESSIBILITY_UNIVERSAL_SWITCH_SCREEN_SWITCH_PROVIDER);
-               ASSERT(!switches.empty(), "Screen switch not found");
-               auto screen_switch = switches[0];
-               self->switch_added_cb(self->switch_added_cb_data, screen_switch->id, action, ACCESSIBILITY_UNIVERSAL_SWITCH_SCREEN);
-       }
-}
diff --git a/src/ScreenSwitchPage.hpp b/src/ScreenSwitchPage.hpp
deleted file mode 100644 (file)
index 5e23f40..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SCREEN_SWITCH_PAGE_HPP
-#define SCREEN_SWITCH_PAGE_HPP
-
-#include "ActionPage.hpp"
-#include "AppContext.hpp"
-
-/**
- * View allowing to configure switches provided by ScreenSwitchProvider.
- *
- * Currently there is only one switch provided by ScreenSwitch provider
- * so this class automatically transfers to ActionPage view.
- *
- * @param ad global context of application
- *
- * TODO:
- *  replace classical callbacks with lambda expressions
- */
-class ScreenSwitchPage
-{
-       public:
-       ScreenSwitchPage(NaviframeItem targetItem);
-       void attachActionCallback(UniversalSwitchCb cb, void *cbData);
-
-       private:
-       static void actionCb(const std::string &action, void *user_data);
-
-       AppContext &context_;
-       std::unique_ptr<ActionPage> actionPage_;
-
-       UniversalSwitchCb switch_added_cb = nullptr;
-       void *switch_added_cb_data = nullptr;
-};
-
-#endif
diff --git a/src/SetValuePage.cpp b/src/SetValuePage.cpp
deleted file mode 100644 (file)
index 52132f6..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "SetValuePage.hpp"
-
-#include "AccessibilitySettingLog.hpp"
-#include "Button.hpp"
-#include "Genlist.hpp"
-#include "Label.hpp"
-#include "NavigationContext.hpp"
-#include "Singleton.hpp"
-#include "setting-accessibility.h"
-
-#include <app.h>
-#include <sstream>
-
-#define EDJ_SET_VALUE "edje/accessibility-settings-set-value.edj"
-
-SetValuePage::SetValuePage(ValueEditorType type, TranslatedString title, NaviframeItem targetItem)
-       : context_(Singleton<AppContext>::instance()), naviframeItem_(targetItem)
-{
-       auto layoutGroup = std::string{};
-       RETURN_IF(title.empty(), "Title parameter is NULL");
-
-       switch (type) {
-       case ValueEditorType::NUMERIC:
-               layoutGroup = "set-value-numeric";
-               break;
-       case ValueEditorType::NUMERIC_SWITCH:
-               layoutGroup = "set-value-numeric-switch";
-               break;
-       case ValueEditorType::RADIOS:
-       case ValueEditorType::SWITCHES:
-               layoutGroup = "set-value-switches";
-               break;
-       case ValueEditorType::LIST_SWITCH:
-               layoutGroup = "set-value-list-switch";
-               break;
-       default:
-               layoutGroup = "set-value-numeric";
-               ERROR("Unrecognized layout type");
-       }
-       auto naviframe = Singleton<NavigationContext>::instance().getNaviframe();
-       layout_ = createLayout(naviframe, layoutGroup);
-
-       switch (type) {
-       case ValueEditorType::NUMERIC:
-               createScroller();
-               break;
-       case ValueEditorType::NUMERIC_SWITCH:
-               createScroller();
-               check_ = Widget::make<Check>(layout_, false, "on&off", [this]() { checkStateChangedCb(); });
-               layout_->setPartContent("set-value-switch", check_);
-               check_->setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-               break;
-       case ValueEditorType::RADIOS:
-               genlist_ = createGenlist(layout_, {});
-               break;
-       case ValueEditorType::SWITCHES:
-               genlist_ = createGenlist(layout_, {});
-               break;
-       case ValueEditorType::LIST_SWITCH:
-               check_ = Widget::make<Check>(layout_, false, "on&off", [this]() { checkStateChangedCb(); });
-               layout_->setPartContent("set-value-switch", check_);
-               check_->setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-               genlist_ = createGenlist(layout_, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_OPTIONS");
-               break;
-       default:
-               ERROR("Wrong value type");
-       }
-
-       auto prevBtn = Widget::make<Button>(
-               naviframe, [naviframe]() { naviframe->popBack(); }, std::string{}, Button::BACK_BUTTON_ARROW_STYLE);
-
-       naviframe->pushBack(std::move(title),
-               layout_,
-               [this]() {
-                       context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->unregisterOnValueChangeCallback();
-                       context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_SOUND)->unregisterOnValueChangeCallback();
-
-                       if (changeValueCb_) {
-                               auto pageNum = scroller_->getCurrentVerticalPage();
-                               changeValueCb_(static_cast<double>(pageNum) * step_ + minVal_);
-                       }
-
-                       if (!options_data.empty()) {
-                               for (auto it : options_data)
-                                       free(it);
-                               options_data.clear();
-                       }
-               },
-               prevBtn);
-}
-
-void SetValuePage::setDescription(const TranslatedString &description)
-{
-       layout_->setPartText("set-value-desc", description);
-}
-
-void SetValuePage::setRange(double min, double max, double step)
-{
-       RETURN_IF(min >= max, "Invalid min/max arguments");
-       RETURN_IF(step <= 0.0, "Invalid step value");
-
-       minVal_ = min;
-       maxVal_ = max;
-       step_ = step;
-
-       box_->packEnd(Widget::make<Label>(box_, ""));
-       box_->packEnd(Widget::make<Label>(box_, ""));
-
-       for (auto i = min; i < max + step / 2; i += step) {
-               std::ostringstream out;
-               out << "<font=BreezeSans:style=normal font_size=50 color=#7f7f7f>";
-               if (step < 1.0)
-                       out.precision(1);
-               else
-                       out.precision(0);
-               out << std::fixed << i << "</font/>";
-
-               box_->packEnd(Widget::make<Label>(box_, out.str().c_str()));
-       }
-
-       box_->packEnd(Widget::make<Label>(box_, ""));
-       box_->packEnd(Widget::make<Label>(box_, ""));
-
-       std::ostringstream out;
-       if (step_ < 1.0)
-               out.precision(1);
-       else
-               out.precision(0);
-
-       out << std::fixed << "Accepted range: " << min << " to " << max; // TODO translation
-
-       layout_->setPartText("set-value-range", out.str());
-}
-
-void SetValuePage::setValue(double value, const std::string &units)
-{
-       RETURN_IF(value < minVal_, "Invalid value");
-       RETURN_IF(value > maxVal_, "Invalid value");
-
-       units_ = units;
-       scroller_->showVerticalPage((value - minVal_) / step_);
-
-       displayValue(value);
-}
-
-void SetValuePage::setSwitch(bool state)
-{
-       check_->setState(state);
-
-       if (state)
-               layout_->setPartText("set-value-switch-label", "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON");
-       else
-               layout_->setPartText("set-value-switch-label", "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-}
-
-void SetValuePage::addRadioItem(const std::string &caption, int id, bool selected)
-{
-       auto item = genlist_->appendItem({"type1",
-               caption,
-               {},
-               [this](auto item) { this->callRadioItemChangeCbAndPopNaviframe(item); },
-               GenlistItem::WidgetType::radio});
-
-       item->setState(selected);
-       item->setId(id);
-}
-
-GenlistItem *SetValuePage::addRadioListItem(const std::string &main_text, const std::string &sub_text, int option_id)
-{
-       auto opt_item = new OptionsItem;
-       opt_item->self = this;
-       opt_item->option_id = option_id;
-       options_data.push_back(opt_item);
-
-       auto item = genlist_->appendItem({"type1", main_text, sub_text, [=](auto item) {
-                                                                                 if (opt_item->self->requestListItemOptionsCb_)
-                                                                                         opt_item->self->requestListItemOptionsCb_(opt_item->option_id);
-                                                                         }});
-
-       if (check_->getState())
-               item->enable();
-       else
-               item->disable();
-
-       return item;
-}
-
-void SetValuePage::addValueChangedCb(ChangeValueCb cb)
-{
-       changeValueCb_ = std::move(cb);
-}
-
-void SetValuePage::addSwitchChangedCb(ChangeSwitchCb cb)
-{
-       changeSwitchCb_ = std::move(cb);
-}
-
-void SetValuePage::addRadioItemChangedCb(ChangeRadioItemCb cb)
-{
-       changeRadioItemCb_ = std::move(cb);
-}
-
-void SetValuePage::addListItemOptionsRequestCb(RequestListItemOptionsCb cb)
-{
-       requestListItemOptionsCb_ = std::move(cb);
-}
-
-void SetValuePage::setCheckState(bool state)
-{
-       check_->setState(state);
-}
-
-void SetValuePage::callRadioItemChangeCbAndPopNaviframe(GenlistItem *item)
-{
-       if (changeRadioItemCb_)
-               changeRadioItemCb_(item->getId());
-       Singleton<NavigationContext>::instance().getNaviframe()->popBack(naviframeItem_);
-}
-
-Genlist *SetValuePage::createGenlist(Widget *parent, TranslatedString title)
-{
-       RETURN_DEFAULT_IF(!parent, "Input parameter is nullptr");
-
-       auto genlist = Widget::make<Genlist>(parent);
-       genlist->setMode(ELM_LIST_COMPRESS);
-       genlist->setStyle("dialogue");
-
-       if (!title.empty())
-               genlist->appendItem({"group_index", std::move(title)});
-
-       parent->setPartContent("set-value-list", genlist);
-
-       return genlist;
-}
-
-void SetValuePage::createScroller()
-{
-       scroller_ = Widget::make<Scroller>(layout_);
-       scroller_->setScrollbarsVisibility(ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
-       scroller_->setMinimumSizeLimit(EINA_FALSE, EINA_FALSE);
-       scroller_->blockScrolling(ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL);
-       scroller_->setRelativeSize(1.0, 0.2);
-       scroller_->setPageScrollLimit(1, 1);
-       layout_->setPartContent("set-value-selector", scroller_);
-       box_ = Widget::make<Box>(scroller_);
-       box_->setHomogeneousDimensions();
-       box_->setAlignHint(0.0, 0.0);
-       scroller_->setContent(box_);
-       scroller_->setEvasSmartCallback("scroll,page,changed", [this]() {
-               auto pageNum = scroller_->getCurrentVerticalPage();
-               displayValue(static_cast<double>(pageNum) * step_ + minVal_);
-       });
-}
-
-Layout *SetValuePage::createLayout(Widget *parent, const std::string &layoutGroup)
-{
-       auto resPath = std::string{app_get_resource_path()};
-       auto edjPath = resPath + "edje/accessibility-settings-set-value.edj";
-
-       auto layout = Widget::make<Layout>(parent);
-       layout->setFile(edjPath, layoutGroup);
-       layout->setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
-       return layout;
-}
-
-void SetValuePage::displayValue(double value)
-{
-       std::ostringstream out;
-       if (step_ < 1.0)
-               out.precision(1);
-       else
-               out.precision(0);
-
-       out << std::fixed << value << " " << units_; // TODO translation
-
-       layout_->setPartText("set-value-value", out.str());
-}
-
-void SetValuePage::checkStateChangedCb()
-{
-       auto state = check_->getState();
-
-       if (state)
-               layout_->setPartText("set-value-switch-label", "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON");
-       else
-               layout_->setPartText("set-value-switch-label", "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-
-       if (genlist_) {
-               Elm_Object_Item *item = elm_genlist_first_item_get(genlist_->getObject());
-               do {
-                       elm_object_item_disabled_set(item, !state);
-                       item = elm_genlist_item_next_get(item);
-               } while (item != NULL);
-       }
-
-       if (changeSwitchCb_)
-               changeSwitchCb_(state);
-}
diff --git a/src/SetValuePage.hpp b/src/SetValuePage.hpp
deleted file mode 100644 (file)
index adfee34..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SET_VALUE_PAGE_HPP
-#define SET_VALUE_PAGE_HPP
-
-#include "AppContext.hpp"
-#include "Box.hpp"
-#include "Check.hpp"
-#include "GenlistItem.hpp"
-#include "Scroller.hpp"
-
-#include <vconf.h>
-
-using ChangeValueCb = std::function<void(double)>;
-
-enum class ValueEditorType
-{
-       NUMERIC,
-       NUMERIC_SWITCH,
-       RADIOS,
-       SWITCHES,
-       LIST_SWITCH
-};
-
-class SetValuePage;
-struct OptionsItem
-{
-       SetValuePage *self;
-       int option_id;
-};
-
-using ChangeValueCb = std::function<void(double)>;
-using ChangeSwitchCb = std::function<void(bool)>;
-using ChangeRadioItemCb = std::function<void(size_t)>;
-using ChangeSwitchItemCb = std::function<void(int, bool)>;
-using RequestListItemOptionsCb = std::function<void(int)>;
-
-class SetValuePage
-{
-       public:
-       SetValuePage(ValueEditorType type, TranslatedString title, NaviframeItem targetItem = {});
-       void setDescription(const TranslatedString &description);
-       void setRange(double min, double max, double step);
-       void setValue(double value, const std::string &units);
-       void setSwitch(bool state);
-       void addRadioItem(const std::string &caption, int id, bool selected);
-       GenlistItem *addRadioListItem(const std::string &main_text, const std::string &sub_text, int option_id);
-       void addValueChangedCb(ChangeValueCb cb);
-       void addSwitchChangedCb(ChangeSwitchCb cb);
-       void addRadioItemChangedCb(ChangeRadioItemCb cb);
-       void addListItemOptionsRequestCb(RequestListItemOptionsCb cb);
-       void setCheckState(bool state);
-
-       private:
-       void callRadioItemChangeCbAndPopNaviframe(GenlistItem *item);
-       Genlist *createGenlist(Widget *parent, TranslatedString title);
-       void createScroller();
-       Layout *createLayout(Widget *parent, const std::string &layoutGroup);
-       void displayValue(double value);
-       void checkStateChangedCb();
-       static void backCb(void *data, Evas_Object *obj, void *event_info);
-
-       AppContext &context_;
-       NaviframeItem naviframeItem_;
-
-       Layout *layout_ = nullptr;
-       Scroller *scroller_ = nullptr;
-       Box *box_ = nullptr;
-       Check *check_ = nullptr;
-       Genlist *genlist_ = nullptr;
-       std::vector<OptionsItem *> options_data;
-       double minVal_ = 0.0;
-       double maxVal_ = 0.0;
-       double step_ = 0.0;
-       std::string units_;
-
-       ChangeValueCb changeValueCb_;
-       ChangeSwitchCb changeSwitchCb_;
-       ChangeRadioItemCb changeRadioItemCb_;
-       RequestListItemOptionsCb requestListItemOptionsCb_;
-};
-
-#endif
diff --git a/src/SwitchesPage.cpp b/src/SwitchesPage.cpp
deleted file mode 100644 (file)
index 1c64f23..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "SwitchesPage.hpp"
-
-#include "NavigationContext.hpp"
-#include "Singleton.hpp"
-#include "setting-accessibility.h"
-
-#include <app.h>
-
-SwitchesPage::SwitchesPage()
-       : context_(Singleton<AppContext>::instance())
-{
-       auto naviframe = Singleton<NavigationContext>::instance().getNaviframe();
-       switches_ = Widget::make<Genlist>(naviframe);
-       switches_->setMode(ELM_LIST_COMPRESS);
-       switches_->setStyle("dialogue");
-
-       auto prevBtn = Widget::make<Button>(naviframe,
-               [naviframe, this]() {
-                       naviframe->removeChild(removeSwitchesPageBtn_);
-                       naviframe->popBack();
-               },
-               std::string{},
-               Button::BACK_BUTTON_ARROW_STYLE);
-
-       naviframe->pushBack("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SWITCHES",
-               switches_,
-               [this]() {
-                       if (universal_switch_switches_back)
-                               universal_switch_switches_back(universal_switch_switches_back_data);
-
-                       universal_switch_switches_back = nullptr;
-                       universal_switch_switches_back_data = nullptr;
-               },
-               prevBtn);
-
-       removeSwitchesPageBtn_ = Widget::make<Button>(naviframe,
-               [this]() {
-                       removeSwitchPage_ = std::make_unique<RemoveSwitchPage>();
-                       removeSwitchPage_->attachCallback(switchRemovedCb, this);
-               },
-               "IDS_ACCS_DELETE_CAPS",
-               "naviframe/title_right");
-       naviframe->setPartContent("title_right_btn", removeSwitchesPageBtn_);
-       updateSwitchesList();
-}
-
-void SwitchesPage::attachCallback(back_cb callback, void *data)
-{
-       universal_switch_switches_back = callback;
-       universal_switch_switches_back_data = data;
-}
-
-void SwitchesPage::updateSwitchesList()
-{
-       switches_->clear();
-       createSwitchesGroup();
-       switches_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SWITCHES_ADD_SWITCH",
-               {},
-               [this](auto item) {
-                       addSwitchPage_ = std::make_unique<AddSwitchPage>();
-                       addSwitchPage_->attachCallbackOnSwitchAttach(addSwitchCb, this);
-               },
-               ACCESSIBILITY_UNIVERSAL_SWITCH_PLUS_ICON});
-       removeSwitchesPageBtn_->disable(context_.config.configuration_items.size() == 0);
-}
-
-void SwitchesPage::createSwitchesGroup()
-{
-       for (auto &it : context_.config.configuration_items) {
-               auto activity_name = setting_accessibility_universal_switch_dbus_config_get_activity_name(
-                       &context_.config, it->activity_type);
-               switches_->appendItem({"type1", it->user_name, activity_name, [=](auto item) {
-                                                                  this->updateSwitchPage_ = std::make_unique<UpdateSwitchPage>(it);
-                                                                  this->updateSwitchPage_->attachActionCallback(switchUpdatedCb, this);
-                                                          }});
-       }
-}
-
-void SwitchesPage::switchUpdatedCb(
-       void *data,
-       const std::string &switch_id,
-       const std::string &switch_action,
-       const std::string &switch_name)
-{
-       RETURN_IF(!data, "Input parameter is NULL");
-       auto self = static_cast<SwitchesPage *>(data);
-
-       DEBUG("Switch updated, id: %s, name: %s, action: %s.", switch_id.c_str(), switch_name.c_str(), switch_action.c_str());
-       setting_accessibility_universal_switch_dbus_config_updateSwitchConfigurationItem(
-               &self->context_.config, switch_id, switch_name, switch_action);
-       self->updateSwitchesList();
-}
-
-void SwitchesPage::switchRemovedCb(
-       void *data,
-       const std::string &switch_id,
-       const std::string &switch_action,
-       const std::string &switch_name)
-{
-       RETURN_IF(!data, "Input parameter is NULL");
-       auto self = static_cast<SwitchesPage *>(data);
-
-       DEBUG("Switch removed, name: %s, id: %s, action: %s.", switch_name.c_str(), switch_id.c_str(), switch_action.c_str());
-       setting_accessibility_universal_switch_dbus_config_removeSwitchConfigurationItem(&self->context_.config, switch_id);
-       self->updateSwitchesList();
-}
-
-void SwitchesPage::addSwitchCb(
-       void *data,
-       const std::string &switch_id,
-       const std::string &switch_action,
-       const std::string &switch_name)
-{
-       RETURN_IF(!data, "Input parameter is NULL");
-       auto self = static_cast<SwitchesPage *>(data);
-
-       DEBUG("Add switch, id: %s, name: %s, action: %s.", switch_id.c_str(), switch_name.c_str(), switch_action.c_str());
-       setting_accessibility_universal_switch_dbus_config_addSwitchConfigurationItem(
-               &self->context_.config, switch_id, switch_name, switch_action);
-       self->updateSwitchesList();
-}
\ No newline at end of file
diff --git a/src/SwitchesPage.hpp b/src/SwitchesPage.hpp
deleted file mode 100644 (file)
index 2e846fc..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SWITCHES_PAGE_HPP
-#define SWITCHES_PAGE_HPP
-
-#include "AddSwitchPage.hpp"
-#include "AppContext.hpp"
-#include "Button.hpp"
-#include "Genlist.hpp"
-#include "RemoveSwitchPage.hpp"
-#include "UpdateSwitchPage.hpp"
-
-/**
- * View displaying already configured switches and allowing
- * to start configuration of new switch.
- *
- * @param ad global context of application
- *
- * TODO:
- *  replace classical callbacks with lambda expressions
- */
-class SwitchesPage
-{
-       public:
-       using back_cb = void (*)(void *ad); // TODO: probably remove
-       SwitchesPage();
-       void attachCallback(back_cb callback, void *data);
-       static void addSwitchCb(
-               void *data,
-               const std::string &switch_id,
-               const std::string &switch_action,
-               const std::string &switch_name);
-
-       private:
-       void updateSwitchesList();
-       void createSwitchesGroup();
-       static void switchUpdatedCb(
-               void *data,
-               const std::string &switch_id,
-               const std::string &switch_action,
-               const std::string &switch_name);
-       static void switchRemovedCb(
-               void *data,
-               const std::string &switch_id,
-               const std::string &switch_action,
-               const std::string &switch_name);
-
-       AppContext &context_;
-       Button *removeSwitchesPageBtn_ = nullptr;
-       back_cb universal_switch_switches_back = nullptr;
-       void *universal_switch_switches_back_data = nullptr;
-       Genlist *switches_ = nullptr;
-       std::unique_ptr<RemoveSwitchPage> removeSwitchPage_;
-       std::unique_ptr<AddSwitchPage> addSwitchPage_;
-       std::unique_ptr<UpdateSwitchPage> updateSwitchPage_;
-};
-
-#endif
diff --git a/src/UniversalSwitchPage.cpp b/src/UniversalSwitchPage.cpp
deleted file mode 100644 (file)
index 773f505..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "UniversalSwitchPage.hpp"
-
-#include "NavigationContext.hpp"
-#include "Popup.hpp"
-#include "Singleton.hpp"
-#include "setting-accessibility.h"
-
-#include <app.h>
-
-UniversalSwitchPage::UniversalSwitchPage()
-       : context_(Singleton<AppContext>::instance())
-{
-       auto naviframe = Singleton<NavigationContext>::instance().getNaviframe();
-       auto genlist = Widget::make<Genlist>(naviframe);
-       genlist->setMode(ELM_LIST_COMPRESS);
-       genlist->setStyle("dialogue");
-       genlist->clear(); // TODO check if necessary
-
-       universalSwitchOffCheckbox_ = genlist->appendItem({"type1",
-               {},
-               {},
-               [this](auto item) {
-                       auto state = item->getState();
-                       auto switch_count = setting_accessibility_universal_switch_dbus_config_get_switch_count(&context_.config);
-                       if (state && switch_count == 0) {
-                               this->displayAddSwitchPopup();
-                               item->setState(false);
-                       } else
-                               Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_INTERACTION_SERVICE, state);
-               },
-               GenlistItem::WidgetType::toggle});
-
-       auto onUsVconfKeyChange = [this](auto state) {
-               universalSwitchOffCheckbox_->setText(state ? "IDS_ACCS_UNIVERSAL_SWITCH_ON" : "IDS_ACCS_UNIVERSAL_SWITCH_OFF");
-               universalSwitchOffCheckbox_->setState(state);
-       };
-       universalSwitchStateHandle_ = Singleton<VConfInterface>::instance().registerAndGet<bool>({VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_INTERACTION_SERVICE}, false, onUsVconfKeyChange);
-
-       genlist->appendItem({"multiline", {}, "IDS_ACCS_UNIVERSAL_SWITCH_COMMENT", GenlistItem::Type::regular});
-
-       auto prevBtn = Widget::make<Button>(naviframe, [this, naviframe]() {
-               naviframe->removeChild(usSettingsBtn_);
-               naviframe->popBack();
-       },
-               std::string{},
-               Button::BACK_BUTTON_ARROW_STYLE);
-
-       naviframe->pushBack("IDS_ACCS_UNIVERSAL_SWITCH", genlist, [this]() {
-               universalSwitchStateHandle_ = {};
-               stopUniversalSwitch();
-               universalSwitchOffCheckbox_ = nullptr;
-       },
-               prevBtn);
-
-       std::string title_str = "<font_size=30>" + TranslatedString{"IDS_ACCS_SETTINGS_CAPS"}.str() + "</font_size>";
-       usSettingsBtn_ = Widget::make<Button>(naviframe, [this]() {
-               universalSwitchSettingsPage_ = std::make_unique<UniversalSwitchSettingsPage>();
-       },
-               title_str,
-               "naviframe/title_right");
-       usSettingsBtn_->disable(true);
-       naviframe->setPartContent("title_right_btn", usSettingsBtn_);
-
-       startUniversalSwitch();
-}
-
-void UniversalSwitchPage::addNewSwitch()
-{
-       addSwitchPage_ = std::make_unique<AddSwitchPage>();
-       addSwitchPage_->attachCallbackOnSwitchAttach(onNewSwitchAddition, this);
-}
-
-void UniversalSwitchPage::displayAddSwitchPopup()
-{
-       auto popup = Widget::make<Popup>(Singleton<NavigationContext>::instance().getWindow());
-       popup->setText("To turn on Universal switch, tap ADD SWITCH and add at least one switch");
-       popup->setEextEventCallback(EEXT_CALLBACK_BACK, []() {});
-
-       auto addBtnCb = [popup, this]() {
-               addNewSwitch();
-               auto parent = popup->getParent();
-               parent->removeChild(popup);
-       };
-       auto addBtn = Widget::make<Button>(popup, addBtnCb, "IDS_ACCS_UNIVERSAL_SWITCH_POPUP_ADD");
-       addBtn->setStyle("popup");
-       popup->setPartContent("button1", addBtn);
-
-       auto cancelBtnCb = [popup, this]() {
-               universalSwitchOffCheckbox_->setState(false);
-               DEBUG("Adding new switch refused");
-               auto parent = popup->getParent();
-               parent->removeChild(popup);
-       };
-       auto cancelBtn = Widget::make<Button>(popup, cancelBtnCb, "IDS_ACCS_UNIVERSAL_SWITCH_CANCEL");
-       cancelBtn->setStyle("popup");
-       popup->setPartContent("button2", cancelBtn);
-}
-
-void UniversalSwitchPage::onNewSwitchAddition(
-       void *data,
-       const std::string &switch_id,
-       const std::string &switch_action,
-       const std::string &switch_name)
-{
-       RETURN_IF(!data, "Input parameter is NULL");
-       auto self = static_cast<UniversalSwitchPage *>(data);
-       // TODO Try to use service which is independent from specific view
-       setting_accessibility_universal_switch_dbus_config_addSwitchConfigurationItem(
-               &self->context_.config, switch_id, switch_name, switch_action);
-       int switch_count = setting_accessibility_universal_switch_dbus_config_get_switch_count(&self->context_.config);
-
-       if (switch_count == 1)
-               Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_INTERACTION_SERVICE, true);
-
-       DEBUG("New switch added. Id: %s, name: %s, action: %s. Switches count: %d",
-               switch_id.c_str(),
-               switch_name.c_str(),
-               switch_action.c_str(),
-               switch_count);
-}
-
-void UniversalSwitchPage::stopUniversalSwitch()
-{
-       setting_accessibility_universal_switch_dbus_config_shutdown(&context_.config);
-
-       DEBUG("Stopping universal-switch");
-       Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_CONFIGURATION_SERVICE, false);
-}
-
-void UniversalSwitchPage::startUniversalSwitch()
-{
-       DEBUG("Starting universal-switch");
-       Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_CONFIGURATION_SERVICE, true);
-       setting_accessibility_universal_switch_dbus_config_init(&context_.config, onUniversalSwitchStarting, this);
-}
-
-void UniversalSwitchPage::onUniversalSwitchStarting(void *data)
-{
-       DEBUG("universal-switch started");
-       RETURN_IF(!data, "Data argument is NULL");
-       auto self = static_cast<UniversalSwitchPage *>(data);
-
-       self->universalSwitchOffCheckbox_->enable();
-
-       if (self->usSettingsBtn_)
-               self->usSettingsBtn_->disable(false);
-}
-
-void UniversalSwitchPage::onVconfKeyChange(keynode_t *node, void *user_data)
-{
-       auto self = static_cast<UniversalSwitchPage *>(user_data);
-
-       auto state = vconf_keynode_get_bool(node);
-       auto prevState = self->universalSwitchOffCheckbox_->getState();
-       if (state >= 0 && (static_cast<bool>(state) != prevState)) {
-               self->universalSwitchOffCheckbox_->setText(
-                       state ? "IDS_ACCS_UNIVERSAL_SWITCH_ON" : "IDS_ACCS_UNIVERSAL_SWITCH_OFF");
-               self->universalSwitchOffCheckbox_->setState(state);
-       } else {
-               ERROR("vconf_keynode_get_bool(node) failed");
-       }
-}
diff --git a/src/UniversalSwitchPage.hpp b/src/UniversalSwitchPage.hpp
deleted file mode 100644 (file)
index adba9f3..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef UNIVERSAL_SWITCH_PAGE_HPP
-#define UNIVERSAL_SWITCH_PAGE_HPP
-
-#include "AppContext.hpp"
-#include "Button.hpp"
-#include "GenlistItem.hpp"
-#include "UniversalSwitchSettingsPage.hpp"
-#include "VConf.hpp"
-
-#include <vconf.h>
-
-/**
- * View allowing to turn on/off Universal Switch and to start configuration of its options
- *
- * @param ad global context of application
- *
- * TODO:
- *  replace classical callbacks with lambda expressions
- */
-class UniversalSwitchPage
-{
-       public:
-       UniversalSwitchPage();
-
-       private:
-       void addNewSwitch();
-       void displayAddSwitchPopup();
-       static void onNewSwitchAddition(
-               void *data, const std::string &switch_id, const std::string &switch_action, const std::string &switch_name);
-       void stopUniversalSwitch();
-       void startUniversalSwitch();
-       static void onUniversalSwitchStarting(void *data);
-       static void onVconfKeyChange(keynode_t *node, void *user_data);
-
-       AppContext &context_;
-       std::unique_ptr<UniversalSwitchSettingsPage> universalSwitchSettingsPage_;
-       GenlistItem *universalSwitchOffCheckbox_;
-       Button *usSettingsBtn_ = nullptr;
-       std::unique_ptr<AddSwitchPage> addSwitchPage_;
-       VConfInterface::CallbackHandle universalSwitchStateHandle_;
-};
-
-#endif
diff --git a/src/UniversalSwitchSettingsPage.cpp b/src/UniversalSwitchSettingsPage.cpp
deleted file mode 100644 (file)
index c17893e..0000000
+++ /dev/null
@@ -1,900 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "UniversalSwitchSettingsPage.hpp"
-
-#include "Button.hpp"
-#include "CtxPopup.hpp"
-#include "NavigationContext.hpp"
-#include "Singleton.hpp"
-#include "VConf.hpp"
-#include "setting-accessibility.h"
-#include "utils.hpp"
-
-#include <app.h>
-#include <efl_extension.h>
-#include <sstream>
-
-#define CTXPOPUP_DATA_AD "__CTXPOPUP_DATA_AD"
-
-#define RANGE_MIN_AUTO_SCAN_INTERVAL 0.5
-#define RANGE_MAX_AUTO_SCAN_INTERVAL 9.9
-#define RANGE_MIN_SCANS_NUM 1
-#define RANGE_MAX_SCANS_NUM 10
-#define RANGE_MIN_SCAN_SPEED 1
-#define RANGE_MAX_SCAN_SPEED 30
-#define RANGE_MIN_PAUSE_ON_FIRST 0.1
-#define RANGE_MAX_PAUSE_ON_FIRST 5.0
-#define RANGE_MIN_TAP_DURATION 0.5
-#define RANGE_MAX_TAP_DURATION 5.0
-#define RANGE_MIN_SGL_IACTION_INT 0.1
-#define RANGE_MAX_SGL_IACTION_INT 2.5
-#define RANGE_MIN_AUTO_TAP 0.5
-#define RANGE_MAX_AUTO_TAP 5.0
-#define RANGE_MIN_AUTO_MOVE_INT 0.1
-#define RANGE_MAX_AUTO_MOVE_INT 5.0
-
-#define STEP_AUTO_SCAN_INTERVAL 0.1
-#define STEP_SCANS_NUM 1
-#define STEP_SCAN_SPEED 1
-#define STEP_PAUSE_ON_FIRST 0.1
-#define STEP_TAP_DURATION 0.1
-#define STEP_SGL_IACTION_INT 0.1
-#define STEP_AUTO_TAP 0.1
-#define STEP_AUTO_MOVE_INT 0.1
-
-enum class VoiceFeedbackAttribute : int
-{
-       SPEECH_RATE,
-       VOLUME
-};
-
-enum class ManageMenuOption : int
-{
-       GESTURES,
-       ACTIONS,
-       SETTINGS,
-       RECENT_APPS,
-       HOME_SCREEN,
-       BACK,
-       BUTTONS_AND_KEYS,
-       CONTEXTUAL_MENU
-};
-
-using KeyIdPairs = std::vector<std::pair<std::string, unsigned int>>;
-
-KeyIdPairs cursorColors = {
-       {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_CURSOR_CL_RED", 0xff0000ff},
-       {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_CURSOR_CL_ORANGE", 0xff0080ff},
-       {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_CURSOR_CL_YELLOW", 0xff00ffff},
-       {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_CURSOR_CL_GREEN", 0xff00ff00},
-       {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_CURSOR_CL_BLUE", 0xffff0000},
-       {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_CURSOR_CL_GRAY", 0xff808080},
-};
-
-KeyIdPairs mediaLevel = {
-       {"100%", 100},
-       {"87%", 87},
-       {"75%", 75},
-       {"62%", 62},
-       {"50%", 50},
-       {"37%", 37},
-       {"25%", 25},
-       {"12%", 12},
-       {"0%", 0},
-};
-
-UniversalSwitchSettingsPage::UniversalSwitchSettingsPage()
-       : context_(Singleton<AppContext>::instance())
-{
-       auto naviframe = Singleton<NavigationContext>::instance().getNaviframe();
-       genlist_ = Widget::make<Genlist>(naviframe);
-       genlist_->setMode(ELM_LIST_COMPRESS);
-       genlist_->setStyle("dialogue");
-
-       createSwitchesGroup();
-       createScanningGroup();
-       createAdditionalSettingsGroup();
-       createFeedbackGroup();
-       createManageGroup();
-
-       auto prevBtn = Widget::make<Button>(
-               naviframe, [naviframe]() { naviframe->popBack(); }, std::string{}, Button::BACK_BUTTON_ARROW_STYLE);
-       naviframe->pushBack("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS", genlist_, []() {}, prevBtn);
-}
-
-void UniversalSwitchSettingsPage::createManageGroup()
-{
-       genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_SUB",
-               [this](auto item) { this->onManageMenuOptions(); }});
-}
-
-void UniversalSwitchSettingsPage::createFeedbackGroup()
-{
-       genlist_->appendItem({"group_index", "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK"});
-
-       cursorColor_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_CURSOR_CL",
-               findCursorColor(),
-               [this](auto item) {
-                       setValuePage_ = std::make_unique<SetValuePage>(ValueEditorType::RADIOS, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_CURSOR_CL");
-                       setValuePage_->addRadioItemChangedCb([this](auto val) {
-                               this->cursorColorListItemChangedCb(val);
-                       });
-
-                       for (auto i = 0u; i < cursorColors.size(); i++)
-                               setValuePage_->addRadioItem(cursorColors[i].first, i, cursorColors[i].second == static_cast<unsigned int>(context_.usScanningProperties.getScanningProperty(Property::CURSOR_COLOR)->getFirstValue<int>()));
-               }});
-
-       feedbackSound_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_SOUND",
-               context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_SOUND)->getState() ? "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON" : "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF",
-               [this](auto item) { this->feedbackSoundCb(); },
-               [this](auto item) {
-                       context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_SOUND)->setState(item->getState());
-                       item->setDescription(item->getState() ? "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON" : "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-               },
-               {},
-               GenlistItem::WidgetType::toggle});
-       feedbackSound_->setState(context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_SOUND)->getState());
-
-       feedbackVoice_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE",
-               context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->getState() ? "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON" : "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF",
-               [this](auto item) { this->feedbackVoiceCb(); },
-               [this](auto item) {
-                       context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->setState(item->getState());
-
-                       item->setDescription(item->getState() ? "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON" : "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"); },
-               {},
-               GenlistItem::WidgetType::toggle});
-       feedbackVoice_->setState(context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->getState());
-}
-
-void UniversalSwitchSettingsPage::createAdditionalSettingsGroup()
-{
-       genlist_->appendItem({"group_index", "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS"});
-       auto pauseOnFirstValue = context_.usScanningProperties.getScanningProperty(Property::PAUSE_ON_FIRST_ITEM)->getFirstValue<double>();
-       auto str = getValueUnitText(NULL,
-               &pauseOnFirstValue,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-               !context_.usScanningProperties.getScanningProperty(Property::PAUSE_ON_FIRST_ITEM)->getState(),
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-
-       pauseOnFirst_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_PAUSE_ON_FIRST",
-               str,
-               [this](auto item) {
-                       setValuePage_ = std::make_unique<SetValuePage>(ValueEditorType::NUMERIC_SWITCH, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_PAUSE_ON_FIRST");
-                       setValuePage_->setSwitch(context_.usScanningProperties.getScanningProperty(Property::PAUSE_ON_FIRST_ITEM)->getState());
-                       setValuePage_->addValueChangedCb([this](auto val) {
-                               this->pauseOnFirstValueChangedCb(val);
-                       });
-                       setValuePage_->addSwitchChangedCb([this](auto state) {
-                               this->pauseOnFirstSwitchChangedCb(state);
-                       });
-                       //FIXME: below description is not displayed at runtime
-                       auto totalPauseOnFirstItem = context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->getFirstValue<double>() + context_.usScanningProperties.getScanningProperty(Property::PAUSE_ON_FIRST_ITEM)->getFirstValue<double>();
-                       setValuePage_->setDescription(TranslatedString::create("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_PAUSE_ON_FIRST", context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->getFirstValue<double>(), totalPauseOnFirstItem).c_str());
-                       setValuePage_->setRange(RANGE_MIN_PAUSE_ON_FIRST, RANGE_MAX_PAUSE_ON_FIRST, STEP_PAUSE_ON_FIRST);
-                       setValuePage_->setValue(context_.usScanningProperties.getScanningProperty(Property::PAUSE_ON_FIRST_ITEM)->getFirstValue<double>(), "seconds"); },
-               [this](auto item) {
-                       context_.usScanningProperties.getScanningProperty(Property::PAUSE_ON_FIRST_ITEM)->setState(item->getState());
-                       auto pauseOnFirstValue = context_.usScanningProperties.getScanningProperty(Property::PAUSE_ON_FIRST_ITEM)->getFirstValue<double>();
-                       auto str = getValueUnitText(NULL,
-                               &pauseOnFirstValue,
-                               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-                               !item->getState(),
-                               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-                       item->setDescription(str); },
-               {},
-               GenlistItem::WidgetType::toggle});
-       if (context_.usScanningProperties.getScanningProperty(Property::PAUSE_ON_FIRST_ITEM)->getState()) {
-               pauseOnFirst_->setState(true);
-               auto pauseOnFirstValue = context_.usScanningProperties.getScanningProperty(Property::PAUSE_ON_FIRST_ITEM)->getFirstValue<double>();
-               auto str = getValueUnitText(NULL,
-                       &pauseOnFirstValue,
-                       "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-                       false,
-                       "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-               pauseOnFirst_->setDescription(str);
-       }
-       if (!context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->getState())
-               pauseOnFirst_->disable();
-       auto tapDurationValue = context_.usScanningProperties.getScanningProperty(Property::TAP_DURATION)->getFirstValue<double>();
-       str = getValueUnitText(NULL, &tapDurationValue, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS", !context_.usScanningProperties.getScanningProperty(Property::TAP_DURATION)->getState(), "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-
-       tapDuration_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_TAP_DURATION",
-               str,
-               [this](auto item) {
-                       setValuePage_ = std::make_unique<SetValuePage>(ValueEditorType::NUMERIC_SWITCH, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_TAP_DURATION");
-                       setValuePage_->setSwitch(context_.usScanningProperties.getScanningProperty(Property::TAP_DURATION)->getState());
-                       setValuePage_->addValueChangedCb([this](auto val) {
-                               this->tapDurationValueChangedCb(val);
-                       });
-                       setValuePage_->addSwitchChangedCb([this](auto state) {
-                               this->tapDurationSwitchChangedCb(state);
-                       });
-                       setValuePage_->setDescription("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_TAP_DURATION");
-                       setValuePage_->setRange(RANGE_MIN_TAP_DURATION, RANGE_MAX_TAP_DURATION, STEP_TAP_DURATION);
-                       setValuePage_->setValue(context_.usScanningProperties.getScanningProperty(Property::TAP_DURATION)-> getFirstValue<double>(), "seconds"); },
-               [this](auto item) {
-                       context_.usScanningProperties.getScanningProperty(Property::TAP_DURATION)->setState(item->getState());
-                       auto tapDurationValue = context_.usScanningProperties.getScanningProperty(Property::TAP_DURATION)-> getFirstValue<double>();
-                       auto str = getValueUnitText(NULL,
-                               &tapDurationValue,
-                               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-                               !item->getState(),
-                               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-                       item->setDescription(str); },
-               {},
-               GenlistItem::WidgetType::toggle});
-
-       if (context_.usScanningProperties.getScanningProperty(Property::TAP_DURATION)->getState()) {
-               tapDuration_->setState(true);
-               auto tapDurationValue = context_.usScanningProperties.getScanningProperty(Property::TAP_DURATION)->getFirstValue<double>();
-               auto str = getValueUnitText(NULL,
-                       &tapDurationValue,
-                       "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-                       false,
-                       "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-               tapDuration_->setDescription(str);
-       }
-       auto sglIntInterval = context_.usScanningProperties.getScanningProperty(Property::SINGLE_INTERACTION_INTERVAL)->getFirstValue<double>();
-       str = getValueUnitText(NULL, &sglIntInterval, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS", !context_.usScanningProperties.getScanningProperty(Property::SINGLE_INTERACTION_INTERVAL)->getState(), "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-
-       singleInteractionInterval_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_SGL_IACTION_INT",
-               str,
-               [this](auto item) {
-                       setValuePage_ = std::make_unique<SetValuePage>(ValueEditorType::NUMERIC_SWITCH, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_SGL_IACTION_INT");
-                       setValuePage_->setSwitch(context_.usScanningProperties.getScanningProperty(Property::SINGLE_INTERACTION_INTERVAL)->getState());
-                       setValuePage_->addValueChangedCb([this](auto val) {
-                               this->sglInactionIntervalValueChangedCb(val);
-                       });
-                       setValuePage_->addSwitchChangedCb([this](auto state) {
-                               this->sglInactionIntervalSwitchChangedCb(state);
-                       });
-                       setValuePage_->setDescription("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_SGL_IACTION_INT");
-                       setValuePage_->setRange(RANGE_MIN_SGL_IACTION_INT, RANGE_MAX_SGL_IACTION_INT, STEP_SGL_IACTION_INT);
-                       setValuePage_->setValue(context_.usScanningProperties.getScanningProperty(Property::SINGLE_INTERACTION_INTERVAL)->getFirstValue<double>(), "seconds"); },
-               [this](auto item) {
-                       context_.usScanningProperties.getScanningProperty(Property::SINGLE_INTERACTION_INTERVAL)->setState(item->getState());
-                       auto sglIntInterval = context_.usScanningProperties.getScanningProperty(Property::SINGLE_INTERACTION_INTERVAL)->getFirstValue<double>();
-                       auto str = getValueUnitText(NULL,
-                               &sglIntInterval,
-                               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-                               !item->getState(),
-                               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-                       item->setDescription(str); },
-               {},
-               GenlistItem::WidgetType::toggle});
-
-       if (context_.usScanningProperties.getScanningProperty(Property::SINGLE_INTERACTION_INTERVAL)->getState()) {
-               singleInteractionInterval_->setState(true);
-               auto sglIntInterval = context_.usScanningProperties.getScanningProperty(Property::SINGLE_INTERACTION_INTERVAL)->getFirstValue<double>();
-               str = getValueUnitText(NULL,
-                       &sglIntInterval,
-                       "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-                       false,
-                       "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-               singleInteractionInterval_->setDescription(str);
-       }
-       auto autoTapValue = context_.usScanningProperties.getScanningProperty(Property::AUTO_TAP)->getFirstValue<double>();
-       str = getValueUnitText(NULL, &autoTapValue, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS", !context_.usScanningProperties.getScanningProperty(Property::AUTO_TAP)->getState(), "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-
-       autoTap_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_TAP",
-               str,
-               [this](auto item) {
-                       setValuePage_ = std::make_unique<SetValuePage>(ValueEditorType::NUMERIC_SWITCH, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_TAP");
-                       setValuePage_->setSwitch(context_.usScanningProperties.getScanningProperty(Property::AUTO_TAP)->getState());
-                       setValuePage_->addSwitchChangedCb([this](auto val) {
-                               this->autoTapSwitchChangedCb(val);
-                       });
-                       setValuePage_->addValueChangedCb([this](auto val) {
-                               this->autoTapValueChangedCb(val);
-                       });
-                       setValuePage_->setDescription("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_AUTO_TAP");
-                       setValuePage_->setRange(RANGE_MIN_AUTO_TAP, RANGE_MAX_AUTO_TAP, STEP_AUTO_TAP);
-                       setValuePage_->setValue(context_.usScanningProperties.getScanningProperty(Property::AUTO_TAP)->getFirstValue<double>(), "seconds"); },
-               [this](auto item) {
-                       context_.usScanningProperties.getScanningProperty(Property::AUTO_TAP)->setState(item->getState());
-                       auto autoTapValue = context_.usScanningProperties.getScanningProperty(Property::AUTO_TAP)->getFirstValue<double>();
-                       auto str = getValueUnitText(NULL,
-                               &autoTapValue,
-                               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-                               !item->getState(),
-                               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-                       item->setDescription(str); },
-               {},
-               GenlistItem::WidgetType::toggle});
-
-       if (context_.usScanningProperties.getScanningProperty(Property::AUTO_TAP)->getState()) {
-               autoTap_->setState(true);
-               auto autoTapValue = context_.usScanningProperties.getScanningProperty(Property::AUTO_TAP)->getFirstValue<double>();
-               auto str = getValueUnitText(NULL,
-                       &autoTapValue,
-                       "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-                       false,
-                       "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-               autoTap_->setDescription(str);
-       }
-       auto moveIntervalValue = context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->getFirstValue<double>();
-       str = getValueUnitText(NULL, &moveIntervalValue, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS", !context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->getState(), "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-
-       autoMoveInterval_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_MOVE_INT",
-               str,
-               [this](auto item) {
-                       setValuePage_ = std::make_unique<SetValuePage>(ValueEditorType::NUMERIC_SWITCH, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_MOVE_INT");
-                       setValuePage_->setSwitch(context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->getState());
-                       setValuePage_->addValueChangedCb([this](auto val) {
-                               this->autoMoveIntervalValueChangedCb(val);
-                       });
-                       setValuePage_->addSwitchChangedCb([this](auto state) {
-                               this->autoMoveIntervalSwitchChangedCb(state);
-                       });
-                       setValuePage_->setDescription("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_AUTO_MOVE_INT");
-                       setValuePage_->setRange(RANGE_MIN_AUTO_MOVE_INT, RANGE_MAX_AUTO_MOVE_INT, STEP_AUTO_MOVE_INT);
-                       setValuePage_->setValue(context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->getFirstValue<double>(), "seconds"); },
-               [this](auto item) {
-                       context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->setState(item->getState());
-                       auto moveIntervalValue = context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->getFirstValue<double>();
-                       auto str = getValueUnitText(NULL, &moveIntervalValue, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-                                                                               !item->getState(), "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-                       item->setDescription(str); },
-               {},
-               GenlistItem::WidgetType::toggle});
-       if (context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->getState()) {
-               autoMoveInterval_->setState(true);
-               auto moveIntervalValue = context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->getFirstValue<double>();
-               auto str = getValueUnitText(NULL,
-                       &moveIntervalValue,
-                       "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-                       !context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->getState(),
-                       "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-               autoMoveInterval_->setDescription(str);
-       }
-       if (context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->getState())
-               autoMoveInterval_->disable();
-
-       auto item = genlist_->appendItem({"multiline",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_TAP_KBD",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_TAP_KBD_SUB",
-               [this](auto item) {
-                       context_.usScanningProperties.getScanningProperty(Property::KEYBOARD_AUTO_TAP)->setState(item->getState());
-               },
-               GenlistItem::WidgetType::toggle});
-       item->setState(context_.usScanningProperties.getScanningProperty(Property::KEYBOARD_AUTO_TAP)->getState());
-}
-
-void UniversalSwitchSettingsPage::createScanningGroup()
-{
-       genlist_->appendItem({"group_index", "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING"});
-
-       auto item = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_AUTO_SCAN",
-               {},
-               [this](auto item) {
-                       auto state = item->getState();
-                       context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->setState(state);
-
-                       if (state) {
-                               pauseOnFirst_->enable();
-                               autoMoveInterval_->disable();
-                               autoScanInterval_->enable();
-                               scansNum_->enable();
-                       } else {
-                               pauseOnFirst_->disable();
-                               autoMoveInterval_->enable();
-                               autoScanInterval_->disable();
-                               scansNum_->disable();
-                       }
-               },
-               GenlistItem::WidgetType::toggle});
-       if (context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->getState())
-               item->setState(true);
-       auto autoScanInt = context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->getFirstValue<double>();
-       auto str = getValueUnitText(NULL, &autoScanInt, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS", false, {});
-       autoScanInterval_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_AUTO_SCAN_INT",
-               str,
-               [this](auto item) {
-                       setValuePage_ = std::make_unique<SetValuePage>(
-                               ValueEditorType::NUMERIC, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_AUTO_SCAN_INT");
-                       setValuePage_->addValueChangedCb([this](auto val) { this->autoScanIntervalChangedCb(val); });
-                       setValuePage_->setDescription("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_AUTO_SCAN_INT");
-                       setValuePage_->setRange(RANGE_MIN_AUTO_SCAN_INTERVAL, RANGE_MAX_AUTO_SCAN_INTERVAL, STEP_AUTO_SCAN_INTERVAL);
-                       setValuePage_->setValue(context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->getFirstValue<double>(), "seconds");
-               }});
-       if (!context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->getState())
-               autoScanInterval_->disable();
-
-       scansNum_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_NUM_OF_SCANS",
-               std::to_string(context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->getSecondValue<int>()),
-               [this](auto item) {
-                       setValuePage_ = std::make_unique<SetValuePage>(ValueEditorType::NUMERIC, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_NUM_OF_SCANS");
-                       setValuePage_->addValueChangedCb([this](auto val) { this->scanNumberChangedCb(val); });
-                       setValuePage_->setDescription("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_NUM_OF_SCANS");
-                       setValuePage_->setRange(RANGE_MIN_SCANS_NUM, RANGE_MAX_SCANS_NUM, STEP_SCANS_NUM);
-                       setValuePage_->setValue(context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->getSecondValue<int>(), "times");
-               }});
-       if (!context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->getState())
-               scansNum_->disable();
-
-       scanMethod_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_METHOD",
-               getScanMethodText(context_.usScanningProperties.getScanningProperty(Property::SCAN_METHOD)->getFirstValue<ScanMethod>()),
-               [this](auto item) {
-                       this->createScanMethodCtxPopup();
-               }});
-
-       scanDirection_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_DIR",
-               getScanDirectionText(context_.usScanningProperties.getScanningProperty(Property::SCAN_DIRECTION)->getFirstValue<ScanDirection>()),
-               [this](auto item) {
-                       this->createScanDirectionCtxPopup();
-               }});
-       scanSpeed_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_PT_SPEED",
-               std::to_string(context_.usScanningProperties.getScanningProperty(Property::POINT_SCAN_SPEED)->getFirstValue<int>()),
-               [this](auto item) {
-                       setValuePage_ = std::make_unique<SetValuePage>(ValueEditorType::NUMERIC, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_PT_SPEED");
-                       setValuePage_->addValueChangedCb([this](auto val) { this->scanSpeedChangedCb(val); });
-                       setValuePage_->setDescription("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_SCAN_SPEED");
-                       setValuePage_->setRange(RANGE_MIN_SCAN_SPEED, RANGE_MAX_SCAN_SPEED, STEP_SCAN_SPEED);
-                       setValuePage_->setValue(context_.usScanningProperties.getScanningProperty(Property::POINT_SCAN_SPEED)->getFirstValue<int>(), "");
-               }});
-}
-
-void UniversalSwitchSettingsPage::createSwitchesGroup()
-{
-       switchesItem_ = genlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SWITCHES",
-               {},
-               [this](auto item) {
-                       switchesPage_ = std::make_unique<SwitchesPage>();
-                       switchesPage_->attachCallback(updateSwitchesCount, this);
-               }});
-       updateSwitchesCount(this);
-}
-
-TranslatedString UniversalSwitchSettingsPage::getScanDirectionText(ScanDirection direction)
-{
-       switch (direction) {
-       case ScanDirection::TO_BOTTOM:
-               return "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_DIR_TB";
-       case ScanDirection::TO_TOP:
-               return "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_DIR_BT";
-       default:
-               return "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_UNDEFINED";
-       }
-}
-
-TranslatedString UniversalSwitchSettingsPage::getScanMethodText(ScanMethod method)
-{
-       switch (method) {
-       case ScanMethod::POINT:
-               return "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_METHOD_POINT";
-       case ScanMethod::ROW:
-               return "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_METHOD_ROW";
-       default:
-               return "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_UNDEFINED";
-       }
-}
-
-TranslatedString UniversalSwitchSettingsPage::getValueUnitText(int *ivalue, double *dvalue, const TranslatedString &units, bool def_trigger, const TranslatedString &def)
-{
-       if (def_trigger)
-               return def;
-
-       std::stringstream ss;
-
-       if (ivalue) {
-               ss << *ivalue;
-       } else if (dvalue) {
-               ss.precision(1);
-               ss << std::fixed << *dvalue;
-       }
-
-       if (!units.empty())
-               ss << " " << units.str();
-
-       return ss.str();
-}
-
-void UniversalSwitchSettingsPage::updateSwitchesCount(void *data)
-{
-       RETURN_IF(!data, "Input argument is NULL");
-       auto self = static_cast<UniversalSwitchSettingsPage *>(data);
-
-       int switch_count = setting_accessibility_universal_switch_dbus_config_get_switch_count(&self->context_.config);
-
-       self->switchesItem_->setDescription(getValueUnitText(&switch_count, NULL, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SWITCHES", false, {}));
-}
-
-void UniversalSwitchSettingsPage::feedbackVoiceCb()
-{
-       nestedSetValuePage_ = std::make_unique<SetValuePage>(
-               ValueEditorType::LIST_SWITCH, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE");
-       nestedSetValuePage_->setSwitch(context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->getState());
-       nestedSetValuePage_->setDescription("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_FEEDBACK_VOICE");
-       nestedSetValuePage_->addSwitchChangedCb([this](auto state) {
-               feedbackVoice_->setDescription(
-                       state ? "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON" : "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-               feedbackVoice_->setState(state);
-               context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->setState(state);
-       });
-       auto nestedSetValuePagePtr = nestedSetValuePage_.get();
-       context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->registerOnValueChangeCallback([this, nestedSetValuePagePtr](ScanningProperty *self) {
-               nestedSetValuePagePtr->setCheckState(self->getState());
-       });
-
-       std::string str = std::to_string(static_cast<int>(context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->getFirstValue<double>() * 100)) + "%";
-       feedbackVoiceSpeechRate_ = nestedSetValuePage_->addRadioListItem(
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE_SPEECH_RATE",
-               str.c_str(),
-               static_cast<int>(VoiceFeedbackAttribute::SPEECH_RATE));
-
-       str = std::to_string(static_cast<int>(context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->getSecondValue<double>() * 100)) + "%";
-       feedbackVoiceSpeechVolume_ = nestedSetValuePage_->addRadioListItem(
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE_SPEECH_VOLUME",
-               str.c_str(),
-               static_cast<int>(VoiceFeedbackAttribute::VOLUME));
-
-       nestedSetValuePage_->addListItemOptionsRequestCb([this](auto val) { this->feedbackVoiceItemOptionsRequestCb(val); });
-}
-
-void UniversalSwitchSettingsPage::feedbackVoiceItemOptionsRequestCb(int option_id)
-{
-       auto selValue = 0;
-       auto feedbackType = static_cast<VoiceFeedbackAttribute>(option_id);
-       if (feedbackType == VoiceFeedbackAttribute::SPEECH_RATE) {
-               selValue = static_cast<int>(context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->getFirstValue<double>() * 100);
-               setValuePage_ = std::make_unique<SetValuePage>(ValueEditorType::RADIOS, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE_SPEECH_RATE");
-               setValuePage_->addRadioItemChangedCb([this](auto val) { this->feedbackVoiceSpeechRateChangedCb(val); });
-       } else if (feedbackType == VoiceFeedbackAttribute::VOLUME) {
-               selValue = static_cast<int>(context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->getSecondValue<double>() * 100);
-               setValuePage_ = std::make_unique<SetValuePage>(ValueEditorType::RADIOS, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE_SPEECH_VOLUME");
-               setValuePage_->addRadioItemChangedCb([this](auto val) { this->feedbackVoiceSpeechVolumeChangedCb(val); });
-       } else {
-               DEBUG("Wrong voice feedback attribute");
-               return;
-       }
-
-       for (auto i = 0u; i < mediaLevel.size(); i++)
-               setValuePage_->addRadioItem(mediaLevel[i].first, i, mediaLevel[i].second == static_cast<unsigned int>(selValue));
-}
-
-void UniversalSwitchSettingsPage::feedbackVoiceSpeechVolumeChangedCb(size_t item_id)
-{
-       ASSERT(item_id < mediaLevel.size(), "Invalid item_id");
-
-       double media_level = mediaLevel[item_id].second / 100.0;
-       context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->setSecondValue(media_level);
-
-       feedbackVoiceSpeechVolume_->setDescription(mediaLevel[item_id].first);
-}
-
-void UniversalSwitchSettingsPage::feedbackVoiceSpeechRateChangedCb(size_t item_id)
-{
-       ASSERT(item_id < mediaLevel.size(), "Invalid item_id");
-
-       double media_level = mediaLevel[item_id].second / 100.0;
-       context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->setFirstValue(media_level);
-
-       feedbackVoiceSpeechRate_->setDescription(mediaLevel[item_id].first);
-}
-
-void UniversalSwitchSettingsPage::feedbackSoundCb()
-{
-       std::string str = std::to_string(static_cast<int>((context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_SOUND)->getFirstValue<double>() * 100))) + "%";
-
-       nestedSetValuePage_ = std::make_unique<SetValuePage>(
-               ValueEditorType::LIST_SWITCH, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_SOUND");
-       nestedSetValuePage_->setSwitch(context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_SOUND)->getState());
-       nestedSetValuePage_->setDescription("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_FEEDBACK_SOUND");
-       nestedSetValuePage_->addSwitchChangedCb([this](auto state) { this->feedbackSoundSwitchChangedCb(state); });
-       feedbackSoundVolume_ = nestedSetValuePage_->addRadioListItem("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_SOUND_VOLUME", str.c_str(), 0);
-       nestedSetValuePage_->addListItemOptionsRequestCb([this](auto val) { this->feedbackSoundItemOptionsRequestCb(val); });
-       auto nestedSetValuePagePtr = nestedSetValuePage_.get();
-       context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_SOUND)->registerOnValueChangeCallback([this, nestedSetValuePagePtr](ScanningProperty *self) {
-               nestedSetValuePagePtr->setCheckState(self->getState());
-       });
-}
-
-void UniversalSwitchSettingsPage::feedbackSoundItemOptionsRequestCb(int option_id)
-{
-       setValuePage_ = std::make_unique<SetValuePage>(ValueEditorType::RADIOS, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_SOUND_VOLUME");
-       setValuePage_->addRadioItemChangedCb([this](auto val) { this->feedbackSoundVolumeChangedCb(val); });
-
-       for (auto i = 0u; i < mediaLevel.size(); i++)
-               setValuePage_->addRadioItem(
-                       mediaLevel[i].first, i, mediaLevel[i].second == static_cast<unsigned int>(context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_SOUND)->getFirstValue<double>() * 100));
-}
-
-void UniversalSwitchSettingsPage::feedbackSoundVolumeChangedCb(size_t item_id)
-{
-       ASSERT(item_id < mediaLevel.size(), "Invalid item_id");
-
-       double media_level = mediaLevel[item_id].second / 100.0;
-       context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_SOUND)->setFirstValue(media_level);
-
-       feedbackSoundVolume_->setDescription(mediaLevel[item_id].first);
-}
-
-void UniversalSwitchSettingsPage::feedbackSoundSwitchChangedCb(bool state)
-{
-       context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_SOUND)->setState(state);
-       feedbackSound_->setState(state);
-       feedbackSound_->setDescription(state ? "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON" : "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-}
-
-void UniversalSwitchSettingsPage::cursorColorListItemChangedCb(size_t item_id)
-{
-       ASSERT(item_id < cursorColors.size(), "Invalid cursor color id");
-
-       context_.usScanningProperties.getScanningProperty(Property::CURSOR_COLOR)->setFirstValue<int>(cursorColors[item_id].second);
-       cursorColor_->setDescription(cursorColors[item_id].first);
-}
-
-void UniversalSwitchSettingsPage::autoMoveIntervalSwitchChangedCb(bool state)
-{
-       context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->setState(state);
-       autoMoveInterval_->setState(state);
-       auto moveIntervalValue = context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->getFirstValue<double>();
-       auto str = getValueUnitText(NULL,
-               &moveIntervalValue,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-               !context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->getState(),
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-       autoMoveInterval_->setDescription(str);
-}
-
-void UniversalSwitchSettingsPage::autoTapSwitchChangedCb(bool state)
-{
-       context_.usScanningProperties.getScanningProperty(Property::AUTO_TAP)->setState(state);
-       autoTap_->setState(state);
-       auto autoTapValue = context_.usScanningProperties.getScanningProperty(Property::AUTO_TAP)->getFirstValue<double>();
-       auto str = getValueUnitText(NULL,
-               &autoTapValue,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-               !state,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-       autoTap_->setDescription(str);
-}
-
-void UniversalSwitchSettingsPage::autoTapValueChangedCb(double value)
-{
-       context_.usScanningProperties.getScanningProperty(Property::AUTO_TAP)->setFirstValue(value);
-       auto str = getValueUnitText(NULL,
-               &value,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-               !context_.usScanningProperties.getScanningProperty(Property::AUTO_TAP)->getState(),
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-       autoTap_->setDescription(str);
-}
-
-void UniversalSwitchSettingsPage::sglInactionIntervalSwitchChangedCb(bool state)
-{
-       context_.usScanningProperties.getScanningProperty(Property::SINGLE_INTERACTION_INTERVAL)->setState(state);
-       singleInteractionInterval_->setState(state);
-       auto sglIntInterval = context_.usScanningProperties.getScanningProperty(Property::SINGLE_INTERACTION_INTERVAL)->getFirstValue<double>();
-       auto str = getValueUnitText(NULL,
-               &sglIntInterval,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-               !state,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-       singleInteractionInterval_->setDescription(str);
-}
-
-void UniversalSwitchSettingsPage::sglInactionIntervalValueChangedCb(double value)
-{
-       context_.usScanningProperties.getScanningProperty(Property::SINGLE_INTERACTION_INTERVAL)->setFirstValue(value);
-       auto str = getValueUnitText(NULL, &value, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS", !context_.usScanningProperties.getScanningProperty(Property::SINGLE_INTERACTION_INTERVAL)->getState(), "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-       singleInteractionInterval_->setDescription(str);
-}
-
-void UniversalSwitchSettingsPage::tapDurationSwitchChangedCb(bool state)
-{
-       context_.usScanningProperties.getScanningProperty(Property::TAP_DURATION)->setState(state);
-       tapDuration_->setState(state);
-       auto tapDurationValue = context_.usScanningProperties.getScanningProperty(Property::TAP_DURATION)->getFirstValue<double>();
-       auto str = getValueUnitText(NULL,
-               &tapDurationValue,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-               !state,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-       tapDuration_->setDescription(str);
-}
-
-void UniversalSwitchSettingsPage::tapDurationValueChangedCb(double value)
-{
-       context_.usScanningProperties.getScanningProperty(Property::TAP_DURATION)->setFirstValue(value);
-       auto str = getValueUnitText(NULL,
-               &value,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-               !context_.usScanningProperties.getScanningProperty(Property::TAP_DURATION)->getState(),
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-       tapDuration_->setDescription(str);
-}
-
-void UniversalSwitchSettingsPage::pauseOnFirstSwitchChangedCb(bool state)
-{
-       context_.usScanningProperties.getScanningProperty(Property::PAUSE_ON_FIRST_ITEM)->setState(state);
-       pauseOnFirst_->setState(state);
-       auto pauseOnFirstValue = context_.usScanningProperties.getScanningProperty(Property::PAUSE_ON_FIRST_ITEM)->getFirstValue<double>();
-       auto str = getValueUnitText(NULL,
-               &pauseOnFirstValue,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-               !state,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-       pauseOnFirst_->setDescription(str);
-}
-
-void UniversalSwitchSettingsPage::pauseOnFirstValueChangedCb(double value)
-{
-       context_.usScanningProperties.getScanningProperty(Property::PAUSE_ON_FIRST_ITEM)->setFirstValue(value);
-       auto str = getValueUnitText(NULL,
-               &value,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-               !context_.usScanningProperties.getScanningProperty(Property::PAUSE_ON_FIRST_ITEM)->getState(),
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-       pauseOnFirst_->setDescription(str);
-}
-
-void UniversalSwitchSettingsPage::scanSpeedChangedCb(double value)
-{
-       // TODO change type to avoid below cast
-       context_.usScanningProperties.getScanningProperty(Property::POINT_SCAN_SPEED)->setFirstValue<int>(value);
-       scanSpeed_->setDescription(std::to_string(static_cast<int>(value)));
-}
-
-void UniversalSwitchSettingsPage::createScanDirectionCtxPopup()
-{
-       auto naviframe = Singleton<NavigationContext>::instance().getNaviframe();
-       auto ctxPopup = Widget::make<CtxPopup>(naviframe, true);
-       auto removeCb = [naviframe, ctxPopup]() { naviframe->removeChild(ctxPopup); };
-       ctxPopup->setEvasSmartCallback("dismissed", removeCb);
-       ctxPopup->setEextEventCallback(EEXT_CALLBACK_BACK, removeCb);
-
-       ctxPopup->addItem("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_DIR_TB", [this, removeCb]() {
-               scanDirectionCtxPopupItemClicked(ScanDirection::TO_BOTTOM);
-               removeCb();
-       });
-       ctxPopup->addItem("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_DIR_BT", [this, removeCb]() {
-               scanDirectionCtxPopupItemClicked(ScanDirection::TO_TOP);
-               removeCb();
-       });
-
-       // TODO use real genlistitem position instead click position
-       int y = 0;
-       evas_pointer_output_xy_get(evas_object_evas_get(Singleton<NavigationContext>::instance().getWindow()->getObject()), NULL, &y);
-
-       auto geometry = ctxPopup->getGeometry();
-       ctxPopup->setPosition({-1, y + geometry.size.height / 2});
-}
-
-void UniversalSwitchSettingsPage::scanDirectionCtxPopupItemClicked(ScanDirection scan_dir)
-{
-       context_.usScanningProperties.getScanningProperty(Property::SCAN_DIRECTION)->setFirstValue(scan_dir);
-       scanDirection_->setDescription(getScanDirectionText(scan_dir));
-}
-
-void UniversalSwitchSettingsPage::createScanMethodCtxPopup()
-{
-       auto naviframe = Singleton<NavigationContext>::instance().getNaviframe();
-       auto ctxPopup = Widget::make<CtxPopup>(naviframe, true);
-       auto removeCb = [naviframe, ctxPopup]() { naviframe->removeChild(ctxPopup); };
-       ctxPopup->setEvasSmartCallback("dismissed", removeCb);
-       ctxPopup->setEextEventCallback(EEXT_CALLBACK_BACK, removeCb);
-
-       ctxPopup->addItem("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_METHOD_POINT", [this, removeCb]() {
-               scanMethodCtxPopupItemClicked(ScanMethod::POINT);
-               removeCb();
-       });
-       ctxPopup->addItem("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_METHOD_ROW", [this, removeCb]() {
-               scanMethodCtxPopupItemClicked(ScanMethod::ROW);
-               removeCb();
-       });
-
-       // TODO use real genlistitem position instead click position
-       int y = 0;
-       evas_pointer_output_xy_get(evas_object_evas_get(Singleton<NavigationContext>::instance().getWindow()->getObject()), NULL, &y);
-
-       auto geometry = ctxPopup->getGeometry();
-       ctxPopup->setPosition({-1, y + geometry.size.height / 2});
-}
-
-void UniversalSwitchSettingsPage::scanMethodCtxPopupItemClicked(ScanMethod scan_method)
-{
-       context_.usScanningProperties.getScanningProperty(Property::SCAN_METHOD)->setFirstValue(scan_method);
-       scanMethod_->setDescription(getScanMethodText(scan_method));
-}
-
-void UniversalSwitchSettingsPage::scanNumberChangedCb(double value)
-{
-       context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->setSecondValue(static_cast<int>(value));
-       scansNum_->setDescription(std::to_string(static_cast<double>(value)));
-}
-
-void UniversalSwitchSettingsPage::autoScanIntervalChangedCb(double value)
-{
-       context_.usScanningProperties.getScanningProperty(Property::AUTO_SCAN)->setFirstValue(value);
-       autoScanInterval_->setDescription(
-               getValueUnitText(NULL, &value, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS", false, {}));
-}
-
-void UniversalSwitchSettingsPage::autoMoveIntervalValueChangedCb(double value)
-{
-       context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->setFirstValue(value);
-       auto str = getValueUnitText(NULL,
-               &value,
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS",
-               !context_.usScanningProperties.getScanningProperty(Property::AUTO_MOVE_INTERVAL)->getState(),
-               "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
-       autoMoveInterval_->setDescription(str);
-}
-
-void UniversalSwitchSettingsPage::onManageMenuOptions()
-{
-       auto naviframe = Singleton<NavigationContext>::instance().getNaviframe();
-       auto genlist = Widget::make<Genlist>(naviframe);
-       genlist->setMode(ELM_LIST_COMPRESS);
-       genlist->setStyle("dialogue");
-
-       std::vector<std::pair<Property, std::pair<std::string, std::string>>> manageOptionsData =
-               {
-                       {Property::GESTURES, {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_GESTURES", ""}},
-                       {Property::ACTIONS, {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_ACTIONS", ""}},
-                       {Property::SETTINGS, {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_SETTINGS", ""}},
-                       {Property::RECENT_APPS, {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_RECENT_APPS", ""}},
-                       {Property::HOME_SCREEN, {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_HOME_SCREEN", ""}},
-                       {Property::BACK, {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_BACK", ""}},
-                       {Property::BUTTONS_AND_KEYS, {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_BUTTONS_AND_KEYS", ""}},
-                       {Property::CONTEXTUAL_MENU, {"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_CONTEXTUAL_MENU", "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_CONTEXTUAL_MENU_DESC"}}};
-
-       auto prevBtn = Widget::make<Button>(
-               naviframe, [naviframe, this]() { naviframe->popBack(); }, std::string{}, Button::BACK_BUTTON_ARROW_STYLE);
-
-       for (auto iterator : manageOptionsData) {
-               auto manageOptionsItem = genlist->appendItem({"multiline",
-                       iterator.second.first,
-                       iterator.second.second,
-                       [iterator, this](auto item) {
-                               context_.usScanningProperties.getScanningProperty(iterator.first)->setState(item->getState());
-                       },
-                       GenlistItem::WidgetType::toggle});
-               manageOptionsItem->setState(context_.usScanningProperties.getScanningProperty(iterator.first)->getState());
-       }
-
-       naviframe->pushBack("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE", genlist, [this]() {}, prevBtn);
-}
-
-std::string UniversalSwitchSettingsPage::findCursorColor()
-{
-       for (auto i = 0u; i < cursorColors.size(); i++)
-               if (cursorColors[i].second == static_cast<unsigned int>(context_.usScanningProperties.getScanningProperty(Property::CURSOR_COLOR)->getFirstValue<int>())) {
-                       return cursorColors[i].first;
-               }
-
-       return "Undefined";
-}
diff --git a/src/UniversalSwitchSettingsPage.hpp b/src/UniversalSwitchSettingsPage.hpp
deleted file mode 100644 (file)
index ed7088b..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef UNIVERSAL_SWITCH_SETTINGS_PAGE_HPP
-#define UNIVERSAL_SWITCH_SETTINGS_PAGE_HPP
-
-#include "AppContext.hpp"
-#include "Genlist.hpp"
-#include "GenlistItem.hpp"
-#include "SetValuePage.hpp"
-#include "SwitchesPage.hpp"
-
-#include <string>
-#include <vconf.h>
-
-/**
- * View allowing to configure main options of Universal Switch
- *
- * @param ad global context of application
- *
- * TODO:
- *  replace classical callbacks with lambda expressions
- */
-class UniversalSwitchSettingsPage
-{
-       public:
-       UniversalSwitchSettingsPage();
-
-       private:
-       void createManageGroup();
-       void createFeedbackGroup();
-       void createAdditionalSettingsGroup();
-       void createScanningGroup();
-       void createSwitchesGroup();
-       void createScanMethodCtxPopup();
-       void scanMethodCtxPopupItemClicked(ScanMethod scan_method);
-       void createScanDirectionCtxPopup();
-       void scanDirectionCtxPopupItemClicked(ScanDirection scan_dir);
-       TranslatedString getScanDirectionText(ScanDirection direction);
-       TranslatedString getScanMethodText(ScanMethod method);
-       static TranslatedString getValueUnitText(int *ivalue, double *dvalue, const TranslatedString &units, bool def_trigger, const TranslatedString &def);
-       static void updateSwitchesCount(void *data);
-       void feedbackVoiceCb();
-       void feedbackVoiceItemOptionsRequestCb(int option_id);
-       void feedbackVoiceSpeechVolumeChangedCb(size_t item_id);
-       void feedbackVoiceSpeechRateChangedCb(size_t item_id);
-       void feedbackSoundCb();
-       void feedbackSoundItemOptionsRequestCb(int option_id);
-       void feedbackSoundVolumeChangedCb(size_t item_id);
-       void feedbackSoundSwitchChangedCb(bool state);
-       void cursorColorListItemChangedCb(size_t item_id);
-       void autoMoveIntervalSwitchChangedCb(bool state);
-       void autoTapSwitchChangedCb(bool state);
-       void autoTapValueChangedCb(double value);
-       void sglInactionIntervalSwitchChangedCb(bool state);
-       void sglInactionIntervalValueChangedCb(double value);
-       void tapDurationSwitchChangedCb(bool state);
-       void tapDurationValueChangedCb(double value);
-       void pauseOnFirstSwitchChangedCb(bool state);
-       void pauseOnFirstValueChangedCb(double value);
-       void scanSpeedChangedCb(double value);
-       void scanNumberChangedCb(double value);
-       void autoScanIntervalChangedCb(double value);
-       void autoMoveIntervalValueChangedCb(double value);
-       void onManageMenuOptions();
-       std::string findCursorColor();
-
-       AppContext &context_;
-       Genlist *genlist_ = nullptr;
-       std::unique_ptr<SwitchesPage> switchesPage_;
-       std::unique_ptr<SetValuePage> setValuePage_;
-       std::unique_ptr<SetValuePage> nestedSetValuePage_;
-       GenlistItem *scanDirection_ = nullptr;
-       GenlistItem *scanMethod_ = nullptr;
-       GenlistItem *cursorColor_ = nullptr;
-       GenlistItem *feedbackSoundVolume_ = nullptr;
-       GenlistItem *feedbackSound_ = nullptr;
-       GenlistItem *feedbackVoice_ = nullptr;
-       GenlistItem *feedbackVoiceSpeechRate_ = nullptr;
-       GenlistItem *feedbackVoiceSpeechVolume_ = nullptr;
-       GenlistItem *autoMoveInterval_ = nullptr;
-       GenlistItem *autoTap_ = nullptr;
-       GenlistItem *singleInteractionInterval_ = nullptr;
-       GenlistItem *tapDuration_ = nullptr;
-       GenlistItem *pauseOnFirst_ = nullptr;
-       GenlistItem *scanSpeed_ = nullptr;
-       GenlistItem *scansNum_ = nullptr;
-       GenlistItem *autoScanInterval_ = nullptr;
-       GenlistItem *switchesItem_ = nullptr;
-};
-
-#endif
diff --git a/src/UpdateSwitchPage.cpp b/src/UpdateSwitchPage.cpp
deleted file mode 100644 (file)
index 1b0920b..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "UpdateSwitchPage.hpp"
-
-#include "AccessibilitySettingLog.hpp"
-#include "NavigationContext.hpp"
-#include "Singleton.hpp"
-#include "Toolbar.hpp"
-#include "setting-accessibility.h"
-
-#include <app.h>
-
-#define GRP_SET_VALUE_UPDATE_ACCESSORIES_SWITCH "set-value-update-accessories-switch"
-#define PRT_SET_VALUE_ENTRY "set-value-entry"
-#define PRT_SET_VALUE_DESC "set-value-desc"
-#define EDJ_SET_VALUE "edje/accessibility-settings-set-value.edj"
-#define PRT_SET_VALUE_LIST "set-value-list"
-
-UpdateSwitchPage::UpdateSwitchPage(UniversalSwitchConfigurationItem *config_item)
-       : context_(Singleton<AppContext>::instance())
-{
-       config_item_to_update_.activity_type = config_item->activity_type;
-       config_item_to_update_.switch_id = config_item->switch_id;
-       config_item_to_update_.user_name = config_item->user_name;
-
-       if (config_item->provider_id == ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER) {
-               createUpdateAccessoriesSwitchPage();
-       } else {
-               actionPage_ = std::make_unique<ActionPage>();
-               actionPage_->attachCallback(onActionUpdate, this);
-       }
-}
-
-void UpdateSwitchPage::attachActionCallback(UniversalSwitchCb cb, void *cbData)
-{
-       switch_updated_cb = cb;
-       switch_updated_cb_data = cbData;
-}
-
-void UpdateSwitchPage::onActionUpdate(const std::string &action, void *user_data)
-{
-       auto self = static_cast<UpdateSwitchPage *>(user_data);
-       if (self->switch_updated_cb) {
-               self->switch_updated_cb(self->switch_updated_cb_data,
-                       self->config_item_to_update_.switch_id,
-                       action,
-                       self->config_item_to_update_.user_name);
-       }
-}
-
-void UpdateSwitchPage::createUpdateAccessoriesSwitchPage()
-{
-       auto naviframe = Singleton<NavigationContext>::instance().getNaviframe();
-       layout_ = Widget::make<Layout>(
-               naviframe, "edje/accessibility-settings-set-value.edj", GRP_SET_VALUE_UPDATE_ACCESSORIES_SWITCH);
-       layout_->setPartText(PRT_SET_VALUE_DESC, "IDS_ACCS_UNIVERSAL_SWITCH_NAME");
-
-       auto tabbar = Widget::make<Toolbar>(naviframe);
-       auto backCb = [naviframe, tabbar]() {
-               naviframe->popBack();
-               naviframe->removeChild(tabbar);
-       };
-
-       tabbar->addItem("IDS_ACCS_UNIVERSAL_SWITCH_CANCEL", backCb);
-       tabbar->addItem("IDS_ACCS_UNIVERSAL_SWITCH_SAVE", [this, backCb]() {
-               if (switch_updated_cb) {
-                       switch_updated_cb(switch_updated_cb_data,
-                               config_item_to_update_.switch_id,
-                               config_item_to_update_.activity_type,
-                               entry_->getEntryText());
-               }
-               backCb();
-       });
-
-       entry_ = Widget::make<Entry>(layout_);
-       entry_->setEntryText(config_item_to_update_.user_name);
-       entry_->moveCursorToEnd();
-       layout_->setPartContent(PRT_SET_VALUE_ENTRY, entry_);
-
-       updateAccessoriesActionGenlist_ = createGenlist(layout_, {});
-       updateAccessoriesActionGenlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_ACTION",
-               setting_accessibility_universal_switch_dbus_config_get_activity_name(
-                       &context_.config, config_item_to_update_.activity_type),
-               [this](auto item) { this->updateSwitchAction(); }});
-
-       auto naviItem = naviframe->pushBack({}, layout_, {}, nullptr, "tabbar/notitle");
-       naviItem.setPartContent("tabbar", tabbar);
-}
-
-Genlist *UpdateSwitchPage::createGenlist(Widget *parent, std::string title)
-{
-       auto genlist = Widget::make<Genlist>(parent);
-       genlist->setMode(ELM_LIST_COMPRESS);
-       genlist->setStyle("dialogue");
-
-       if (!title.empty())
-               genlist->appendItem({"group_index", std::move(title)});
-
-       parent->setPartContent(PRT_SET_VALUE_LIST, genlist);
-
-       return genlist;
-}
-
-void UpdateSwitchPage::updateSwitchAction()
-{
-       actionPage_ = std::make_unique<ActionPage>();
-       actionPage_->attachCallback(updateSwitchChooseAction, this);
-}
-
-void UpdateSwitchPage::updateSwitchChooseAction(const std::string &action, void *user_data)
-{
-       auto self = static_cast<UpdateSwitchPage *>(user_data);
-
-       self->config_item_to_update_.activity_type = action;
-       self->updateAccessoriesActionGenlist_->clear();
-
-       self->updateAccessoriesActionGenlist_->appendItem({"type1",
-               "IDS_ACCS_UNIVERSAL_SWITCH_ACTION",
-               setting_accessibility_universal_switch_dbus_config_get_activity_name(
-                       &self->context_.config, self->config_item_to_update_.activity_type),
-               [self](auto item) { self->updateSwitchAction(); }});
-
-       Singleton<NavigationContext>::instance().getNaviframe()->popBack();
-}
diff --git a/src/UpdateSwitchPage.hpp b/src/UpdateSwitchPage.hpp
deleted file mode 100644 (file)
index 907d649..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef UPDATE_SWITCH_PAGE_HPP
-#define UPDATE_SWITCH_PAGE_HPP
-
-#include "ActionPage.hpp"
-#include "AppContext.hpp"
-#include "Entry.hpp"
-#include "Genlist.hpp"
-#include "Layout.hpp"
-
-/**
- * View allowing to edit existing mapping between switches and activities
- *
- * @param ad global context of application
- * @param config_item object containing information about update
- *
- * TODO:
- *  replace classical callbacks with lambda expressions
- */
-class UpdateSwitchPage
-{
-       public:
-       UpdateSwitchPage(UniversalSwitchConfigurationItem *config_item);
-       void attachActionCallback(UniversalSwitchCb cb, void *cbData);
-
-       private:
-       static void onActionUpdate(const std::string &action, void *user_data);
-       void createUpdateAccessoriesSwitchPage();
-       Genlist *createGenlist(Widget *parent, std::string title);
-       void updateSwitchAction();
-       static void updateSwitchChooseAction(const std::string &action, void *user_data);
-
-       AppContext &context_;
-       UniversalSwitchCb switch_updated_cb = nullptr;
-       void *switch_updated_cb_data = nullptr;
-       UniversalSwitchConfigurationItem config_item_to_update_;
-       std::unique_ptr<ActionPage> actionPage_;
-       Elm_Object_Item *save_object_item = nullptr;
-       Genlist *updateAccessoriesActionGenlist_ = nullptr;
-       Layout *layout_ = nullptr;
-       Entry *entry_ = nullptr;
-};
-
-#endif
index 367f473..2389b46 100644 (file)
  */
 
 #include "AccessibilitySettingLog.hpp"
+#include "AppContext.hpp"
 #include "MainPagePresenter.hpp"
 #include "NavigationContext.hpp"
 #include "Singleton.hpp"
-#include "setting-accessibility.h"
 
 #include <app.h>
 #include <appcore-common.h>
index 7823c1b..46a5948 100644 (file)
@@ -1,7 +1,9 @@
 #include "AccessibilityLauncherModel.hpp"
 
 #include "Singleton.hpp"
-#include "setting-accessibility.h"
+
+#define VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_STATE "db/setting/accessibility/accessibility-launcher"
+#define VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_LAUNCH "db/setting/accessibility/accessibility-launcher/launch"
 
 AccessibilityLauncherModel::AccessibilityLauncherModel()
 {
index 3eabb5d..590e351 100644 (file)
@@ -1,6 +1,6 @@
 #include "SingleInteractionIntervalModel.hpp"
 
-#include "setting-accessibility.h"
+#include "UniversalSwitchConstants.hpp"
 
 SingleInteractionIntervalModel::SingleInteractionIntervalModel()
 {
index f79b29a..ff85d50 100644 (file)
@@ -1,6 +1,6 @@
 #include "TapDurationModel.hpp"
 
-#include "setting-accessibility.h"
+#include "UniversalSwitchConstants.hpp"
 
 TapDurationModel::TapDurationModel()
 {
index 8a2dd9e..17f95ca 100644 (file)
@@ -4,7 +4,7 @@
 #include "DBus.hpp"
 #include "Geometry.hpp"
 #include "ObservableProperty.hpp"
-#include "ScanningProperties.hpp"
+#include "UniversalSwitchTypes.hpp"
 #include "VConf.hpp"
 
 class UniversalSwitchSettingsPageModel
index dbfa7d5..e689427 100644 (file)
@@ -22,7 +22,6 @@
 #include "Genlist.hpp"
 #include "Singleton.hpp"
 #include "VConf.hpp"
-#include "setting-accessibility.h"
 #include "utils.hpp"
 
 #include <app.h>
index f878b08..e34b812 100644 (file)
@@ -5,9 +5,7 @@
 #include "Naviframe.hpp"
 #include "Observable.hpp"
 #include "Presenter.hpp"
-#include "ScanningProperties.hpp"
 #include "Window.hpp"
-#include "setting-accessibility-universal-switch-dbus.h"
 
 #include <memory>
 #include <string>
@@ -28,10 +26,6 @@ class AppContext : public Observable<Presenter *, size_t>, public Observable<Mod
        ModalPresenter *modalsBack();
        bool modalsEmpty();
 
-       // TODO: should be private
-       UniversalSwitchDbusConfig config;
-       ScanningProperties usScanningProperties;
-
        private:
        std::vector<std::unique_ptr<Presenter>> presentersStack_;
        std::vector<std::unique_ptr<ModalPresenter>> modalPresentersStack_;
index e91c7b0..9f38c69 100644 (file)
@@ -1,5 +1,6 @@
 #include "MainPagePresenter.hpp"
 
+#include "AppContext.hpp"
 #include "ScreenReaderPresenter.hpp"
 
 #include <app.h>
index 503dbac..fc103b1 100644 (file)
@@ -1,5 +1,6 @@
 #include "UniversalSwitchPagePresenter.hpp"
 
+#include "AppContext.hpp"
 #include "NoSwitchesModalPresenter.hpp"
 #include "UniversalSwitchSettingsPagePresenter.hpp"
 
@@ -34,7 +35,6 @@ UniversalSwitchPagePresenter::UniversalSwitchPagePresenter()
        items.back()->enabled_ = false;
 
        addAction(std::make_unique<Action>("titleRightAction", "IDS_ACCS_SETTINGS_CAPS", [this](auto action) {
-               // universalSwitchSettingsPage_ = std::make_unique<UniversalSwitchSettingsPage>();
                Singleton<AppContext>::instance().push(std::make_unique<UniversalSwitchSettingsPagePresenter>());
        },
                model_.dbusConfigurationServiceState_.value()));
index 86dc703..e2ff3ee 100644 (file)
@@ -3,7 +3,6 @@
 
 #include "ListPresenter.hpp"
 #include "UniversalSwitchPageModel.hpp"
-#include "UniversalSwitchSettingsPage.hpp"
 
 class UniversalSwitchPagePresenter : public ListPresenter
 {
@@ -12,7 +11,6 @@ class UniversalSwitchPagePresenter : public ListPresenter
        ~UniversalSwitchPagePresenter();
 
        private:
-       std::unique_ptr<UniversalSwitchSettingsPage> universalSwitchSettingsPage_;
        UniversalSwitchPageModel model_;
 };
 
index 752bda2..8107592 100644 (file)
@@ -13,6 +13,7 @@
 #include "SoundPresenter.hpp"
 #include "SwitchesPagePresenter.hpp"
 #include "TapDurationPresenter.hpp"
+#include "UniversalSwitchTypes.hpp"
 #include "VoicePresenter.hpp"
 
 UniversalSwitchSettingsPagePresenter::UniversalSwitchSettingsPagePresenter()
index 6489159..35c54a1 100644 (file)
@@ -11,9 +11,9 @@
 #include "PointScanSpeedModel.hpp"
 #include "SingleInteractionIntervalModel.hpp"
 #include "SoundModel.hpp"
-#include "SwitchesPage.hpp"
 #include "TapDurationModel.hpp"
 #include "UniversalSwitchSettingsPageModel.hpp"
+#include "UniversalSwitchTypes.hpp"
 #include "VoiceModel.hpp"
 
 class UniversalSwitchSettingsPagePresenter : public ListPresenter
@@ -41,8 +41,6 @@ class UniversalSwitchSettingsPagePresenter : public ListPresenter
        SoundModel soundModel_;
        VoiceModel voiceModel_;
        CursorColorModel cursorColorModel_;
-
-       std::unique_ptr<SwitchesPage> switchesPage_;
 };
 
 #endif
\ No newline at end of file
diff --git a/src/setting-accessibility-universal-switch-dbus.cpp b/src/setting-accessibility-universal-switch-dbus.cpp
deleted file mode 100644 (file)
index 548c71e..0000000
+++ /dev/null
@@ -1,480 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "setting-accessibility-universal-switch-dbus.h"
-
-#include "AccessibilitySettingLog.hpp"
-#include "setting-accessibility.h"
-
-#define BUS "org.tizen.UniversalSwitch"
-#define PATH "/org/tizen/UniversalSwitch"
-#define IFACE "org.tizen.UniversalSwitch"
-#define ELDBUS_TIMEOUT 400.0
-
-static void __bus_name_acquired(void *data, const char *bus, const char *old_id, const char *new_id);
-
-static Eina_Bool __eldbus_init(UniversalSwitchDbusConfig *config)
-{
-       UniversalSwitchEldbus *eldbus = &config->eldbus;
-       eldbus->dobj = NULL;
-       eldbus->proxy = NULL;
-       eldbus->capture_switch_request = NULL;
-
-       eldbus->is_init = eldbus_init();
-       if (!eldbus->is_init) {
-               ERROR("DBus initialization failed");
-               return EINA_FALSE;
-       }
-
-       if (!(eldbus->conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION))) {
-               ERROR("Connection to session bus failed");
-               return EINA_FALSE;
-       }
-
-       eldbus_name_owner_changed_callback_add(eldbus->conn, BUS, __bus_name_acquired, config, EINA_TRUE);
-
-       return EINA_TRUE;
-}
-
-static void __eldbus_shutdown(UniversalSwitchDbusConfig *config)
-{
-       UniversalSwitchEldbus *eldbus = &config->eldbus;
-
-       if (!eldbus->is_init)
-               return;
-
-       if (eldbus->conn)
-               eldbus_name_owner_changed_callback_del(eldbus->conn, BUS, __bus_name_acquired, config);
-
-       if (eldbus->capture_switch_request)
-               eldbus_pending_cancel(eldbus->capture_switch_request);
-       eldbus->capture_switch_request = NULL;
-
-       if (eldbus->proxy)
-               eldbus_proxy_unref(eldbus->proxy);
-       eldbus->proxy = NULL;
-
-       if (eldbus->dobj)
-               eldbus_object_unref(eldbus->dobj);
-       eldbus->dobj = NULL;
-
-       if (eldbus->conn)
-               eldbus_connection_unref(eldbus->conn);
-       eldbus->conn = NULL;
-
-       eldbus_shutdown();
-}
-
-static void __eldbus_getInfoArray(std::vector<UniversalSwitchInfoType *> &infoTypes, Eldbus_Message *reply)
-{
-       Eldbus_Message_Iter *array;
-       Eldbus_Message_Iter *struct_sss;
-       if (!eldbus_message_arguments_get(reply, "a(sss)", &array)) {
-               ERROR("Error on eldbus_message_arguments_get()");
-               return;
-       }
-       while (eldbus_message_iter_get_and_next(array, 'r', &struct_sss)) {
-               char *id = NULL;
-               char *name = NULL;
-               char *description = NULL;
-               if (!eldbus_message_iter_arguments_get(struct_sss, "sss", &id, &name, &description)) {
-                       ERROR("Error on eldbus_message_arguments_get()");
-                       return;
-               }
-               auto info = new UniversalSwitchInfoType;
-
-               info->id = id;
-               info->name = name;
-               info->description = description;
-               infoTypes.push_back(info);
-       }
-}
-
-static std::vector<UniversalSwitchInfoType *> __eldbus_getAllSwitchesByProviderId(
-       UniversalSwitchEldbus *eldbus,
-       const std::string &provider_id)
-{
-       Eldbus_Message *req = NULL;
-       Eldbus_Message *reply = NULL;
-       Eldbus_Message_Iter *iter = NULL;
-       const char *errname = NULL;
-       const char *errmsg = NULL;
-
-       if (!(req = eldbus_proxy_method_call_new(eldbus->proxy, "getAllSwitchesByProviderId"))) {
-               ERROR("Failed to create method call on " IFACE ".getAllSwitchesByProviderId");
-               return {};
-       }
-       iter = eldbus_message_iter_get(req);
-       eldbus_message_iter_arguments_append(iter, "s", provider_id.c_str());
-
-       std::vector<UniversalSwitchInfoType *> switches;
-       reply = eldbus_proxy_send_and_block(eldbus->proxy, req, ELDBUS_TIMEOUT);
-       if (!reply || eldbus_message_error_get(reply, &errname, &errmsg))
-               ERROR("Unable to call method " IFACE ".getAllSwitchesByProviderId: %s %s", errname, errmsg);
-       else
-               __eldbus_getInfoArray(switches, reply);
-
-       if (reply)
-               eldbus_message_unref(reply);
-
-       return switches;
-}
-
-static std::vector<UniversalSwitchSwitchProvider *> __eldbus_getAllSwitchProviders(UniversalSwitchEldbus *eldbus)
-{
-       Eldbus_Message *req = NULL;
-       Eldbus_Message *reply = NULL;
-       const char *errname = NULL;
-       const char *errmsg = NULL;
-
-       if (!(req = eldbus_proxy_method_call_new(eldbus->proxy, "getAllSwitchProviders"))) {
-               ERROR("Failed to create method call on " IFACE ".getAllSwitchProviders");
-               return {};
-       }
-
-       std::vector<UniversalSwitchSwitchProvider *> switch_providers;
-       reply = eldbus_proxy_send_and_block(eldbus->proxy, req, ELDBUS_TIMEOUT);
-       if (!reply || eldbus_message_error_get(reply, &errname, &errmsg)) {
-               ERROR("Unable to call method " IFACE ".getAllSwitchProviders: %s %s", errname, errmsg);
-
-       } else {
-               std::vector<UniversalSwitchInfoType *> switch_providers_info;
-               if (true) {
-                       __eldbus_getInfoArray(switch_providers_info, reply);
-
-                       for (auto &it : switch_providers_info) {
-                               auto switch_provider = new UniversalSwitchSwitchProvider;
-                               switch_provider->info = it;
-                               switch_provider->switches = __eldbus_getAllSwitchesByProviderId(eldbus, it->id);
-                               switch_providers.push_back(switch_provider);
-                       }
-               } else
-                       ERROR("Switch Providers could not be initialized!");
-       }
-
-       if (reply)
-               eldbus_message_unref(reply);
-
-       return switch_providers;
-}
-
-static std::vector<UniversalSwitchInfoType *> __eldbus_getBindableActivityTypes(UniversalSwitchEldbus *eldbus)
-{
-       Eldbus_Message *req = NULL;
-       Eldbus_Message *reply = NULL;
-       const char *errname = NULL;
-       const char *errmsg = NULL;
-
-       if (!(req = eldbus_proxy_method_call_new(eldbus->proxy, "getBindableActivityTypes"))) {
-               ERROR("Failed to create method call on " IFACE ".getBindableActivityTypes");
-               return {};
-       }
-
-       std::vector<UniversalSwitchInfoType *> activity_types;
-       reply = eldbus_proxy_send_and_block(eldbus->proxy, req, ELDBUS_TIMEOUT);
-       if (!reply || eldbus_message_error_get(reply, &errname, &errmsg)) {
-               ERROR("Unable to call method " IFACE ".getBindableActivityTypes: %s %s", errname, errmsg);
-       } else {
-               __eldbus_getInfoArray(activity_types, reply);
-       }
-
-       if (reply)
-               eldbus_message_unref(reply);
-
-       return activity_types;
-}
-
-static void __eldbus_getAllSwitchConfigurationItemsArray(
-       std::vector<UniversalSwitchConfigurationItem *> &infoTypes,
-       Eldbus_Message *reply)
-{
-
-       Eldbus_Message_Iter *array;
-       Eldbus_Message_Iter *struct_sssi;
-
-       if (!eldbus_message_arguments_get(reply, "a(sssi)", &array)) {
-               ERROR("Error on eldbus_message_arguments_get()");
-               return;
-       }
-       while (eldbus_message_iter_get_and_next(array, 'r', &struct_sssi)) {
-               char *switchId;
-               char *userName;
-               char *activityType;
-               int changeType;
-
-               if (!eldbus_message_iter_arguments_get(struct_sssi, "sssi", &switchId, &userName, &activityType, &changeType)) {
-                       ERROR("Error on eldbus_message_arguments_get()\n");
-                       return;
-               }
-               char *pointer_to_end_of_switch_provider_str = strstr(switchId, "_");
-               if (!pointer_to_end_of_switch_provider_str) {
-                       ERROR("Wrong switch ID format");
-                       return;
-               }
-               size_t provider_id_size = pointer_to_end_of_switch_provider_str - switchId;
-               auto item = new UniversalSwitchConfigurationItem;
-               item->provider_id = std::string{switchId, provider_id_size};
-               item->switch_id = switchId;
-               item->user_name = userName;
-               item->activity_type = activityType;
-               infoTypes.push_back(item);
-       }
-}
-
-static std::vector<UniversalSwitchConfigurationItem *> __eldbus_getAllSwitchConfigurationItems(UniversalSwitchEldbus *eldbus)
-{
-       Eldbus_Message *req = NULL;
-       Eldbus_Message *reply = NULL;
-       const char *errname = NULL;
-       const char *errmsg = NULL;
-
-       if (!(req = eldbus_proxy_method_call_new(eldbus->proxy, "getAllSwitchConfigurationItems"))) {
-               ERROR("Failed to create method call on " IFACE ".getAllSwitchConfigurationItems");
-               return {};
-       }
-
-       std::vector<UniversalSwitchConfigurationItem *> configurationItems;
-       reply = eldbus_proxy_send_and_block(eldbus->proxy, req, ELDBUS_TIMEOUT);
-       if (!reply || eldbus_message_error_get(reply, &errname, &errmsg)) {
-               ERROR("Unable to call method " IFACE ".getAllSwitchConfigurationItems: %s %s", errname, errmsg);
-       } else {
-               __eldbus_getAllSwitchConfigurationItemsArray(configurationItems, reply);
-       }
-
-       if (reply)
-               eldbus_message_unref(reply);
-
-       return configurationItems;
-}
-
-static void __relese_configuration_items(UniversalSwitchDbusConfig *config)
-{
-       for (auto &it : config->configuration_items) {
-               delete it;
-       }
-
-       config->configuration_items = {};
-}
-
-static void __relese_info_type(UniversalSwitchInfoType *info)
-{
-       if (!info)
-               return;
-
-       delete info;
-}
-
-static void __relese_info_type_array(std::vector<UniversalSwitchInfoType *> &infoArray)
-{
-       for (auto &it : infoArray)
-               delete it;
-
-       infoArray = {};
-}
-
-static void __relese_activity_types(UniversalSwitchDbusConfig *config)
-{
-       if (config->activity_types.empty())
-               return;
-
-       __relese_info_type_array(config->activity_types);
-       config->activity_types = {};
-}
-
-static void __relese_switch_providers(UniversalSwitchDbusConfig *config)
-{
-       if (config->switch_providers.empty())
-               return;
-
-       for (auto &it : config->switch_providers) {
-               __relese_info_type(it->info);
-               __relese_info_type_array(it->switches);
-               delete it;
-       }
-
-       config->switch_providers = {};
-}
-
-static void __update_configuration_items(UniversalSwitchDbusConfig *config)
-{
-       __relese_configuration_items(config);
-       config->configuration_items = __eldbus_getAllSwitchConfigurationItems(&config->eldbus);
-}
-
-static void __bus_name_acquired(void *data, const char *bus, const char *old_id, const char *new_id)
-{
-       DEBUG("dbus name acquired, bus=%s, old_id=%s, new_id=%s", bus, old_id, new_id);
-
-       if (!new_id || strlen(new_id) == 0)
-               return;
-
-       auto config = static_cast<UniversalSwitchDbusConfig *>(data);
-       UniversalSwitchEldbus *eldbus = &config->eldbus;
-
-       if (!eldbus->dobj && !(eldbus->dobj = eldbus_object_get(eldbus->conn, BUS, PATH))) {
-               ERROR("Failed to create eldbus object for " PATH);
-               return;
-       }
-
-       if (!eldbus->proxy && !(eldbus->proxy = eldbus_proxy_get(eldbus->dobj, IFACE))) {
-               ERROR("Failed to create proxy object for " IFACE);
-               return;
-       }
-
-       config->activity_types = __eldbus_getBindableActivityTypes(&config->eldbus);
-       config->switch_providers = __eldbus_getAllSwitchProviders(&config->eldbus);
-       __update_configuration_items(config);
-
-       if (eldbus->init_done_callback) {
-               eldbus->init_done_callback(eldbus->init_done_callback_data);
-               eldbus->init_done_callback = NULL;
-               eldbus->init_done_callback_data = NULL;
-       }
-}
-
-Eina_Bool setting_accessibility_universal_switch_dbus_config_init(
-       UniversalSwitchDbusConfig *config,
-       init_done_cb callback,
-       void *callback_data)
-{
-
-       config->eldbus.init_done_callback = callback;
-       config->eldbus.init_done_callback_data = callback_data;
-       Eina_Bool v = __eldbus_init(config);
-
-       return v;
-}
-
-int setting_accessibility_universal_switch_dbus_config_get_switch_count(UniversalSwitchDbusConfig *config)
-{
-       return config->configuration_items.size();
-}
-
-void setting_accessibility_universal_switch_dbus_config_addSwitchConfigurationItem(
-       UniversalSwitchDbusConfig *config,
-       const std::string &switch_id,
-       const std::string &user_name,
-       const std::string &activity_type)
-{
-       DEBUG("Running " IFACE ".addSwitchConfigurationItem(%s, %s ,%s)", switch_id.c_str(), user_name.c_str(), activity_type.c_str());
-       eldbus_proxy_call(
-               config->eldbus.proxy, "addSwitchConfigurationItem", NULL, NULL, ELDBUS_TIMEOUT, "sss", switch_id.c_str(), user_name.c_str(), activity_type.c_str());
-       __update_configuration_items(config);
-}
-void setting_accessibility_universal_switch_dbus_config_updateSwitchConfigurationItem(
-       UniversalSwitchDbusConfig *config,
-       const std::string &switch_id,
-       const std::string &user_name,
-       const std::string &activity_type)
-{
-       DEBUG("Running " IFACE ".updateSwitchConfigurationItem(%s, %s ,%s)", switch_id.c_str(), user_name.c_str(), activity_type.c_str());
-       eldbus_proxy_call(
-               config->eldbus.proxy, "updateSwitchConfigurationItem", NULL, NULL, ELDBUS_TIMEOUT, "sss", switch_id.c_str(), user_name.c_str(), activity_type.c_str());
-       __update_configuration_items(config);
-}
-
-void setting_accessibility_universal_switch_dbus_config_removeSwitchConfigurationItem(
-       UniversalSwitchDbusConfig *config,
-       const std::string &switch_id)
-{
-       DEBUG("Running " IFACE ".removeSwitchConfigurationItem(%s)", switch_id.c_str());
-       eldbus_proxy_call(config->eldbus.proxy, "removeSwitchConfigurationItem", NULL, NULL, ELDBUS_TIMEOUT, "s", switch_id.c_str());
-       __update_configuration_items(config);
-}
-
-void setting_accessibility_universal_switch_dbus_config_shutdown(UniversalSwitchDbusConfig *config)
-{
-       __relese_configuration_items(config);
-       __relese_activity_types(config);
-       __relese_switch_providers(config);
-       __eldbus_shutdown(config);
-}
-
-std::string setting_accessibility_universal_switch_dbus_config_get_activity_name(
-       UniversalSwitchDbusConfig *config,
-       const std::string &activity_id)
-{
-       for (auto &it : config->activity_types)
-               if (it->id == activity_id)
-                       return it->name;
-
-       return {};
-}
-std::vector<UniversalSwitchInfoType *> setting_accessibility_universal_switch_dbus_config_get_switches(
-       UniversalSwitchDbusConfig *config,
-       const std::string &provider_id)
-{
-       for (auto &it : config->switch_providers)
-               if (it->info->id == provider_id)
-                       return it->switches;
-       return {};
-}
-
-static void __eldbus_on_capture_switch(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
-{
-       auto eldbus = static_cast<UniversalSwitchEldbus *>(data);
-       const char *errname, *errmsg;
-       const char *switch_id = NULL;
-
-       if (eldbus_message_error_get(msg, &errname, &errmsg)) {
-               DEBUG("Error: %s %s", errname, errmsg);
-       } else {
-               if (!eldbus_message_arguments_get(msg, "s", &switch_id))
-                       ERROR("Could not get switch_id");
-       }
-
-       DEBUG("DBus got captureSwitch %s", switch_id);
-
-       if (eldbus->capture_switch_callback) {
-               eldbus->capture_switch_callback(eldbus->capture_switch_data, switch_id);
-               eldbus->capture_switch_callback = NULL;
-       }
-       eldbus->capture_switch_request = NULL;
-}
-
-void setting_accessibility_universal_switch_dbus_config_captureSwitch(
-       UniversalSwitchDbusConfig *config,
-       const std::string &provider_id,
-       double timeout,
-       capture_switch_cb callback,
-       void *callback_data)
-{
-       UniversalSwitchEldbus *eldbus = &config->eldbus;
-       DEBUG("DBus call captureSwitch for %s", provider_id.c_str());
-       eldbus->capture_switch_request = eldbus_proxy_call(
-               eldbus->proxy, "captureSwitch", __eldbus_on_capture_switch, eldbus, timeout, "s", provider_id.c_str());
-       if (eldbus->capture_switch_request) {
-               eldbus->capture_switch_callback = callback;
-               eldbus->capture_switch_data = callback_data;
-       } else {
-               ERROR("Dbus call to captureSwitch failed");
-       }
-}
-
-void setting_accessibility_universal_switch_dbus_config_cancelCaptureSwitch(UniversalSwitchDbusConfig *config)
-{
-       UniversalSwitchEldbus *eldbus = &config->eldbus;
-
-       DEBUG("Running " IFACE ".cancelCaptureSwitch");
-       eldbus_proxy_call(config->eldbus.proxy, "cancelCaptureSwitch", NULL, NULL, ELDBUS_TIMEOUT, "");
-
-       DEBUG("DBus call captureSwitch canceled");
-       eldbus->capture_switch_callback = NULL;
-       if (eldbus->capture_switch_request) {
-               eldbus_pending_cancel(eldbus->capture_switch_request);
-               eldbus->capture_switch_request = NULL;
-       }
-}
diff --git a/src/setting-accessibility-universal-switch-dbus.h b/src/setting-accessibility-universal-switch-dbus.h
deleted file mode 100644 (file)
index d39a056..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SETTINGACCESSIBILITYUNIVERSALSWITCHDBUS_H
-#define SETTINGACCESSIBILITYUNIVERSALSWITCHDBUS_H
-
-#include <Eldbus.h>
-#include <string>
-#include <vector>
-
-typedef void (*capture_switch_cb)(void *data, const std::string &switch_id);
-typedef void (*init_done_cb)(void *data);
-
-struct UniversalSwitchEldbus
-{
-       Eldbus_Connection *conn = nullptr;
-       Eldbus_Object *dobj = nullptr;
-       Eldbus_Proxy *proxy = nullptr;
-
-       Eldbus_Pending *capture_switch_request = nullptr;
-
-       capture_switch_cb capture_switch_callback;
-       void *capture_switch_data = nullptr;
-
-       init_done_cb init_done_callback;
-       void *init_done_callback_data = nullptr;
-
-       Eina_Bool is_init = EINA_FALSE;
-};
-
-struct UniversalSwitchInfoType
-{
-       std::string id;
-       std::string name;
-       std::string description;
-};
-
-struct UniversalSwitchConfigurationItem
-{
-       std::string switch_id;
-       std::string user_name;
-       std::string activity_type;
-       std::string provider_id;
-};
-
-struct UniversalSwitchSwitchProvider
-{
-       UniversalSwitchInfoType *info;
-       std::vector<UniversalSwitchInfoType *> switches;
-};
-
-struct UniversalSwitchDbusConfig
-{
-       UniversalSwitchEldbus eldbus;
-       std::vector<UniversalSwitchInfoType *> activity_types;
-       std::vector<UniversalSwitchConfigurationItem *> configuration_items;
-       std::vector<UniversalSwitchSwitchProvider *> switch_providers;
-};
-
-Eina_Bool setting_accessibility_universal_switch_dbus_config_init(
-       UniversalSwitchDbusConfig *config, init_done_cb callback, void *callback_data);
-int setting_accessibility_universal_switch_dbus_config_get_switch_count(UniversalSwitchDbusConfig *config);
-std::string setting_accessibility_universal_switch_dbus_config_get_activity_name(
-       UniversalSwitchDbusConfig *config, const std::string &activity_id);
-std::vector<UniversalSwitchInfoType *> setting_accessibility_universal_switch_dbus_config_get_switches(
-       UniversalSwitchDbusConfig *config, const std::string &provider_id);
-void setting_accessibility_universal_switch_dbus_config_shutdown(UniversalSwitchDbusConfig *config);
-void setting_accessibility_universal_switch_dbus_config_addSwitchConfigurationItem(
-       UniversalSwitchDbusConfig *config, const std::string &switch_id, const std::string &user_name, const std::string &activity_type);
-void setting_accessibility_universal_switch_dbus_config_updateSwitchConfigurationItem(
-       UniversalSwitchDbusConfig *config, const std::string &switch_id, const std::string &user_name, const std::string &activity_type);
-void setting_accessibility_universal_switch_dbus_config_removeSwitchConfigurationItem(
-       UniversalSwitchDbusConfig *config, const std::string &switch_id);
-
-void setting_accessibility_universal_switch_dbus_config_captureSwitch(
-       UniversalSwitchDbusConfig *config, const std::string &provider_id, double timeout, capture_switch_cb callback, void *calback_data);
-void setting_accessibility_universal_switch_dbus_config_cancelCaptureSwitch(UniversalSwitchDbusConfig *config);
-
-#endif /* SETTINGACCESSIBILITYUNIVERSALSWITCHDBUS_H */
diff --git a/src/setting-accessibility.h b/src/setting-accessibility.h
deleted file mode 100644 (file)
index 8feefc1..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __SETTING_ACCESSIBILITY_H__
-#define __SETTING_ACCESSIBILITY_H__
-
-#include "setting-accessibility-universal-switch-dbus.h"
-
-#include <Elementary.h>
-#include <app_event.h>
-#include <tts.h>
-
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_CONFIGURATION_SERVICE "db/setting/accessibility/universal-switch/configuration-service"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_INTERACTION_SERVICE "db/setting/accessibility/universal-switch/interaction-service"
-
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_STATE "db/setting/accessibility/accessibility-launcher"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_LAUNCH "db/setting/accessibility/accessibility-launcher/launch"
-
-#define ACCESSIBILITY_UNIVERSAL_SWITCH_SCREEN_SWITCH_PROVIDER "ScreenSwitchProvider"
-#define ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER "AccessoriesSwitchProvider"
-#define ACCESSIBILITY_UNIVERSAL_SWITCH_CAMERA_SWITCH_PROVIDER "CameraSwitchProvider"
-#define ACCESSIBILITY_UNIVERSAL_SWITCH_SCREEN "Screen"
-
-#define ACCESSIBILITY_UNIVERSAL_SWITCH_PLUS_ICON RESDIR "/icons/plus.png"
-
-#define VCONF_MEMORY_TYPE "db/"
-#define VCONF_PROJECT_NAME "setting/accessibility/universal-switch/"
-#define VCONF_PROJECT_PREFIX VCONF_MEMORY_TYPE VCONF_PROJECT_NAME
-
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCAN_ENABLED VCONF_PROJECT_PREFIX "AUTO_SCAN_ENABLED"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCAN_INT VCONF_PROJECT_PREFIX "AUTO_SCAN_INTERVAL"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_NUM_OF_SCANS VCONF_PROJECT_PREFIX "LOOP_LIMIT_TO_INACTION"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_METHOD VCONF_PROJECT_PREFIX "SCAN_METHOD"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_DIR_VERTICAL VCONF_PROJECT_PREFIX "SCAN_DIRECTION_VERTICAL"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_DIR_HORIZONTA VCONF_PROJECT_PREFIX "SCAN_DIRECTION_HORIZONTAL"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_PT_SPEED VCONF_PROJECT_PREFIX "SCAN_PT_SPEED"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_PAUSE_ON_FIRST_STATE VCONF_PROJECT_PREFIX "PAUSE_ON_FIRST_ELEMENT_ENABLED"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_PAUSE_ON_FIRST_VALUE VCONF_PROJECT_PREFIX "PAUSE_ON_FIRST_ELEMENT_TIME"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_TAP_DURATION_STATE VCONF_PROJECT_PREFIX "TAP_DURATION_ENABLED"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_TAP_DURATION_VALUE VCONF_PROJECT_PREFIX "TAP_DURATION_VALUE"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SGL_IACTION_INT_STATE VCONF_PROJECT_PREFIX "SGL_INACTION_INT_ENABLED"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SGL_IACTION_INT_VALUE VCONF_PROJECT_PREFIX "SGL_INACTION_INT_VALUE"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_STATE VCONF_PROJECT_PREFIX "AUTO_TAP_ENABLED"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_VALUE VCONF_PROJECT_PREFIX "AUTO_TAP_WAITING_TIME"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_STATE VCONF_PROJECT_PREFIX "AUTO_MOVE_INT_ENABLED"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_VALUE VCONF_PROJECT_PREFIX "AUTO_MOVE_INT_VALUE"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_KBD_STATE VCONF_PROJECT_PREFIX "AUTO_TAP_KBD_ENABLED"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_CURSOR_COLOR VCONF_PROJECT_PREFIX "FEEDBACK_CURSOR_COLOR"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE VCONF_PROJECT_PREFIX "FEEDBACK_SOUND_ENABLED"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_VOLUME VCONF_PROJECT_PREFIX "FEEDBACK_SOUND_VOLUME"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE VCONF_PROJECT_PREFIX "FEEDBACK_VOICE_ENABLED"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_SPEECH_RATE VCONF_PROJECT_PREFIX "FEEDBACK_VOICE_SPEECH_RATE"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_SPEECH_VOLUME VCONF_PROJECT_PREFIX "FEEDBACK_VOICE_SPEECH_VOLUME"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCROLL_ENABLED VCONF_PROJECT_PREFIX "AUTO_SCROLL_ENABLED"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_GRANULARITY_UNIT VCONF_PROJECT_PREFIX "GRANULARITY_UNIT"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_ACTIONS VCONF_PROJECT_PREFIX "SHOW_ACTIONS_MENU_ITEM"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_SETTINGS VCONF_PROJECT_PREFIX "SHOW_SETTINGS_MENU_ITEM"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_HOMESCREEN VCONF_PROJECT_PREFIX "SHOW_HOME_SCREEN_MENU_ITEM"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_KEYS VCONF_PROJECT_PREFIX "SHOW_BUTTONS_AND_KEYS_MENU_ITEM"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_CONTEXTUAL_MENU VCONF_PROJECT_PREFIX "SHOW_CONTEXTUAL_MENU"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_GESTURES VCONF_PROJECT_PREFIX "SHOW_GESTURES_MENU_ITEM"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_RECENT_APPS VCONF_PROJECT_PREFIX "SHOW_RECENT_APPS_MENU_ITEM"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_BACK VCONF_PROJECT_PREFIX "SHOW_BACK_MENU_ITEM"
-
-#endif /*__SETTING_ACCESSIBILITY_H__ */
index ddde58b..ebb8143 100644 (file)
@@ -11,6 +11,18 @@ enum class ChangeType : int32_t
        NONE
 };
 
+enum class ScanMethod
+{
+       POINT = 1,
+       ROW
+};
+
+enum class ScanDirection
+{
+       TO_BOTTOM = 1,
+       TO_TOP
+};
+
 struct SwitchConfigurationItem
 {
        std::string switchId;