Custom style created for buttons
[apps/native/gear-racing-controller.git] / src / view / view_name_input.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 "view/view_base.h"
18 #include "view/view_name_input.h"
19 #include "view_manager/view_manager.h"
20 #include "controller/controller_name_input.h"
21
22 typedef struct _ss_view_name_input {
23         s_view_base view_base;
24 } s_view_name_input;
25
26 static s_view_name_input s_info = { {0,}, };
27
28 static void _layout_back_cb(void *data, Evas_Object *obj, void *event_info)
29 {
30         elm_win_lower(view_manager_get_win());
31         controller_name_input_back();
32 }
33
34 static void _ok_button_clicked_cb(void *data, Evas_Object *obj, void *event_info)
35 {
36         controller_name_input_next();
37 }
38
39 static void _view_name_input_create_gui(Evas_Object *parent)
40 {
41         s_info.view_base.layout = view_base_create_layout(parent, EDJ_FILE, GRP_MAIN);
42         eext_object_event_callback_add(s_info.view_base.layout, EEXT_CALLBACK_BACK, _layout_back_cb, NULL);
43         elm_layout_text_set(s_info.view_base.layout, "txt_title", "Name input");
44
45         view_base_create_button(s_info.view_base.layout, "Button_Ok", "Ok",  NULL, NULL, _ok_button_clicked_cb, NULL);
46         view_base_create_button(s_info.view_base.layout, "Button_Cancel", "Cancel",  NULL, NULL, NULL, NULL);
47 }
48
49 s_view_base *view_name_input_init(Evas_Object *parent)
50 {
51         controller_name_input_init(NULL);
52         _view_name_input_create_gui(parent);
53
54         return &s_info.view_base;
55 }