Add update of GenlistItem fields when text and description are changed
[profile/mobile/apps/native/accessibility-setting.git] / src / ScreenSwitchPage.hpp
1 /*
2  * Copyright 2018 Samsung Electronics Co., Ltd
3  *
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
7  *
8  *  http://www.apache.org/licenses/LICENSE-2.0
9
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.
15  */
16
17 #ifndef SCREEN_SWITCH_PAGE_HPP
18 #define SCREEN_SWITCH_PAGE_HPP
19
20 #include "ActionPage.hpp"
21 #include "AppContext.hpp"
22
23 /**
24  * View allowing to configure switches provided by ScreenSwitchProvider.
25  *
26  * Currently there is only one switch provided by ScreenSwitch provider
27  * so this class automatically transfers to ActionPage view.
28  *
29  * @param ad global context of application
30  *
31  * TODO:
32  *  replace classical callbacks with lambda expressions
33  */
34 class ScreenSwitchPage
35 {
36         public:
37         ScreenSwitchPage(NaviframeItem targetItem);
38         void attachActionCallback(UniversalSwitchCb cb, void *cbData);
39
40         private:
41         static void actionCb(const std::string &action, void *user_data);
42
43         AppContext &context_;
44         std::unique_ptr<ActionPage> actionPage_;
45
46         UniversalSwitchCb switch_added_cb = nullptr;
47         void *switch_added_cb_data = nullptr;
48 };
49
50 #endif