/* * Copyright 2012 Samsung Electronics Co., Ltd * * Licensed under the Flora License, Version 1.0 (the "License"); * * You may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.tizenopensource.org/license * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and limitations under the License. */ #include "mf-ug-util.h" #include "mf-ug-winset.h" #include "mf-ug-resource.h" /****************************** ** Prototype : mfPopupCreate ** Description : ** Input : void *data ** ePopMode popupMode ** char *title ** char *context ** char *first_btn_text ** char *second_btn_text ** char *third_btn_text ** Evas_Smart_Cb func ** void* param ** Output : None ** Return Value : ** Calls : ** Called By : ** ** History : ** 1.Date : 2010/12/10 ** Author : Samsung ** Modification : Created function ** ******************************/ void mf_ug_popup_create(void *data, mf_ug_popup_mode popupMode, char *title, char *context, char *first_btn_text, char *second_btn_text, char *third_btn_text, Evas_Smart_Cb func, void *param) { Evas_Object *popup; ugData *ugd = (ugData *)data; ug_mf_retm_if(ugd == NULL, "ugd is NULL"); Evas_Object *btn1 = NULL; Evas_Object *btn2 = NULL; popup = elm_popup_add(ugd->ug_MainWindow.ug_pMainLayout); ugd->ug_MainWindow.ug_pNormalPopup = popup; evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); if (title) { elm_object_part_text_set(popup, "elm.title", title); } if (context && popupMode != UG_POPMODE_PROGRESSBAR) { elm_object_text_set(popup, context); } switch (popupMode) { case UG_POPMODE_TEXT: case UG_POPMODE_TITLE_TEXT: elm_popup_timeout_set(popup, 3); if (func) { evas_object_smart_callback_add(popup, "response", (Evas_Smart_Cb) func, param); } break; case UG_POPMODE_TEXT_TWO_BTN: case UG_POPMODE_TITLE_TEXT_TWO_BTN: btn1 = __ug_mf_popup_button_create(popup, first_btn_text); btn2 = __ug_mf_popup_button_create(popup, second_btn_text); evas_object_smart_callback_add(btn1, "clicked", func, param); evas_object_smart_callback_add(btn2, "clicked", func, param); elm_object_part_content_set(popup, "button1", btn1); elm_object_part_content_set(popup, "button2", btn2); break; case UG_POPMODE_TEXT_BTN: case UG_POPMODE_TITLE_TEXT_BTN: btn1 = __ug_mf_popup_button_create(popup, MF_UG_LABEL_OK); evas_object_smart_callback_add(btn1, "clicked", func, param); elm_object_part_content_set(popup, "button1", btn1); break; default: return; } evas_object_show(popup); }