3 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an AS IS BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include <Elementary.h>
19 #include <app_debug.h>
24 #include "view_user.h"
25 #include "view_user_edit.h"
26 #include "data_user.h"
37 static Evas_Object *_create(Evas_Object *win, void *data)
44 _ERR("Invalid argument");
48 priv = calloc(1, sizeof(*priv));
50 _ERR("failed to calloc priv");
54 dm = datamgr_init(datamgr_user_get_dclass(), VIEW_USER);
56 _ERR("failed to initialize datamgr");
61 base = utils_add_layout(win, GRP_USER, false, NULL);
63 _ERR("failed to create base");
68 evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
69 elm_win_resize_object_add(win, base);
75 viewmgr_set_view_data(VIEW_USER, priv);
76 viewmgr_add_view(view_user_edit_get_vclass(), dm);
81 static void _show(void *data)
86 _ERR("Invalid argument");
92 evas_object_show(priv->base);
95 static void _hide(void *data)
100 _ERR("Invalid argument");
106 evas_object_hide(priv->base);
109 static void _destroy(void *data)
114 _ERR("Invalid argument");
120 viewmgr_remove_view(VIEW_USER_EDIT);
121 datamgr_fini(priv->dm);
122 evas_object_del(priv->base);
126 static view_class vclass = {
127 .view_id = VIEW_USER,
134 view_class *view_user_get_vclass(void)