Code sync
[apps/native/starter.git] / lock-setting / lockapp-setting / src / openlock-setting-util.c
1  /*
2   * Copyright 2012  Samsung Electronics Co., Ltd
3   *
4   * Licensed under the Flora License, Version 1.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.tizenopensource.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
18
19 #include "openlock-setting-debug.h"
20 #include "openlock-setting-util.h"
21
22 Evas_Object *openlock_setting_util_create_navigation(Evas_Object * parent)
23 {
24         Evas_Object *navi_bar = NULL;
25
26         if (parent == NULL) {
27                 OPENLOCKS_WARN("Parent is null.");
28                 return NULL;
29         }
30
31         navi_bar = elm_naviframe_add(parent);
32         if (navi_bar == NULL) {
33                 OPENLOCKS_ERR("Cannot add naviagtionbar.");
34                 return NULL;
35         }
36
37         elm_object_part_content_set(parent, "elm.swallow.content", navi_bar);
38
39         evas_object_show(navi_bar);
40
41         return navi_bar;
42 }
43
44 Evas_Object *openlock_setting_util_create_layout(Evas_Object * parent)
45 {
46         Evas_Object *layout = NULL;
47
48         if (parent == NULL) {
49                 OPENLOCKS_WARN("Parent is null.");
50                 return NULL;
51         }
52
53         layout = elm_layout_add(parent);
54         if (layout == NULL) {
55                 OPENLOCKS_ERR("Cannot add layout.");
56                 return NULL;
57         }
58
59         evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
60                                          EVAS_HINT_EXPAND);
61
62         evas_object_show(layout);
63
64         return layout;
65 }