<toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug.966772140" name="Tizen Native Toolchain" superClass="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.1146520664" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
<builder autoBuildTarget="all" buildPath="${workspace_loc:/tbtcoreapp}/Debug" enableAutoBuild="true" id="org.tizen.nativecore.target.sbi.gnu.builder.482328865" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecore.target.sbi.gnu.builder"/>
- <tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.921707253" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
+ <tool command="arm-linux-gnueabi-ar" id="org.tizen.nativecore.tool.sbi.gnu.archiver.921707253" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
<tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.1141142708" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
<option id="gnu.cpp.compiler.option.optimization.level.1995167770" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="sbi.gnu.cpp.compiler.option.debugging.level.core.1231413559" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="sbi.gnu.cpp.compiler.option.94795005" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
- <listOptionValue builtIn="false" value="mobile-4.0-device.core_llvm37.armel.core.app"/>
+ <listOptionValue builtIn="false" value="mobile-4.0-device.core_llvm40.armel"/>
</option>
<option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.1151584155" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/asp/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/privacy-privilege-manager/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/service-adaptor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/shortcut""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tef""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/telephony""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.705018152" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
<option id="sbi.gnu.c.compiler.option.debugging.level.core.1866251786" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="sbi.gnu.c.compiler.option.828406008" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
- <listOptionValue builtIn="false" value="mobile-4.0-device.core_llvm37.armel.core.app"/>
+ <listOptionValue builtIn="false" value="mobile-4.0-device.core_llvm40.armel"/>
</option>
<option id="sbi.gnu.c.compiler.option.frameworks_inc.core.2054553498" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/asp/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/privacy-privilege-manager/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/service-adaptor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/shortcut""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tef""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/telephony""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
- <tool command="arm-linux-gnueabi-as" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.692653264" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
+ <tool command="#{PLATFORM_DEFAULT_GCC_PREFIX}as" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.692653264" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1386960240" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="org.tizen.nativecore.tool.fnmapgen.2050008912" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
<toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.release.100788679" name="Tizen Native Toolchain" superClass="org.tizen.nativecore.toolchain.sbi.gcc45.app.release">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.2024417825" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
<builder buildPath="${workspace_loc:/tbtcoreapp}/Release" id="org.tizen.nativecore.target.sbi.gnu.builder.262999466" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecore.target.sbi.gnu.builder"/>
- <tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.1926911209" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
+ <tool command="i586-linux-gnueabi-ar" id="org.tizen.nativecore.tool.sbi.gnu.archiver.1926911209" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
<tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.1390758993" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
<option id="gnu.cpp.compiler.option.optimization.level.491448994" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="sbi.gnu.cpp.compiler.option.debugging.level.core.570472136" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core"/>
<option id="sbi.gnu.cpp.compiler.option.1605381289" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
- <listOptionValue builtIn="false" value="mobile-3.0-emulator.core_llvm37.i386.core.app"/>
+ <listOptionValue builtIn="false" value="mobile-4.0-emulator.core_llvm40.i386"/>
</option>
<option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.117486491" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/EGL""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES3""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/KHR""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/asp/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/attach-panel""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/badge""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/base""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/privacy-privilege-manager/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/service-adaptor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/shortcut""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tef""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/telephony""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1195619816" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
<option id="sbi.gnu.c.compiler.option.debugging.level.core.1479764417" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core"/>
<option id="sbi.gnu.c.compiler.option.789625662" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
- <listOptionValue builtIn="false" value="mobile-3.0-emulator.core_llvm37.i386.core.app"/>
+ <listOptionValue builtIn="false" value="mobile-4.0-emulator.core_llvm40.i386"/>
</option>
<option id="sbi.gnu.c.compiler.option.frameworks_inc.core.1046681201" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/EGL""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES3""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/KHR""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/asp/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/attach-panel""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/badge""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/base""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/privacy-privilege-manager/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/service-adaptor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/shortcut""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tef""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/telephony""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
- <tool command="i386-linux-gnueabi-as" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1856546451" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
+ <tool command="#{PLATFORM_DEFAULT_GCC_PREFIX}as" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1856546451" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1371467971" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="org.tizen.nativecore.tool.fnmapgen.318987509" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ *******************************************************************************/
+/**
+ * @file tbt-cbhm-callbacks.c
+ * @brief Checks cbhm callbacks added, removed for item change, monitor add and get type of item copied to clipboard
+ *
+ * @author Maneesha Karn (maneesha.k@samsung.com)
+ * @date November, 2017
+ * @bug NA
+ * @credit
+ *
+ */
+
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_CBHM
+
+#include <Elementary.h>
+#include <locations.h>
+
+#include "utils/logger.h"
+#include "utils/config.h"
+#include "utils/ui-utils.h"
+#include "view/tbt-cbhm-view.h"
+#include "view/tbt-common-view.h"
+#include "utils/config.h"
+#include "cbhm.h"
+
+bool __is_cbhm_test_running = false;
+
+struct _cbhm_callbacks_view {
+ common_view* view;
+ location_manager_h manager;
+
+ Evas_Object *lat_label;
+ Evas_Object *lon_label;
+ Evas_Object *button1;
+ Evas_Object *button2;
+ Evas_Object *button3;
+ Evas_Object *button4;
+ Evas_Object *editfield;
+ tbt_app_type_e apptype;
+ cbhm_h cbhm_handle;
+ bool callbackAdded;
+ bool monitorAdded;
+};
+
+static void _app_destroy_cb(void* this);
+static Evas_Object *add_control_layout(cbhm_callbacks_view *this,
+ Evas_Object *parent);
+static void update(cbhm_callbacks_view *this);
+static void _add_cb_button_pressed_cb(void *data, Evas_Object *obj,
+ void *event_info);
+static void _rem_cb_button_pressed_cb(void *data, Evas_Object *obj,
+ void *event_info);
+static void _clear_label_button_pressed_cb(void *data, Evas_Object *obj,
+ void *event_info);
+static void _show_clipboard_button_pressed_cb(void *data, Evas_Object *obj,
+ void *event_info);
+static void _add_monitor_callback_button_pressed_cb(void *data, Evas_Object *obj,
+ void *event_info);
+static void _remove_monitor_callback_button_pressed_cb(void *data, Evas_Object *obj,
+ void *event_info);
+static void on_cbhm_item_changed(cbhm_h cbhm_handle, int item_count,
+ void *data);
+static void on_monitor_item_changed(cbhm_h cbhm_handle, bool active_state,
+ void *data);
+static void _text_type_button_pressed_cb(void *data, Evas_Object *obj,
+ void *event_info);
+static void _markup_type_button_pressed_cb(void *data, Evas_Object *obj,
+ void *event_info);
+static void _html_type_button_pressed_cb(void *data, Evas_Object *obj,
+ void *event_info);
+static void _selection_type_set_cb(cbhm_sel_type_e type,
+ void *data);
+static void _selection_type_show(void *data, Evas_Object *obj,
+ void *event_info);
+static char *get_selection_type(cbhm_sel_type_e type);
+
+
+static char *get_selection_type(cbhm_sel_type_e type)
+{
+ char msg[40];
+ switch(type)
+ {
+ case CBHM_SEL_TYPE_TEXT :
+ snprintf(msg, sizeof(msg), "CBHM_SEL_TYPE_TEXT");
+ break;
+ case CBHM_SEL_TYPE_HTML :
+ snprintf(msg, sizeof(msg), "CBHM_SEL_TYPE_HTML");
+ break;
+ case CBHM_SEL_TYPE_MARKUP :
+ snprintf(msg, sizeof(msg), "CBHM_SEL_TYPE_MARKUP");
+ break;
+ case CBHM_SEL_TYPE_NONE :
+ snprintf(msg, sizeof(msg), "CBHM_SEL_TYPE_NONE");
+ break;
+ case CBHM_SEL_TYPE_IMAGE :
+ snprintf(msg, sizeof(msg), "CBHM_SEL_TYPE_IMAGE");
+ break;
+ default :
+ snprintf(msg, sizeof(msg), "Unknow Type");
+
+ }
+ return strdup(msg);
+}
+
+
+/**
+ * @function cbhm_callbacks_view_add
+ * @since_tizen 4.0
+ * @description CBHM Callbacks View Add
+ * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer
+ * @return cbhm_callbacks_view*
+ */
+cbhm_callbacks_view *cbhm_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item)
+{
+
+ RETVM_IF(NULL == navi, NULL, "navi is null");
+
+ int nRet;
+ char msg[100];
+ cbhm_callbacks_view *this = NULL;
+
+ this = calloc(1, sizeof(cbhm_callbacks_view));
+ RETVM_IF(!this, NULL, "calloc failed");
+
+ this->view = calloc(1, sizeof(common_view));
+ RETVM_IF(!this->view, NULL, "calloc failed");
+
+ tbt_info->layout_group = "cbhm_test";
+ tbt_info->layout_file = get_edje_path("cbhm_callback_viewer.edj");
+
+ common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this);
+
+
+ RETVM_IF(NULL == this->view, NULL, "navi is null");
+ nRet = cbhm_open_service(&(this->cbhm_handle));
+ RETVM_IF(nRet != CBHM_ERROR_NONE, NULL, "cbhm_open_service failed");
+ RETVM_IF(this->cbhm_handle == NULL, NULL, "cbhm_handle is NULL");
+
+ this->apptype = tbt_info->apptype;
+ this->lat_label = ui_utils_label_add(this->view->layout, "???");
+ this->lon_label = ui_utils_label_add(this->view->layout, "???");
+
+ elm_label_line_wrap_set(this->lat_label, ELM_WRAP_CHAR);
+ elm_label_line_wrap_set(this->lat_label, ELM_WRAP_CHAR);
+
+ ui_utils_label_set_text(this->lat_label, "???", "left");
+ ui_utils_label_set_text(this->lon_label, "???", "left");
+
+ elm_object_part_content_set(this->view->layout, "_title",
+ this->lat_label);
+ elm_object_part_content_set(this->view->layout, "_callback",
+ this->lon_label);
+
+ Evas_Object *table = add_control_layout(this, this->view->layout);
+ elm_object_part_content_set(this->view->layout, "controlr_part",
+ table);
+
+ if(this->apptype == TBT_APP_CBHM_CHANGE_CALLBACK)
+ {
+ //Create an editfield
+ this->editfield = ui_utils_entry_add(this, this->view->layout, ELM_INPUT_PANEL_LAYOUT_NORMAL, "Trial Text");
+ elm_entry_input_panel_language_set(this->editfield, ELM_INPUT_PANEL_LANG_AUTOMATIC);
+ snprintf(msg, sizeof(msg), "Editor - Please click and type here");
+ elm_object_part_text_set(this->editfield, PART_ENTRY_GUIDE, msg);
+ elm_object_part_content_set(this->view->layout, "_edittext", this->editfield);
+ }
+ __is_cbhm_test_running = true;
+ this->callbackAdded = false;
+ this->monitorAdded = false;
+ update(this);
+
+ return this;
+}
+
+
+/**
+ * @function add_control_layout
+ * @since_tizen 4.0
+ * @description Add Control Layout
+ * @parameter cbhm_callbacks_view*: CBHM Callbacks View Pointer, Evas_Object*: Evas Object Pointer
+ * @return static Evas_Object*
+ */
+static Evas_Object *add_control_layout(cbhm_callbacks_view *this, Evas_Object *parent)
+{
+ RETVM_IF(NULL == this, NULL, "view is NULL");
+
+ Evas_Object *table = elm_table_add(parent);
+
+ evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(table);
+
+ elm_table_padding_set(table, TABLE_PADDING_HORIZONTAL,
+ TABLE_PADDING_VERTICAL);
+
+ if(this->apptype == TBT_APP_CBHM_CHANGE_CALLBACK )
+ {
+ this->button1 = ui_utils_push_button_add(this, table, "Add Callback",
+ _add_cb_button_pressed_cb);
+ this->button2 = ui_utils_push_button_add(this, table, "Remove Callback",
+ _rem_cb_button_pressed_cb);
+ this->button3= ui_utils_push_button_add(this, table, "Clear Label",
+ _clear_label_button_pressed_cb);
+ this->button4= ui_utils_push_button_add(this, table, "Show ClipBoard",
+ _show_clipboard_button_pressed_cb);
+ }
+ else if(this->apptype == TBT_APP_CBHM_MONITOR_CALLBACK)
+ {
+ this->button1= ui_utils_push_button_add(this, table, "Add Monitor CB",
+ _add_monitor_callback_button_pressed_cb);
+ this->button2 = ui_utils_push_button_add(this, table, "Remove Monitor CB",
+ _remove_monitor_callback_button_pressed_cb);
+ this->button3= ui_utils_push_button_add(this, table, "Clear Label",
+ _clear_label_button_pressed_cb);
+ this->button4 = ui_utils_push_button_add(this, table, "Show Clipboard",
+ _show_clipboard_button_pressed_cb);
+ }
+ else
+ {
+ this->button1 = ui_utils_push_button_add(this, table, "Copy Text",
+ _text_type_button_pressed_cb);
+ this->button2 = ui_utils_push_button_add(this, table, "Copy Markup",
+ _markup_type_button_pressed_cb);
+ this->button3 = ui_utils_push_button_add(this, table, "Copy HTML",
+ _html_type_button_pressed_cb);
+ this->button4 = ui_utils_push_button_add(this, table, "Display Type",
+ _selection_type_show);
+ }
+ elm_table_pack(table, this->button1, 0, 0, 1, 1);
+ elm_table_pack(table, this->button2, 1, 0, 2, 1);
+ elm_table_pack(table, this->button3, 0, 1, 1, 2);
+ elm_table_pack(table, this->button4, 1, 1, 2, 2);
+ return table;
+}
+
+/**
+ * @function _add_cb_button_pressed_cb
+ * @since_tizen 4.0
+ * @description Add Callback Button Pressed Cb
+ * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer
+ * @return static void
+ */
+static void _add_cb_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ cbhm_callbacks_view *this = (cbhm_callbacks_view*) data;
+ RETM_IF(NULL == this, "cbhm_callbacks_view is null");
+
+ int nRet = 0;
+
+ if(this->callbackAdded == false)
+ {
+ nRet = cbhm_item_changed_callback_add(this->cbhm_handle, on_cbhm_item_changed, data);
+ RETM_IF(nRet != CBHM_ERROR_NONE, "cbhm_item_changed_callback_add failed");
+ this->callbackAdded = true;
+ }
+
+ update(this);
+}
+
+/**
+ * @function _rem_cb_button_pressed_cb
+ * @since_tizen 4.0
+ * @description Remove Callback Button Pressed Cb
+ * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer
+ * @return static void
+ */
+static void _rem_cb_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ cbhm_callbacks_view *this = (cbhm_callbacks_view*) data;
+ int nRet = 0;
+ RETM_IF(NULL == this, "cbhm_callbacks_view is null");
+
+ if(this->callbackAdded == true)
+ {
+ nRet = cbhm_item_changed_callback_remove(this->cbhm_handle, on_cbhm_item_changed, data);
+ RETM_IF(nRet != CBHM_ERROR_NONE, "cbhm_item_changed_callback_remove failed");
+ this->callbackAdded = false;
+ }
+
+ update(this);
+}
+
+/**
+ * @function _clear_label_button_pressed_cb
+ * @since_tizen 4.0
+ * @description Clear Label Button Pressed Cb
+ * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer
+ * @return static void
+ */
+static void _clear_label_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ cbhm_callbacks_view *this = (cbhm_callbacks_view*) data;
+ RETM_IF(NULL == this, "cbhm_callbacks_view is null");
+ ui_utils_label_set_text(this->lat_label, "Cleared Label", "left");
+ ui_utils_label_set_text(this->lon_label, "Waiting for Event", "left");
+}
+
+
+
+/**
+ * @function _show_clipboard_button_pressed_cb
+ * @since_tizen 4.0
+ * @description Show Clipboard Button Pressed Cb
+ * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer
+ * @return static void
+ */
+static void _show_clipboard_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ cbhm_callbacks_view *this = (cbhm_callbacks_view*) data;
+ RETM_IF(NULL == this, "cbhm_callbacks_view is null");
+ int nRet = cbhm_show(this->cbhm_handle);
+ RETM_IF(nRet != CBHM_ERROR_NONE, "cbhm_show failed");
+ ui_utils_label_set_text(this->lat_label, "Show Clipboard", "left");
+}
+
+
+/**
+ * @function _add_monitor_callback_button_pressed_cb
+ * @since_tizen 4.0
+ * @description Add Monitor Callback Button Pressed Cb
+ * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer
+ * @return static void
+ */
+static void _add_monitor_callback_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ cbhm_callbacks_view *this = (cbhm_callbacks_view*) data;
+ if(this->monitorAdded == false)
+ {
+ int nRet = cbhm_monitor_callback_add(this->cbhm_handle, on_monitor_item_changed, data);
+ RETM_IF(nRet != CBHM_ERROR_NONE, "cbhm_monitor_callback_add failed");
+ ui_utils_label_set_text(this->lat_label, "Add Monitor Callback", "left");
+ this->monitorAdded = true;
+ }
+}
+
+
+/**
+ * @function _remove_monitor_callback_button_pressed_cb
+ * @since_tizen 4.0
+ * @description Remove Monitor Calback Button Pressed Cb
+ * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer
+ * @return static void
+ */
+static void _remove_monitor_callback_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ cbhm_callbacks_view *this = (cbhm_callbacks_view*) data;
+ if(this->monitorAdded == true)
+ {
+ int nRet = cbhm_monitor_callback_remove(this->cbhm_handle, on_monitor_item_changed, data);
+ RETM_IF(nRet != CBHM_ERROR_NONE, "cbhm_monitor_callback_remove failed");
+ ui_utils_label_set_text(this->lat_label, "Remove Monitor Callback", "left");
+ this->monitorAdded = false;
+ }
+}
+
+/**
+ * @function _text_type_button_pressed_cb
+ * @since_tizen 4.0
+ * @description Text Type Button Pressed Cb
+ * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer
+ * @return static void
+ */
+static void _text_type_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ _selection_type_set_cb(CBHM_SEL_TYPE_TEXT, data);
+}
+
+/**
+ * @function _markup_type_button_pressed_cb
+ * @since_tizen 4.0
+ * @description Markup Type BUtton Pressed Cb
+ * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer
+ * @return static void
+ */
+
+static void _markup_type_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ _selection_type_set_cb(CBHM_SEL_TYPE_MARKUP, data);
+}
+
+/**
+ * @function _html_type_button_pressed_cb
+ * @since_tizen 4.0
+ * @description HTML type Button Pressed Cb
+ * @parameter void*: Void Pointer, Evas_Object*: Evas Object Pointer, void*: Void Pointer
+ * @return static void
+ */
+static void _html_type_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ _selection_type_set_cb(CBHM_SEL_TYPE_HTML, data);
+}
+
+/**
+ * @function _selection_type_set_cb
+ * @since_tizen 4.0
+ * @description Selection Type Set Cb
+ * @parameter cbhm_sel_type_e: Type, void *: Data
+ * @return static void
+ */
+static void _selection_type_set_cb(cbhm_sel_type_e type, void *data)
+{
+ int nRet;
+ char *hello_str;
+ cbhm_callbacks_view *this = (cbhm_callbacks_view*) data;
+ hello_str = (char *) malloc(50);
+ snprintf(hello_str, 50, "String : %s", get_selection_type(type));
+
+ nRet = cbhm_selection_type_set(this->cbhm_handle, type);
+ RETM_IF(nRet != CBHM_ERROR_NONE, "cbhm_selection_type_set failed");
+
+ nRet = cbhm_selection_set(this->cbhm_handle, type, hello_str, strlen(hello_str));
+ RETM_IF(nRet != CBHM_ERROR_NONE, "cbhm_selection_set failed");
+}
+
+
+/**
+ * @function _selection_type_show
+ * @since_tizen 4.0
+ * @description Show the selection type
+ * @parameter void* : Data, Evas_Object*: Evas Object Pointer, void* : Event Information
+ * @return static void
+ */
+static void _selection_type_show(void *data, Evas_Object *obj, void *event_info)
+{
+ cbhm_callbacks_view *this = (cbhm_callbacks_view*) data;
+ int nRet;
+ cbhm_sel_type_e sType;
+
+ nRet = cbhm_latest_item_type_get(this->cbhm_handle, &sType);
+ RETM_IF(nRet != CBHM_ERROR_NONE, "cbhm_latest_item_type_get failed");
+
+ switch(sType)
+ {
+ case CBHM_SEL_TYPE_MARKUP :
+ ui_utils_label_set_text(this->lat_label, "Selection Type is Markup", "left");
+ break;
+ case CBHM_SEL_TYPE_TEXT :
+ ui_utils_label_set_text(this->lat_label, "Selection Type is Text", "left");
+ break;
+ case CBHM_SEL_TYPE_HTML :
+ ui_utils_label_set_text(this->lat_label, "Selection Type is HTML", "left");
+ break;
+ default :
+ ui_utils_label_set_text(this->lat_label, "Unknown Type", "left");
+ }
+}
+
+
+/**
+ * @function update
+ * @since_tizen 4.0
+ * @description Update
+ * @parameter cbhm_callbacks_view*: CBHM Callbacks View Pointer
+ * @return static void
+ */
+static void update(cbhm_callbacks_view *this)
+{
+ RETM_IF(NULL == this, "cbhm_callbacks_view is null");
+
+ if (this->callbackAdded)
+ {
+ ui_utils_label_set_text(this->lat_label, "Callback added", "left");
+ ui_utils_label_set_text(this->lon_label, "Waiting for callback...",
+ "left");
+ }
+ else
+ {
+ ui_utils_label_set_text(this->lat_label, "No Callback Added", "left");
+ ui_utils_label_set_text(this->lon_label, "Waiting for callback...",
+ "left");
+ }
+}
+
+
+/**
+ * @function on_cbhm_item_changed
+ * @since_tizen 4.0
+ * @description Callback on CBHM Item Changed
+ * @parameter cbhm_handle: CBHM Handle, int: Item Count, void*: Void Pointer
+ * @return static void
+ */
+static void on_cbhm_item_changed(cbhm_h cbhm_handle, int item_count, void *data)
+{
+ cbhm_callbacks_view *this = (cbhm_callbacks_view*) data;
+ RETM_IF(NULL == this, "cbhm_callbacks_view is null");
+ char msg[100];
+ snprintf(msg, sizeof(msg), "CBHM Item Changed Callback Hit with item number %d", item_count);
+ ui_utils_label_set_text(this->lon_label, msg,
+ "left");
+}
+
+
+/**
+ * @function on_monitor_item_changed
+ * @since_tizen 4.0
+ * @description Callback on Monitor Item Changed
+ * @parameter cbhm_handle: CBHM Handle ,bool: active state, void*: Void Pointer
+ * @return static void
+ */
+static void on_monitor_item_changed(cbhm_h cbhm_handle, bool active_state, void *data)
+{
+ cbhm_callbacks_view *this = (cbhm_callbacks_view*) data;
+ RETM_IF(NULL == this, "cbhm_callbacks_view is null");
+ char msg[100];
+ snprintf(msg, sizeof(msg), "CBHM Monitor Changed Callback Hit with active state %d", active_state);
+ ui_utils_label_set_text(this->lon_label, msg,
+ "left");
+return;
+}
+
+
+/**
+ * @function _app_destroy_cb
+ * @since_tizen 4.0
+ * @description App Destroy Cb
+ * @parameter void*: Void Pointer
+ * @return static void
+ */
+static void _app_destroy_cb(void* this)
+{
+ RETM_IF(NULL == this, "data is NULL");
+
+ cbhm_callbacks_view *view = NULL;
+ view = (cbhm_callbacks_view*) this;
+ RETM_IF(NULL == view, "view is NULL");
+
+ __is_cbhm_test_running = false;
+
+ if(view->callbackAdded == true)
+ cbhm_item_changed_callback_remove(view->cbhm_handle, on_cbhm_item_changed, view);
+
+ if(view->monitorAdded == true)
+ cbhm_monitor_callback_remove(view->cbhm_handle, on_monitor_item_changed, view);
+
+ if(view->cbhm_handle != NULL)
+ cbhm_close_service(view->cbhm_handle);
+
+ SAFE_DELETE(view->view);
+ SAFE_DELETE(view);
+}
+
+
+#endif