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 UPDATE_SWITCH_PAGE_HPP
18 #define UPDATE_SWITCH_PAGE_HPP
20 #include "ActionPage.hpp"
21 #include "AppContext.hpp"
23 #include "Genlist.hpp"
27 * View allowing to edit existing mapping between switches and activities
29 * @param ad global context of application
30 * @param config_item object containing information about update
33 * replace classical callbacks with lambda expressions
35 class UpdateSwitchPage
38 UpdateSwitchPage(UniversalSwitchConfigurationItem *config_item);
39 void attachActionCallback(UniversalSwitchCb cb, void *cbData);
42 static void onActionUpdate(const std::string &action, void *user_data);
43 void createUpdateAccessoriesSwitchPage();
44 Genlist *createGenlist(Widget *parent, std::string title);
45 void updateSwitchAction();
46 static void updateSwitchChooseAction(const std::string &action, void *user_data);
49 UniversalSwitchCb switch_updated_cb = nullptr;
50 void *switch_updated_cb_data = nullptr;
51 UniversalSwitchConfigurationItem config_item_to_update_;
52 std::unique_ptr<ActionPage> actionPage_;
53 Elm_Object_Item *save_object_item = nullptr;
54 Genlist *updateAccessoriesActionGenlist_ = nullptr;
55 Layout *layout_ = nullptr;
56 Entry *entry_ = nullptr;