2 * Copyright 2012 Samsung Electronics Co., Ltd
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
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 <ui-gadget-module.h>
18 #include <Elementary.h>
20 #include <dpl/assert.h>
25 namespace WebAppCommonSetting {
27 void MainView::onListViewUnload(void *data)
31 mainView = static_cast<MainView *>(data);
33 ug_destroy_me(mainView->getUG());
36 Evas_Object *MainView::createContent(Evas_Object *parent)
41 nf = elm_naviframe_add(parent);
46 m_list.Reset(new ListView(nf));
47 if (!m_list->loadView())
49 m_list->setUnloadCb(onListViewUnload, this);
52 } catch (const std::bad_alloc &) {
64 bool MainView::loadView(void)
73 parent = static_cast<Evas_Object *>(ug_get_parent_layout(m_ug));
76 ly = elm_layout_add(parent);
79 elm_layout_theme_set(ly, "layout", "application", "default");
84 elm_object_part_content_set(ly, "elm.swallow.bg", eo);
86 eo = createContent(ly);
89 elm_object_part_content_set(ly, "elm.swallow.content", eo);
101 MainView::MainView(ui_gadget_h ug) :
109 MainView::~MainView(void)
113 } /* WebAppCommonSetting */