2 * Copyright 2018 Samsung Electronics Co., Ltd
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef ACCESSORIES_SWITCHES_PAGE_HPP
18 #define ACCESSORIES_SWITCHES_PAGE_HPP
20 #include "ActionPage.hpp"
21 #include "AppContext.hpp"
22 #include "setting-accessibility.h"
24 #include <Elementary.h>
27 * View allowing to configure switches provided by AccessoriesSwitchProvider.
29 * @param ad global context of application
32 * replace classical callbacks with lambda expressions
34 class AccessoriesSwitchesPage
37 AccessoriesSwitchesPage(NaviframeItem targetItem);
38 void attachActionCallback(UniversalSwitchCb cb, void *cbData);
41 static void captureSwitchCb(void *user_data, const std::string &switch_id);
42 static void accessorySwitchActionCb(const std::string &action, void *user_data);
43 static Eina_Bool renewCaptureSwitchCb(void *data, Elm_Object_Item *it);
44 void alreadyMappedSwitchPopup(); // TODO rename
45 void newSwitchPopup();
48 UniversalSwitchCb accessories_switch_added_cb;
49 void *accessories_switch_added_cb_data = nullptr;
50 std::string switchName_; // TODO remove when lambda expression would be added
51 std::unique_ptr<ActionPage> actionPage_;
52 NaviframeItem targetItem_;
55 const std::string EDJ_ACCESSORY = "edje/accessibility-smart-switch-accessory.edj";
56 const std::string PRT_ACCESSORY_LABEL = "accessory_label";
57 const std::string EDJ_ACCESSORY_POPUP = "edje/accessibility-smart-switch-accessory-popup.edj";
58 const std::string PRT_ACCESSORY_POPUP_ENTRY = "accessory_popup_entry";
59 const std::string GRP_ACCESSORY_POPUP = "accessory_popup";
60 const std::string GRP_ACCESSORY = "accessory";
61 const std::string PRT_ACCESSORY_POPUP_LABEL = "accessory_popup_label";