2 * Copyright 2012 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 <Elementary.h>
18 #include <ui-gadget.h>
20 #include <dpl/assert.h>
24 namespace WebAppCommonSetting {
26 bool Popup::showPopup(const char *desc,
28 Evas_Smart_Cb cancel_cb,
35 evas_object_del(m_pu);
37 m_pu = elm_popup_add(m_win);
40 evas_object_size_hint_weight_set(m_pu,
43 elm_object_text_set(m_pu, desc);
45 btn1 = elm_button_add(m_pu);
47 evas_object_del(m_pu);
50 elm_object_text_set(btn1, "OK");
51 evas_object_smart_callback_add(btn1, "clicked", ok_cb, data);
52 elm_object_part_content_set(m_pu, "button1", btn1);
54 btn2 = elm_button_add(m_pu);
56 evas_object_del(m_pu);
59 elm_object_text_set(btn2, "Cancel");
60 evas_object_smart_callback_add(btn2, "clicked", cancel_cb, data);
61 elm_object_part_content_set(m_pu, "button2", btn2);
63 evas_object_show(m_pu);
68 void Popup::hidePopup(void)
71 evas_object_del(m_pu);
80 m_win = static_cast<Evas_Object *>(ug_get_window());
87 evas_object_del(m_pu);
90 } /* WebAppCommonSetting */