From: InHong Han Date: Fri, 2 Jun 2017 10:00:14 +0000 (+0900) Subject: Added mime_type_set test code X-Git-Tag: accepted/tizen/unified/20170613.194647~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F132343%2F4;p=platform%2Fcore%2Fuifw%2Fisf.git Added mime_type_set test code Change-Id: I087b23fc4f3ac781e4847aae095afbcc540ce075 --- diff --git a/ism/demos/Makefile.am b/ism/demos/Makefile.am index 0f9d078..4b17145 100644 --- a/ism/demos/Makefile.am +++ b/ism/demos/Makefile.am @@ -41,6 +41,7 @@ isf_demo_efl_SOURCES = isf_demo_efl.cpp \ isf_ondemand_efl.cpp \ isf_input_hint_efl.cpp \ isf_password_mode_efl.cpp \ + isf_mime_type_efl.cpp \ isf_demo_autotest.cpp isf_demo_efl_CXXFLAGS = @ECOREX_CFLAGS@ \ diff --git a/ism/demos/include/isf_mime_type_efl.h b/ism/demos/include/isf_mime_type_efl.h new file mode 100644 index 0000000..8ea2724 --- /dev/null +++ b/ism/demos/include/isf_mime_type_efl.h @@ -0,0 +1,36 @@ +/* + * ISF(Input Service Framework) + * + * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. + * Copyright (c) 2012-2017 Samsung Electronics Co., Ltd. + * + * Contact: Jihoon Kim , Inhong Han + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef __ISE_MIME_TYPE_H +#define __ISE_MIME_TYPE_H + +#include + +void ise_mime_type_bt (void *data, Evas_Object *obj, void *event_info); + +#endif /* __ISE_MIME_TYPE_H */ + +/* +vi:ts=4:ai:nowrap:expandtab +*/ diff --git a/ism/demos/include/isf_prediction_hint_efl.h b/ism/demos/include/isf_prediction_hint_efl.h index e5a6d1b..cc14d2a 100644 --- a/ism/demos/include/isf_prediction_hint_efl.h +++ b/ism/demos/include/isf_prediction_hint_efl.h @@ -2,7 +2,7 @@ * ISF(Input Service Framework) * * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2012-2017 Samsung Electronics Co., Ltd. * * Contact: Jihoon Kim , Inhong Han * diff --git a/ism/demos/isf_demo_efl.cpp b/ism/demos/isf_demo_efl.cpp index 41df87d..d0bd2be 100644 --- a/ism/demos/isf_demo_efl.cpp +++ b/ism/demos/isf_demo_efl.cpp @@ -46,6 +46,7 @@ #include "isf_ondemand_efl.h" #include "isf_input_hint_efl.h" #include "isf_password_mode_efl.h" +#include "isf_mime_type_efl.h" #include "isf_demo_autotest.h" #include "tizen_profile.h" @@ -78,6 +79,7 @@ static struct _menu_item isf_demo_menu_its[] = { { "ISF Password Mode", ise_password_mode_bt }, { "ISF IM Data", ise_imdata_set_bt }, { "ISF ondemand", ise_ondemand_bt }, + { "ISF MIME Type", ise_mime_type_bt }, { "ISF Focus Movement", isf_focus_movement_bt }, { "ISF Popup test", isf_popup_bt }, { "ISF Event", isf_event_demo_bt }, diff --git a/ism/demos/isf_mime_type_efl.cpp b/ism/demos/isf_mime_type_efl.cpp new file mode 100644 index 0000000..524ecc9 --- /dev/null +++ b/ism/demos/isf_mime_type_efl.cpp @@ -0,0 +1,75 @@ +/* + * ISF(Input Service Framework) + * + * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. + * Copyright (c) 2012-2017 Samsung Electronics Co., Ltd. + * + * Contact: Jihoon Kim , Inhong Han + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include "isf_demo_efl.h" +#include "isf_mime_type_efl.h" + +static Evas_Object *_create_ef_layout (Evas_Object *parent, const char *label, const char *guide_text, const char *mime_type) +{ + Evas_Object *en; + Evas_Object *ef = create_ef (parent, label, guide_text, &en); + if (!ef || !en) return NULL; + + Ecore_IMF_Context *ic = NULL; + ic = (Ecore_IMF_Context *)elm_entry_imf_context_get (en); + + ecore_imf_context_mime_type_accept_set (ic, mime_type); + + return ef; +} + +static Evas_Object * create_inner_layout (void *data) +{ + struct appdata *ad = (struct appdata *)data; + Evas_Object *bx = NULL; + Evas_Object *ef = NULL; + + Evas_Object *parent = ad->naviframe; + + bx = elm_box_add (parent); + evas_object_size_hint_weight_set (bx, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set (bx, EVAS_HINT_FILL, 0.0); + evas_object_show (bx); + + const char *mime_type; + mime_type = "text/plain"; + ef = _create_ef_layout (parent, _("MIME type: text/plain"), _("click to enter"), mime_type); + elm_box_pack_end (bx, ef); + + mime_type = "text/plain,image/*,video/*,application/mime"; + ef = _create_ef_layout (parent, _("MIME type: text/plain,image/*,video/*,application/mime"), _("click to enter"), mime_type); + elm_box_pack_end (bx, ef); + + return bx; +} + +void ise_mime_type_bt (void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *lay_inner = create_inner_layout (data); + add_layout_to_naviframe (data, lay_inner, _("MIME Type")); +} + +/* +vi:ts=4:ai:nowrap:expandtab +*/ diff --git a/ism/demos/isf_prediction_hint_efl.cpp b/ism/demos/isf_prediction_hint_efl.cpp index a9002e8..fb8098e 100644 --- a/ism/demos/isf_prediction_hint_efl.cpp +++ b/ism/demos/isf_prediction_hint_efl.cpp @@ -2,7 +2,7 @@ * ISF(Input Service Framework) * * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2012-2017 Samsung Electronics Co., Ltd. * * Contact: Jihoon Kim , Inhong Han *