Added mime_type_set test code 43/132343/4
authorInHong Han <inhong1.han@samsung.com>
Fri, 2 Jun 2017 10:00:14 +0000 (19:00 +0900)
committerInHong Han <inhong1.han@samsung.com>
Mon, 12 Jun 2017 05:00:06 +0000 (14:00 +0900)
Change-Id: I087b23fc4f3ac781e4847aae095afbcc540ce075

ism/demos/Makefile.am
ism/demos/include/isf_mime_type_efl.h [new file with mode: 0644]
ism/demos/include/isf_prediction_hint_efl.h
ism/demos/isf_demo_efl.cpp
ism/demos/isf_mime_type_efl.cpp [new file with mode: 0644]
ism/demos/isf_prediction_hint_efl.cpp

index 0f9d078..4b17145 100644 (file)
@@ -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 (file)
index 0000000..8ea2724
--- /dev/null
@@ -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 <jihoon48.kim@samsung.com>, Inhong Han <inhong1.han@samsung.com>
+ *
+ * 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 <Elementary.h>
+
+void ise_mime_type_bt (void *data, Evas_Object *obj, void *event_info);
+
+#endif /* __ISE_MIME_TYPE_H */
+
+/*
+vi:ts=4:ai:nowrap:expandtab
+*/
index e5a6d1b..cc14d2a 100644 (file)
@@ -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 <jihoon48.kim@samsung.com>, Inhong Han <inhong1.han@samsung.com>
  *
index 41df87d..d0bd2be 100644 (file)
@@ -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 (file)
index 0000000..524ecc9
--- /dev/null
@@ -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 <jihoon48.kim@samsung.com>, Inhong Han <inhong1.han@samsung.com>
+ *
+ * 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
+*/
index a9002e8..fb8098e 100644 (file)
@@ -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 <jihoon48.kim@samsung.com>, Inhong Han <inhong1.han@samsung.com>
  *