2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
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
8 * http://floralicense.org/license/
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 #include "view/view_base.h"
18 #include "view/view_connect_to_car.h"
19 #include "view_manager/view_manager.h"
20 #include "controller/controller_connect_to_car.h"
22 typedef struct _s_connect_to_car {
23 s_view_base view_base;
26 static s_connect_to_car s_info = { {0,}, };
28 static void _layout_back_cb(void *data, Evas_Object *obj, void *event_info)
30 elm_win_lower(view_manager_get_win());
31 controller_connect_to_car_back();
34 static void _ok_button_clicked_cb(void *data, Evas_Object *obj, void *event_info)
36 controller_connect_to_car_next();
39 static void connect_to_car_create_gui(Evas_Object *parent)
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", "Connect to a car?");
45 view_base_create_button(s_info.view_base.layout, "Button_Cancel", NULL, "images/no.png", "racing_left", NULL, NULL);
46 view_base_create_button(s_info.view_base.layout, "Button_Ok", NULL, "images/yes.png", "racing_right", _ok_button_clicked_cb, NULL);
50 s_view_base *view_connect_to_car_init(Evas_Object *parent)
52 connect_to_car_create_gui(parent);
53 controller_connect_to_car_init(NULL);
55 return &s_info.view_base;