Stubs for all views added
[apps/native/gear-racing-controller.git] / src / view / view_reset.c
1 /*
2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3 *
4 * Licensed under the Flora License, Version 1.1 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://floralicense.org/license/
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 #include "gear-racing-controller.h"
18 #include "view/view_base.h"
19 #include "view/view_reset.h"
20 #include "view_manager/view_manager.h"
21 #include "controller/controller_reset.h"
22
23 typedef struct _s_view_reset {
24         Evas_Object *layout;
25 } s_view_reset;
26
27 static s_view_reset s_info = { 0,};
28
29 static void _layout_back_cb(void *data, Evas_Object *obj, void *event_info)
30 {
31         elm_win_lower(view_manager_get_win());
32         controller_reset_back_btn();
33 }
34
35 static void _ok_button_clicked_cb(void *data, Evas_Object *obj, void *event_info)
36 {
37         controller_reset_next_page();
38 }
39
40 static void _view_reset_create_gui(Evas_Object *parent)
41 {
42         s_info.layout = view_base_create_layout(parent);
43         eext_object_event_callback_add(s_info.layout, EEXT_CALLBACK_BACK, _layout_back_cb, NULL);
44         elm_layout_text_set(s_info.layout, "txt_title", "Reset");
45
46         view_base_create_button(s_info.layout, "Button_Ok", "Ok", _ok_button_clicked_cb, NULL);
47         view_base_create_button(s_info.layout, "Button_Cancel", "Cancel", NULL, NULL);
48 }
49
50 void view_reset_init(Evas_Object *parent)
51 {
52         controller_reset_init(NULL);
53         _view_reset_create_gui(parent);
54 }