capi-network-mtp
ecore-wayland
efl
+notification
)
INCLUDE(FindPkgConfig)
elementary
evas
glib-2.0
+ gobject-2.0
json-glib-1.0
curl
m
capi-network-mtp
efl
data-control
+ notification
)
CONFIGURE_FILE(tizen-manifest.xml ${PACKAGE_NAME}.xml)
TBT_APP_STORAGE,
- TBT_APP_RADIO
+ TBT_APP_RADIO,
+
+ TBT_APP_SOUND_MANAGER,
+
+ TBT_APP_SOUND_MANAGER_DEVICE,
+
+ TBT_APP_MEDIA_KEY,
+
+ TBT_APP_PACKAGE_MANAGER,
+
+ TBT_APP_NOTIFICATION_TEXT,
+
+ TBT_APP_NOTIFICATION_TIME,
+
+ TBT_APP_NOTIFICATION_TITLE,
+
+ TBT_APP_NOTIFICATION_IMAGE,
+
+ TBT_APP_CONNECTION
} tbt_app_type_e;
"tizen.org/feature/network.nfc.p2p",
"tizen.org/feature/network.nfc.tag",
"tizen.org/feature/network.wifi.direct.display",
- "tizen.org/feature/network.internet"
+ "tizen.org/feature/network.internet",
+ "tizen.org/feature/notification"
};
#endif /* __TBT_INFO_H__ */
#define TBT_MODULE_RADIO
#define TBT_MODULE_APP_RADIO
+#define TBT_MODULE_SOUND_MANAGER
+#define TBT_MODULE_APP_SOUND_MANAGER
+#define TBT_MODULE_APP_SOUND_MANAGER_DEVICE
+
+#define TBT_MODULE_MEDIA_KEY
+#define TBT_MODULE_APP_MEDIA_KEY
+
+#define TBT_MODULE_PACKAGE_MANAGER
+#define TBT_MODULE_APP_PACKAGE_MANAGER
+
+#define TBT_MODULE_NOTIFICATION
+#define TBT_MODULE_APP_NOTIFICATION
+#define TBT_MODULE_APP_NOTIFICATION_TIME
+#define TBT_MODULE_APP_NOTIFICATION_TITLE
+#define TBT_MODULE_APP_NOTIFICATION_IMAGE
+
+#define TBT_MODULE_CONNECTION
+#define TBT_MODULE_APP_CONNECTION
+
#endif
* @since_tizen 2.3
* */
void ui_utils_show_toast(const char* message, const Evas_Object* data, float timeout);
+
+/*
+ * @brief Pop up Manual Instruction Button
+ * @since_tizen 3.0
+ * */
+void ui_utils_guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction);
+
#endif /* __UI_UTILS_H__ */
--- /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-feature-view.h
+ * @brief checks availability of features in device
+ * @since_tizen 2.3
+ * @author A B M Nazibullah(nazib.ullah@samsung.com)
+ * @date October, 2014
+ * @bug NA
+ * @credit Tizen SDK Version 2.3.0 Sample Example
+ *
+ */
+
+#ifndef __TBT_CONNECTION_VIEW_H__
+#define __TBT_CONNECTION_VIEW_H__
+
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_CONNECTION
+
+#include <Evas.h>
+#include "model/tbt-list.h"
+
+
+/**
+ * @typedef feature_view
+ * @since_tizen 2.3
+ * @brief A feature viewer view handle.
+ */
+typedef struct _connection_view connection_view;
+
+/**
+ * @brief Add feature view
+ * @since_tizen 2.3
+ * @param[in] app The pointer to _app_data instance
+ * @param[in] navi The naviframe object
+ * @return Feature viewer view data
+ */
+connection_view *connection_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item);
+
+#endif
+#endif // __TBT_FEATURE_VIEW_H__
--- /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-mediakey-view.h
+ * @brief retrieves mediakey info
+ * @since_tizen 3.0
+ * @author Nibha Sharma(nibha.sharma@samsung.com)
+ * @date June, 2016
+ * @bug none
+ * @credit
+ * @credit
+ *
+ */
+
+#ifndef __TBT_MEDIA_KEY_VIEW_H__
+#define __TBT_MEDIA_KEY_VIEW_H__
+
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_MEDIA_KEY
+
+#include <Evas.h>
+#include "model/tbt-list.h"
+#include <media_key.h>
+
+
+/**
+ * @typedef mediakey_viewer_view
+ * @since_tizen 3.0
+ * @brief A mediakey view handle.
+ */
+typedef struct _mediakey_view mediakey_view;
+
+/**
+ * @brief Create mediakey view
+ * @since_tizen 3.0
+ * @param[in] navi Parent naviframe
+ * @param[in] custom structute to hold tbt application information
+ * @param[in] item of the main tbt menu
+ * @return Pointer of mediakey on success, otherwise NULL
+ */
+mediakey_view *mediakey_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item);
+
+#endif
+#endif // __TBT_MEDIA_KEY_VIEW_H__
--- /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-notification-view.h
+ * @brief retrieves notification info
+ * @since_tizen 3.0
+ * @author Nibha Sharma(nibha.sharma@samsung.com)
+ * @date June, 2016
+ * @bug none
+ * @credit
+ * @credit
+ *
+ */
+
+#ifndef __TBT_NOTIFICATION_VIEW_H__
+#define __TBT_NOTIFICATION_VIEW_H__
+
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_NOTIFICATION
+
+#include <Evas.h>
+#include "model/tbt-list.h"
+#include <notification.h>
+
+
+/**
+ * @typedef notification_viewer_view
+ * @since_tizen 3.0
+ * @brief A notification viewer view handle.
+ */
+typedef struct _notification_view notification_view;
+
+/**
+ * @brief Create notification view
+ * @since_tizen 3.0
+ * @param[in] navi Parent naviframe
+ * @param[in] custom structute to hold tbt application information
+ * @param[in] item of the main tbt menu
+ * @return Pointer of notification on success, otherwise NULL
+ */
+notification_view *notification_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item);
+
+#endif
+#endif // __TBT_NOTIFICATION_VIEW_H__
--- /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-packagemanager-view.h
+ * @brief retrieves packagemanager info
+ * @since_tizen 3.0
+ * @author Nibha Sharma(nibha.sharma@samsung.com)
+ * @date June, 2016
+ * @bug none
+ * @credit
+ * @credit
+ *
+ */
+
+#ifndef __TBT_PACKAGE_MANAGER_VIEW_H__
+#define __TBT_PACKAGE_MANAGER_VIEW_H__
+
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_PACKAGE_MANAGER
+
+#include <Evas.h>
+#include "model/tbt-list.h"
+#include <package_manager.h>
+
+
+/**
+ * @typedef packagemanager_viewer_view
+ * @since_tizen 3.0
+ * @brief A packagemanager viewer view handle.
+ */
+typedef struct _packagemanager_view packagemanager_view;
+
+/**
+ * @brief Create packagemanager view
+ * @since_tizen 3.0
+ * @param[in] navi Parent naviframe
+ * @param[in] custom structute to hold tbt application information
+ * @param[in] item of the main tbt menu
+ * @return Pointer of packagemanager on success, otherwise NULL
+ */
+packagemanager_view *packagemanager_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item);
+
+#endif
+#endif // __TBT_PACKAGE_MANAGER_VIEW_H__
--- /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-soundmanager-view.h
+ * @brief retrieves soundmanager info
+ * @since_tizen 2.3
+ * @author A. B. M. Nazibullah(nazib.ullah@samsung.com)
+ * @date October, 2014
+ * @bug none
+ * @credit
+ * @credit
+ *
+ */
+
+#ifndef __TBT_SOUND_MANAGER_VIEW_H__
+#define __TBT_SOUND_MANAGER_VIEW_H__
+
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_SOUND_MANAGER
+
+#include <Evas.h>
+#include "model/tbt-list.h"
+#include <sound_manager.h>
+
+
+/**
+ * @typedef soundmanager_viewer_view
+ * @since_tizen 2.3
+ * @brief A soundmanager viewer view handle.
+ */
+typedef struct _soundmanager_view soundmanager_view;
+
+/**
+ * @brief Create soundmanager view
+ * @since_tizen 2.3
+ * @param[in] navi Parent naviframe
+ * @param[in] custom structute to hold tbt application information
+ * @param[in] item of the main tbt menu
+ * @return Pointer of runtimeinfo on success, otherwise NULL
+ */
+soundmanager_view *soundmanager_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item);
+
+#endif
+#endif // __TBT_SOUND_MANAGER_VIEW_H__
BuildRequires: pkgconfig(capi-network-mtp)
BuildRequires: pkgconfig(ecore-wayland)
BuildRequires: pkgconfig(efl)
+BuildRequires: pkgconfig(capi-system-media-key)
%description
Platform Project
%{_resdir}/images/YUV/*.raw
%{_resdir}/images/AGIF/*.gif
+%{_resdir}/package/*.tpk
+
%{_resdir}/sounds/*.raw
%{_resdir}/sounds/*.aac
%{_resdir}/sounds/*.amr
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "connection_viewer";
+ parts{
+ part{
+ name: "connection_view";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "mediakey_viewer";
+ parts{
+ part{
+ name: "media_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+ part{
+ name: "media_key";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 TEXT_HEIGHT; }
+ rel2 {relative: 1.0 2*TEXT_HEIGHT; }
+ }
+ }
+
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "notification_viewer";
+ parts{
+ part{
+ name: "notification_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+ /* part{
+ name: "packagemanager_state";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 TEXT_HEIGHT; }
+ rel2 {relative: 1.0 2*TEXT_HEIGHT; }
+ }
+ }*/
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "package_manager_viewer";
+ parts{
+ part{
+ name: "packagemanager_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+ part{
+ name: "packagemanager_state";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 TEXT_HEIGHT; }
+ rel2 {relative: 1.0 2*TEXT_HEIGHT; }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "sound_manager_viewer";
+ parts{
+ part{
+ name: "sound_manager_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+ }
+ }
+}
.parent = "NFC",
.apptype = TBT_APP_NFC_TAG,
.icon_name = "dummy",
- .info = "Test NFC tag",
+ .info = "1. Please Touch NFC Tag with Phone it shows nfc attach<br/>2.Now remove phone from the nfc tag it shows nfc detach",
.result = 0,
.required_features_count = 2,
.features_required = {17,77}
.parent = "NFC",
.apptype = TBT_APP_NFC_P2P,
.icon_name = "dummy",
- .info = "Test NFC P2P",
+ .info = "1. Please Touch One phone with other Phone it shows nfc attach<br/>2.Now remove phone from each other it shows nfc detach",
.result = 0,
.required_features_count = 2,
.features_required = {17,76}
.result = 0,
.required_features_count = 1,
.features_required = {6}
+ },
+ #endif
+#endif
+#ifdef TBT_MODULE_SOUND_MANAGER
+ #ifdef TBT_MODULE_APP_SOUND_MANAGER
+
+ //SOUND_MANAGER
+ {
+ .name = "Connection Status",
+ .parent = "Sound Manager",
+ .apptype = TBT_APP_SOUND_MANAGER,
+ .icon_name = "dummy",
+ .info = "Insert/Remove Audio jack",
+ .result = 0,
+ .required_features_count = 1,
+ .features_required = {13}
+ },
+ #endif
+ #ifdef TBT_MODULE_APP_SOUND_MANAGER_DEVICE
+
+ //SOUND_MANAGER
+ {
+ .name = "Device Status",
+ .parent = "Sound Manager",
+ .apptype = TBT_APP_SOUND_MANAGER_DEVICE,
+ .icon_name = "dummy",
+ .info = "Insert Audio jack and change sound profile to Sound",
+ .result = 0,
+ .required_features_count = 1,
+ .features_required = {13}
+ },
+ #endif
+#endif
+#ifdef TBT_MODULE_MEDIA_KEY
+ #ifdef TBT_MODULE_APP_MEDIA_KEY
+
+ //Media Key
+ {
+ .name = "Media Key",
+ .parent = "Media Key",
+ .apptype = TBT_APP_MEDIA_KEY,
+ .icon_name = "dummy",
+ .info = "Press Media Key eg:Audio Jack Key",
+ .result = 0
+ },
+ #endif
+#endif
+#ifdef TBT_MODULE_PACKAGE_MANAGER
+ #ifdef TBT_MODULE_APP_PACKAGE_MANAGER
+
+ //Package Manager
+ {
+ .name = "Package Manager",
+ .parent = "Package Manager Status",
+ .apptype = TBT_APP_PACKAGE_MANAGER,
+ .icon_name = "dummy",
+ .info = "1.Please Uninstall package from Application manager<br/>2. Please install package in device from sdb shell<br/> 3.Update is re-install same package on the device",
+ .result = 0
+ },
+ #endif
+#endif
+#ifdef TBT_MODULE_NOTIFICATION
+ #ifdef TBT_MODULE_APP_NOTIFICATION
+
+ //Notification
+ {
+ .name = "Notification Text",
+ .parent = "Notification Status",
+ .apptype = TBT_APP_NOTIFICATION_TEXT,
+ .icon_name = "dummy",
+ .info = "Notification is updated",
+ .result = 0,
+ .required_features_count = 1,
+ .features_required = {80}
+ },
+ #endif
+ #ifdef TBT_MODULE_APP_NOTIFICATION_TIME
+
+ //Notification
+ {
+ .name = "Notification Time",
+ .parent = "Notification Status",
+ .apptype = TBT_APP_NOTIFICATION_TIME,
+ .icon_name = "dummy",
+ .info = "Notification is updated",
+ .result = 0,
+ .required_features_count = 1,
+ .features_required = {80}
+ },
+ #endif
+ #ifdef TBT_MODULE_APP_NOTIFICATION_TITLE
+
+ //Notification
+ {
+ .name = "Notification Title",
+ .parent = "Notification Status",
+ .apptype = TBT_APP_NOTIFICATION_TITLE,
+ .icon_name = "dummy",
+ .info = "Notification is updated",
+ .result = 0,
+ .required_features_count = 1,
+ .features_required = {80}
+ },
+ #endif
+ #ifdef TBT_MODULE_APP_NOTIFICATION_IMAGE
+
+ //Notification
+ {
+ .name = "Notification Image",
+ .parent = "Notification Status",
+ .apptype = TBT_APP_NOTIFICATION_IMAGE,
+ .icon_name = "dummy",
+ .info = "Notification is updated",
+ .result = 0,
+ .required_features_count = 1,
+ .features_required = {80}
+ },
+ #endif
+#endif
+#ifdef TBT_MODULE_CONNECTION
+ #ifdef TBT_MODULE_APP_CONNECTION
+
+ //Connection
+ {
+ .name = "Connection",
+ .parent = "Connection Status",
+ .apptype = TBT_APP_CONNECTION,
+ .icon_name = "dummy",
+ .info = "1.Please Change connection status to flight mode or some other mode<br/>2.Please press back button and again open connection view<br/>3.You will see updated connection status<br/>",
+ .result = 0,
+ .required_features_count = 2,
+ .features_required = {24,21}
}
#endif
#endif
#define PART_POPUP_BUTTON3 "button3"
#define STYLE_POPUP_BUTTON "popup_button/default"
+/**
+ * @function guide_pop_up_button_callback
+ * @since_tizen 3.0
+ * @description Callback for OK press by user
+ * @parameter void *data, Evas_Object *obj, void *event_info
+ * @return void
+ */
+static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info)
+{
+ RETM_IF(NULL == data, "data is null");
+
+ Evas_Object *obj_to_del = data;
+ evas_object_del(obj_to_del);
+
+ if(event_info)
+ {
+ Elm_Object_Item *item = event_info;
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+ }
+}
+
/**
* @function DoesFeatureExixts
* @description Checks if a particular feature exists or not
elm_popup_timeout_set(popup, timeout);
evas_object_show(popup);
}
+
+/**
+ * @function ui_utils_guide_instruction_popup_button
+ * @since_tizen 3.0
+ * @description Pop up Manual Instruction Button
+ * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render
+ * @return static void
+ */
+void ui_utils_guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction)
+{
+ RETM_IF(NULL == view, "view is NULL");
+
+ Evas_Object *guide_popup_btn = ui_utils_popup_add(view, "Instruction Guide");
+ RETM_IF(NULL == guide_popup_btn, "guide_popup_btn is NULL");
+
+ elm_object_text_set(guide_popup_btn, txtInstruction);
+ ui_utils_popup_button_add(guide_popup_btn, caption_ok, guide_pop_up_button_callback, guide_popup_btn);
+}
--- /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-connection-view.c
+ * @brief retrieves connection info
+ *
+ * @author Nibha Sharma(nibha.sharma@samsung.com)
+ * @date June, 2016
+ * @bug NA
+ * @credit
+ *
+ */
+
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_CONNECTION
+
+#include <Elementary.h>
+#include <system_info.h>
+
+#include "utils/logger.h"
+#include "utils/config.h"
+#include "utils/ui-utils.h"
+#include "view/tbt-connection-view.h"
+#include "view/tbt-common-view.h"
+#include <net_connection.h>
+
+struct _connection_view
+{
+ common_view* view;
+
+ Evas_Object *connection_label;
+ Evas_Object *capture_btn;
+};
+connection_h g_hConenctionHandle = NULL;
+static char* get_connection_error(connection_error_e err_code);
+static void _app_destroy_cb(void* this);
+static bool is_not_supported = false;
+
+/**
+ * @function connection_view_add
+ * @since_tizen 3.0
+ * @description connection View Add
+ * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer
+ * @return connection_view*
+ */
+connection_view *connection_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item)
+{
+ RETVM_IF(NULL == navi, NULL, "navi is null");
+
+ connection_view *this = NULL;
+ this = calloc(1, sizeof(connection_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 = "connection_viewer";
+ tbt_info->layout_file = get_edje_path("connection_viewer.edj");
+
+ common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this);
+ RETVM_IF(!this, NULL, "calloc failed");
+ RETVM_IF(NULL == this->view, NULL, "navi is null");
+
+ this->connection_label = ui_utils_label_add(this->view->layout, "");
+ elm_label_line_wrap_set(this->connection_label, ELM_WRAP_WORD);
+ int result;
+
+ connection_profile_iterator_h profile_iter;
+ connection_profile_type_e eConnectionProfileType;
+ connection_profile_h profile_h = NULL;
+
+ ui_utils_guide_instruction_popup_button(navi, "1.Please Change connection status to flight mode or some other mode<br/>2.Please press back button and again open connection view<br/>3.You will see updated connection status<br/><b>Note:You can also refer info section</b>");
+
+ result = connection_create(&g_hConenctionHandle);
+ RETVM_IF(result != CONNECTION_ERROR_NONE && result!= CONNECTION_ERROR_NOT_SUPPORTED, NULL, "connection_create fail > Error = %s", get_connection_error(result));
+
+ if(result == CONNECTION_ERROR_NOT_SUPPORTED)
+ {
+ is_not_supported = true;
+ Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message");
+ elm_object_text_set(popup, "Connection is not supported");
+ RETVM_IF(!this->view, NULL,"Connection is not supported");
+ }
+ if(g_hConenctionHandle != NULL)
+ {
+ result = connection_get_profile_iterator(g_hConenctionHandle, CONNECTION_ITERATOR_TYPE_REGISTERED, &profile_iter);
+ RETVM_IF(result != CONNECTION_ERROR_NONE, NULL, "connection_create fail > Error = %s", get_connection_error(result));
+
+ while ( connection_profile_iterator_has_next(profile_iter) )
+ {
+ result = connection_profile_iterator_next(profile_iter, &profile_h);
+ RETVM_IF(result != CONNECTION_ERROR_NONE, NULL, "connection_create fail > Error = %s", get_connection_error(result));
+
+ result = connection_profile_get_type(profile_h, &eConnectionProfileType);
+ RETVM_IF(result != CONNECTION_ERROR_NONE, NULL, "connection_create fail > Error = %s", get_connection_error(result));
+
+ if ( eConnectionProfileType == CONNECTION_PROFILE_TYPE_CELLULAR )
+ {
+ break;
+ }
+ }
+
+
+ if ( eConnectionProfileType == CONNECTION_PROFILE_TYPE_CELLULAR )
+ {
+ connection_cellular_state_e eFindCellularState = -1;
+
+ result = connection_get_cellular_state(g_hConenctionHandle, &eFindCellularState);
+ RETVM_IF(result != CONNECTION_ERROR_NONE, NULL, "connection_get_cellular_state fail > Error = %s", get_connection_error(result));
+
+ switch(eFindCellularState)
+ {
+ case CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE:
+ ui_utils_label_set_text(this->connection_label, "Out of service ", "left");
+ break;
+
+ case CONNECTION_CELLULAR_STATE_FLIGHT_MODE:
+ ui_utils_label_set_text(this->connection_label, "Flight mode ", "left");
+ break;
+
+ case CONNECTION_CELLULAR_STATE_ROAMING_OFF:
+ ui_utils_label_set_text(this->connection_label, "Roaming is turned off ", "left");
+ break;
+
+ case CONNECTION_CELLULAR_STATE_CALL_ONLY_AVAILABLE:
+ ui_utils_label_set_text(this->connection_label, "Call is only available ", "left");
+ break;
+
+ case CONNECTION_CELLULAR_STATE_AVAILABLE:
+ ui_utils_label_set_text(this->connection_label, "Available but not connected yet ", "left");
+ break;
+
+ case CONNECTION_CELLULAR_STATE_CONNECTED:
+ ui_utils_label_set_text(this->connection_label, "Connected ", "left");
+ break;
+
+ default:
+ ui_utils_label_set_text(this->connection_label, "Unknown status", "left");
+ break;
+
+ }
+ }
+ else
+ {
+ ui_utils_label_set_text(this->connection_label, "Profile is not cellular type", "left");
+ }
+ }
+
+ else
+ {
+ ui_utils_label_set_text(this->connection_label, "Connection is not created", "left");
+ }
+
+ elm_object_part_content_set(this->view->layout, "connection_view", this->connection_label);
+ return this;
+}
+
+/**
+ * @function _app_destroy_cb
+ * @since_tizen 2.3
+ * @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");
+
+ int result;
+ connection_view *view = NULL;
+ view = (connection_view*)this;
+ RETM_IF(NULL == view, "view is NULL");
+
+ if(is_not_supported == true)
+ {
+ view->view->tbt_info->result = TBT_INFO_RESULT_NOT_SUPPORTED;
+ elm_genlist_item_update(view->view->item);
+ }
+
+ result = connection_destroy(g_hConenctionHandle);
+ RETM_IF(result != CONNECTION_ERROR_NONE, "connection_destroy fail > Error = %s", get_connection_error(result));
+
+ SAFE_DELETE(view->view);
+ SAFE_DELETE(view);
+}
+
+/**
+ * @function get_connection_error
+ * @since_tizen 3.0
+ * @description Get connection Error
+ * @parameter connection_error_e err_code
+ * @return char*
+ */
+static char* get_connection_error(connection_error_e err_code)
+{
+ char* err_msg;
+
+ switch (err_code) {
+ case CONNECTION_ERROR_NONE:
+ err_msg = "CONNECTION_ERROR_NONE";
+ break;
+ case CONNECTION_ERROR_INVALID_PARAMETER:
+ err_msg = "CONNECTION_ERROR_INVALID_PARAMETER";
+ break;
+ case CONNECTION_ERROR_OUT_OF_MEMORY:
+ err_msg = "CONNECTION_ERROR_OUT_OF_MEMORY";
+ break;
+ case CONNECTION_ERROR_INVALID_OPERATION:
+ err_msg = "CONNECTION_ERROR_INVALID_OPERATION";
+ break;
+ case CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED:
+ err_msg = "CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED";
+ break;
+ case CONNECTION_ERROR_OPERATION_FAILED:
+ err_msg = "CONNECTION_ERROR_OPERATION_FAILED";
+ break;
+ case CONNECTION_ERROR_ITERATOR_END:
+ err_msg = "CONNECTION_ERROR_ITERATOR_END";
+ break;
+ case CONNECTION_ERROR_NO_CONNECTION:
+ err_msg = "CONNECTION_ERROR_NO_CONNECTION";
+ break;
+ case CONNECTION_ERROR_NOW_IN_PROGRESS:
+ err_msg = "CONNECTION_ERROR_NOW_IN_PROGRESS";
+ break;
+ case CONNECTION_ERROR_ALREADY_EXISTS:
+ err_msg = "CONNECTION_ERROR_ALREADY_EXISTS";
+ break;
+ case CONNECTION_ERROR_OPERATION_ABORTED:
+ err_msg = "CONNECTION_ERROR_OPERATION_ABORTED";
+ break;
+ case CONNECTION_ERROR_DHCP_FAILED:
+ err_msg = "CONNECTION_ERROR_DHCP_FAILED";
+ break;
+ case CONNECTION_ERROR_INVALID_KEY:
+ err_msg = "CONNECTION_ERROR_INVALID_KEY";
+ break;
+ case CONNECTION_ERROR_NO_REPLY:
+ err_msg = "CONNECTION_ERROR_NO_REPLY";
+ break;
+ case CONNECTION_ERROR_PERMISSION_DENIED:
+ err_msg = "CONNECTION_ERROR_PERMISSION_DENIED";
+ break;
+ case CONNECTION_ERROR_NOT_SUPPORTED:
+ err_msg = "CONNECTION_ERROR_NOT_SUPPORTED";
+ break;
+ default:
+ err_msg = "Unknown Error";
+ break;
+
+ }
+ return err_msg;
+}
+
+
+
+#endif
#include "view/tbt-nsd-ssdp-view.h"
#include "view/tbt-storage-view.h"
#include "view/tbt-radio-view.h"
+#include "view/tbt-sound-manager-view.h"
+#include "view/tbt-media-key-view.h"
+#include "view/tbt-package-manager-view.h"
+#include "view/tbt-notification-view.h"
+#include "view/tbt-connection-view.h"
typedef struct
{
radio_view_add(view->navi, info, it);
break;
#endif
-
-
+ #ifdef TBT_MODULE_SOUND_MANAGER
+ case TBT_APP_SOUND_MANAGER:
+ soundmanager_view_add(view->navi, info, it);
+ break;
+ case TBT_APP_SOUND_MANAGER_DEVICE:
+ soundmanager_view_add(view->navi, info, it);
+ break;
+ #endif
+ #ifdef TBT_MODULE_MEDIA_KEY
+ case TBT_APP_MEDIA_KEY:
+ mediakey_view_add(view->navi, info, it);
+ break;
+ #endif
+ #ifdef TBT_MODULE_PACKAGE_MANAGER
+ case TBT_APP_PACKAGE_MANAGER:
+ packagemanager_view_add(view->navi, info, it);
+ break;
+ #endif
+ #ifdef TBT_MODULE_NOTIFICATION
+ case TBT_APP_NOTIFICATION_TEXT:
+ notification_view_add(view->navi, info, it);
+ break;
+ case TBT_APP_NOTIFICATION_TIME:
+ notification_view_add(view->navi, info, it);
+ break;
+ case TBT_APP_NOTIFICATION_TITLE:
+ notification_view_add(view->navi, info, it);
+ break;
+ case TBT_APP_NOTIFICATION_IMAGE:
+ notification_view_add(view->navi, info, it);
+ break;
+ #endif
+ #ifdef TBT_MODULE_CONNECTION
+ case TBT_APP_CONNECTION:
+ connection_view_add(view->navi, info, it);
+ break;
+ #endif
default:
assert(false);
break;
--- /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-mediakey-view.c
+ * @brief retrieves mediakey info
+ *
+ * @author Nibha Sharma(nibha.sharma@samsung.com)
+ * @date June, 2016
+ * @bug none
+ * @credit
+ *
+ */
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_MEDIA_KEY
+
+#include <Elementary.h>
+#include <locations.h>
+
+#include "utils/logger.h"
+#include "utils/config.h"
+#include "utils/ui-utils.h"
+#include "view/tbt-media-key-view.h"
+#include "view/tbt-common-view.h"
+
+struct _mediakey_view
+{
+ common_view* view;
+
+ Evas_Object *mediakey_label;
+ Evas_Object *mediakey2_label;
+
+};
+
+static void _app_destroy_cb(void* this);
+static void _media_key_event_cb(media_key_e key, media_key_event_e status, void *user_data);
+
+/**
+ * @function get_mediakey_type_error
+ * @since_tizen 3.0
+ * @description Get mediakey Error
+ * @parameter int: Int
+ * @return char*
+ */
+char* get_mediakey_type_error(int ret)
+{
+ char* err_msg = NULL;
+ switch (ret) {
+ case MEDIA_KEY_ERROR_NONE:
+ err_msg = "MEDIA_KEY_ERROR_NONE";
+ break;
+ case MEDIA_KEY_ERROR_INVALID_PARAMETER:
+ err_msg = "MEDIA_KEY_ERROR_INVALID_PARAMETER";
+ break;
+ case MEDIA_KEY_ERROR_OPERATION_FAILED:
+ err_msg = "MEDIA_KEY_ERROR_OPERATION_FAILED";
+ break;
+ default:
+ err_msg = "Unknown Error";
+ break;
+ }
+
+ return err_msg;
+}
+
+/**
+ * @function mediakey_view_add
+ * @since_tizen 3.0
+ * @description mediakey View Add
+ * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer
+ * @return mediakey_view*
+ */
+mediakey_view *mediakey_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item)
+{
+ RETVM_IF(NULL == navi, NULL, "navi is null");
+ int ret;
+ mediakey_view *this = NULL;
+ this = calloc(1, sizeof(mediakey_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 = "mediakey_viewer";
+ tbt_info->layout_file = get_edje_path("mediakey_viewer.edj");
+
+ common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this);
+ RETVM_IF(NULL == this->view, NULL, "navi is null");
+
+ ui_utils_guide_instruction_popup_button(navi, "1.Please Insert Audio Jack with media key button<br/>2.Press that key and you can see media key status changes<br/><b>Note:You can also refer info section</b>");
+
+ ret = media_key_reserve(_media_key_event_cb,this);
+ RETVM_IF(ret != MEDIA_KEY_ERROR_NONE, NULL, "media_key_reserve failed : %s", get_mediakey_type_error(ret));
+
+ this->mediakey_label = ui_utils_label_add(this->view->layout, "Media Key Status[Press audiojack key] ");
+ elm_label_line_wrap_set(this->mediakey_label, ELM_WRAP_WORD);
+
+ this->mediakey2_label = ui_utils_label_add(this->view->layout, "Media Key Type[Press audiojack key]");
+ elm_label_line_wrap_set(this->mediakey2_label, ELM_WRAP_WORD);
+
+ elm_object_part_content_set(this->view->layout, "media_text", this->mediakey_label);
+ elm_object_part_content_set(this->view->layout, "media_key", this->mediakey2_label);
+
+ return this;
+}
+
+
+/**
+ * @function _app_destroy_cb
+ * @since_tizen 2.3
+ * @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");
+
+ int result;
+ mediakey_view *view = NULL;
+ view = (mediakey_view*)this;
+ RETM_IF(NULL == view, "view is NULL");
+
+ result = media_key_release();
+ RETM_IF(MEDIA_KEY_ERROR_NONE!=result, "media_key_release failed:%s", get_mediakey_type_error(result));
+
+ SAFE_DELETE(view->view);
+ SAFE_DELETE(view);
+}
+
+
+/**
+ * @function _media_key_event_cb
+ * @since_tizen 3.0
+ * @description media key event Cb
+ * @parameter media_key_e key, media_key_event_e status, void *user_data
+ * @return void
+ */
+static void _media_key_event_cb(media_key_e key, media_key_event_e status, void *user_data)
+{
+
+ RETM_IF(NULL == user_data, "user_data is null");
+ mediakey_view *this = NULL;
+ this = (mediakey_view*) user_data;
+ RETM_IF(NULL == this, "view is NULL");
+
+ DBG("value: %d", status);
+
+ switch (status)
+ {
+ case MEDIA_KEY_STATUS_PRESSED:
+ ui_utils_label_set_text(this->mediakey_label, "Pressed status", "left");
+ break;
+ case MEDIA_KEY_STATUS_RELEASED:
+ ui_utils_label_set_text(this->mediakey_label, "Released status", "left");
+ break;
+ case MEDIA_KEY_STATUS_UNKNOWN:
+ ui_utils_label_set_text(this->mediakey_label, "Unknown status", "left");
+ break;
+ default:
+ ui_utils_label_set_text(this->mediakey_label, "unknown state", "left");
+ break;
+ }
+
+ DBG("value: %d", key);
+ switch (key)
+ {
+ case MEDIA_KEY_PLAY:
+ ui_utils_label_set_text(this->mediakey2_label, "Play key", "left");
+ break;
+ case MEDIA_KEY_STOP:
+ ui_utils_label_set_text(this->mediakey2_label, "Stop key", "left");
+ break;
+ case MEDIA_KEY_PAUSE:
+ ui_utils_label_set_text(this->mediakey2_label, "Pause key", "left");
+ break;
+ case MEDIA_KEY_PREVIOUS:
+ ui_utils_label_set_text(this->mediakey2_label, "Previous key", "left");
+ break;
+ case MEDIA_KEY_NEXT:
+ ui_utils_label_set_text(this->mediakey2_label, "Next key", "left");
+ break;
+ case MEDIA_KEY_FASTFORWARD:
+ ui_utils_label_set_text(this->mediakey2_label, "Fastforward key", "left");
+ break;
+ case MEDIA_KEY_REWIND:
+ ui_utils_label_set_text(this->mediakey2_label, "Rewind key", "left");
+ break;
+ case MEDIA_KEY_PLAYPAUSE:
+ ui_utils_label_set_text(this->mediakey2_label, "Playpause key", "left");
+ break;
+ case MEDIA_KEY_MEDIA:
+ ui_utils_label_set_text(this->mediakey2_label, "Media key for earjack", "left");
+ break;
+ case MEDIA_KEY_UNKNOWN:
+ ui_utils_label_set_text(this->mediakey2_label, "Unknown key", "left");
+ break;
+ default:
+ ui_utils_label_set_text(this->mediakey_label, "unknown state", "left");
+ break;
+ }
+ return ;
+}
+
+#endif
if(tbt_info->apptype == TBT_APP_NFC_TAG)
{
+ ui_utils_guide_instruction_popup_button(navi, "1. Please Touch NFC Tag with Phone it shows nfc attach<br/>2.Now remove phone from the nfc tag it shows nfc detach<b>Note:You can also refer info section</b><br/>");
+
tbt_info->layout_group = "nfc_viewer_tag";
tbt_info->layout_file = get_edje_path("nfc_viewer.edj");
}
else if(tbt_info->apptype == TBT_APP_NFC_P2P)
{
+ ui_utils_guide_instruction_popup_button(navi, "1. Please Touch One phone with other Phone it shows nfc attach<br/>2.Now remove phone from each other it shows nfc detach<b>Note:You can also refer info section</b><br/>");
+
tbt_info->layout_group = "nfc_viewer_p2p";
tbt_info->layout_file = get_edje_path("nfc_viewer.edj");
}
return error;
}
+/**
+ * @function get_nfc_error
+ * @since_tizen 2.3
+ * @description Get Nfc Error
+ * @parameter nfc_error_e: Nfc Error E
+ * @return char*
+ */
+char* get_nfc_string_error(nfc_error_e error_code)
+{
+ char* error;
+
+switch(error_code)
+{
+ case NFC_ERROR_NONE:
+ error = "Successful";
+ break;
+ case NFC_ERROR_OUT_OF_MEMORY:
+ error = "Out of memory ";
+ break;
+ case NFC_ERROR_OPERATION_FAILED:
+ error = "Operation failed ";
+ break;
+ case NFC_ERROR_INVALID_PARAMETER:
+ error = "Invalid parameter ";
+ break;
+ case NFC_ERROR_INVALID_NDEF_MESSAGE:
+ error = "Invalid NDEF message ";
+ break;
+ case NFC_ERROR_INVALID_RECORD_TYPE:
+ error = "Invalid record type ";
+ break;
+ case NFC_ERROR_TIMED_OUT:
+ error = "Timeout error, no answer ";
+ break;
+ case NFC_ERROR_DEVICE_BUSY:
+ error = "Previous operation is not finished still busy ";
+ break;
+ case NFC_ERROR_NO_DEVICE:
+ error = "no device ";
+ break;
+ case NFC_ERROR_NOT_ACTIVATED:
+ error = "NFC is not activated ";
+ break;
+ case NFC_ERROR_NOT_SUPPORTED:
+ error = "Not supported ";
+ break;
+ case NFC_ERROR_ALREADY_ACTIVATED:
+ error = "Already activated ";
+ break;
+ case NFC_ERROR_ALREADY_DEACTIVATED:
+ error = "Already deactivated ";
+ break;
+ case NFC_ERROR_READ_ONLY_NDEF:
+ error = "Read only tag ";
+ break;
+ case NFC_ERROR_NO_SPACE_ON_NDEF:
+ error = "No enough space on tag ";
+ break;
+ case NFC_ERROR_NO_NDEF_MESSAGE:
+ error = "No NDEF Message on Tag ";
+ break;
+ case NFC_ERROR_NOT_NDEF_FORMAT:
+ error = "Not NDEF format Tag ";
+ break;
+ case NFC_ERROR_SECURITY_RESTRICTED:
+ error = "Restricted by access control ";
+ break;
+ case NFC_ERROR_PERMISSION_DENIED:
+ error = "Restricted by Smack";
+ break;
+ case NFC_ERROR_ILLEGAL_STATE:
+ error = "The state is wrong";
+ break;
+ case NFC_ERROR_NOT_INITIALIZED:
+ error = "NFC is not initialized";
+ break;
+ case NFC_ERROR_TAG_NOT_SUPPORTED:
+ error = "Tag is not supported";
+ break;
+ case NFC_ERROR_AID_ALREADY_REGISTERED:
+ error = "AID already registered";
+ }
+
+ return error;
+}
/**
* @function _nfc_activation_changed_cb
elm_list_go(this->nfc_list);
evas_object_show(this->nfc_list);
}
-
+ DBG("NFC Discovery Attach");
+ ui_utils_label_set_text(this->nfc_label, "NFC Discovery Attach", "left");
+ }
+ else if(type == NFC_DISCOVERED_TYPE_DETACHED)
+ {
+ DBG("NFC Discovery Detach");
+ this->nfc_label = ui_utils_label_add(this->view->layout, "NFC Discovery Detach");
+ elm_object_part_content_set(this->view->layout, "nfc_text", this->nfc_label);
+ this->nfc_list = elm_list_add(this->view->layout);
+ evas_object_data_set(this->nfc_list, "nfc_view", this);
+ elm_object_part_content_set(this->view->layout, "nfc_list", this->nfc_list);
+ ui_utils_show_toast("NFC Discovery Detach", this->view->layout, 3);
}
}
}
if(this->view->tbt_info->apptype == TBT_APP_NFC_P2P)
{
- DBG("Inside TBT_APP_NFC_P2P");
- if(is_tab_1_clicked == true)
+ if(type == NFC_DISCOVERED_TYPE_ATTACHED)
{
- DBG("Inside server");
- result = nfc_p2p_set_data_received_cb(this->target, _nfc_p2p_data_received_cb, this);
-// result = nfc_snep_register_server("default", 4, _nfc_snep_event_cb, this);
-// DBG("nfc_snep_register_server %s", get_nfc_error(result));
-// RETM_IF(result != NFC_ERROR_NONE, "nfc_snep_register_server: %s", get_nfc_error(result));
-//
-// result = nfc_snep_start_server(this->target, "default", 4, _nfc_snep_event_cb, this);
-// RETM_IF(result != NFC_ERROR_NONE, "nfc_snep_start_server: %s", get_nfc_error(result));
+ DBG("Inside TBT_APP_NFC_P2P");
+ if(is_tab_1_clicked == true)
+ {
+ DBG("Inside server");
+ result = nfc_p2p_set_data_received_cb(this->target, _nfc_p2p_data_received_cb, this);
+ // result = nfc_snep_register_server("default", 4, _nfc_snep_event_cb, this);
+ // DBG("nfc_snep_register_server %s", get_nfc_error(result));
+ // RETM_IF(result != NFC_ERROR_NONE, "nfc_snep_register_server: %s", get_nfc_error(result));
+ //
+ // result = nfc_snep_start_server(this->target, "default", 4, _nfc_snep_event_cb, this);
+ // RETM_IF(result != NFC_ERROR_NONE, "nfc_snep_start_server: %s", get_nfc_error(result));
+ }
+ else if(is_tab_2_clicked == true)
+ {
+ nfc_ndef_message_h message = create_ndef_message();
+ nfc_p2p_send(this->target, message, _nfc_p2p_send_completed_cb, this);
+ // result = nfc_snep_start_client(this->target, "urn:nfc:sn:snep", 4, _nfc_snep_event_cb, this);
+ // RETM_IF(result != NFC_ERROR_NONE, "nfc_snep_start_client: %s", get_nfc_error(result));
+ }
+ DBG("NFC Discovery Attach");
+ ui_utils_label_set_text(this->nfc_label, "NFC Discovery Attach", "left");
}
- else if(is_tab_2_clicked == true)
+ else
{
- nfc_ndef_message_h message = create_ndef_message();
- nfc_p2p_send(this->target, message, _nfc_p2p_send_completed_cb, this);
-// result = nfc_snep_start_client(this->target, "urn:nfc:sn:snep", 4, _nfc_snep_event_cb, this);
-// RETM_IF(result != NFC_ERROR_NONE, "nfc_snep_start_client: %s", get_nfc_error(result));
+ DBG("NFC Discovery Detach");
+ this->nfc_label = ui_utils_label_add(this->view->layout, "NFC Discovery Detach");
+ elm_object_part_content_set(this->view->layout, "nfc_text", this->nfc_label);
+ this->nfc_list = elm_list_add(this->view->layout);
+ evas_object_data_set(this->nfc_list, "nfc_view", this);
+ elm_object_part_content_set(this->view->layout, "nfc_list", this->nfc_list);
+ ui_utils_show_toast("NFC Discovery Detach", this->view->layout, 3);
}
-
}
this = (nfc_view*)user_data;
RETM_IF(NULL == this, "view is NULL");
- char* fmt_str = NULL;
-
- fmt_str = nfc_util_itoa("Transceive Data: %s size: %d", buffer, buffer_size);
- elm_list_item_append(this->nfc_list, fmt_str, NULL, NULL, NULL, NULL);
- SAFE_DELETE(fmt_str);
+ if(result != NFC_ERROR_NONE)
+ ui_utils_show_toast(get_nfc_string_error(result), this->view->layout, 3);
+ char* fmt_str = NULL;
+ fmt_str = nfc_util_itoa("Transceive Data: %s size: %d", buffer, buffer_size);
+ elm_list_item_append(this->nfc_list, fmt_str, NULL, NULL, NULL, NULL);
+ SAFE_DELETE(fmt_str);
}
}
else
{
- elm_object_text_set(this->nfc_label, "Write Error");
+ elm_object_text_set(this->nfc_label, get_nfc_string_error(result));
}
}
this = (nfc_view*)user_data;
RETM_IF(NULL == this, "view is NULL");
- ret = nfc_ndef_message_get_record_count(message, &count);
- RETM_IF(ret != NFC_ERROR_NONE, "nfc_ndef_message_get_record_count failed with error: %s", get_nfc_error(ret));
+ if(result != NFC_ERROR_NONE)
+ {
+ ui_utils_show_toast(get_nfc_string_error(result), this->view->layout, 3);
+ }
+ ret = nfc_ndef_message_get_record_count(message, &count);
+ RETM_IF(ret != NFC_ERROR_NONE, "nfc_ndef_message_get_record_count failed with error: %s", get_nfc_error(ret));
char* fmt_str = NULL;
fmt_str = nfc_util_itoa("NDEF Record Count: %d", count);
{
ui_utils_label_set_text(this->nfc_label, "Data Sent Successfully", "left");
}
+ else
+ {
+ ui_utils_label_set_text(this->nfc_label, get_nfc_string_error(result), "left");
+ }
}
--- /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-notification-view.c
+ * @brief retrieves notification info
+ *
+ * @author Nibha Sharma(nibha.sharma@samsung.com)
+ * @date June, 2016
+ * @bug none
+ * @credit
+ *
+ */
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_NOTIFICATION
+
+#include <Elementary.h>
+#include <locations.h>
+#include <time.h>
+
+#include "utils/logger.h"
+#include "utils/config.h"
+#include "utils/ui-utils.h"
+#include "view/tbt-notification-view.h"
+#include "view/tbt-common-view.h"
+
+struct _notification_view
+{
+ common_view* view;
+
+ Evas_Object *notification_label;
+
+};
+
+static void _app_destroy_cb(void* this);
+
+notification_h g_NotificationHandle;
+
+/**
+ * @function get_notification_error
+ * @since_tizen 3.0
+ * @description Get notification Error
+ * @parameter int: Int
+ * @return char*
+ */
+char* get_notification_error(int ret)
+{
+ char* err_msg = NULL;
+ switch (ret) {
+ case NOTIFICATION_ERROR_NONE:
+ err_msg = "NOTIFICATION_ERROR_NONE";
+ break;
+ case NOTIFICATION_ERROR_INVALID_PARAMETER:
+ err_msg = "NOTIFICATION_ERROR_INVALID_PARAMETER";
+ break;
+ case NOTIFICATION_ERROR_OUT_OF_MEMORY:
+ err_msg = "NOTIFICATION_ERROR_OUT_OF_MEMORY";
+ break;
+ case NOTIFICATION_ERROR_FROM_DB:
+ err_msg = " NOTIFICATION_ERROR_FROM_DB";
+ break;
+ case NOTIFICATION_ERROR_ALREADY_EXIST_ID:
+ err_msg = " NOTIFICATION_ERROR_ALREADY_EXIST_ID";
+ break;
+ case NOTIFICATION_ERROR_FROM_DBUS:
+ err_msg = "NOTIFICATION_ERROR_FROM_DBUS";
+ break;
+ case NOTIFICATION_ERROR_NOT_EXIST_ID:
+ err_msg = "NOTIFICATION_ERROR_NOT_EXIST_ID";
+ break;
+ case NOTIFICATION_ERROR_IO_ERROR:
+ err_msg = "NOTIFICATION_ERROR_IO_ERROR";
+ break;
+ case NOTIFICATION_ERROR_SERVICE_NOT_READY:
+ err_msg = "NOTIFICATION_ERROR_SERVICE_NOT_READY";
+ break;
+ case NOTIFICATION_ERROR_PERMISSION_DENIED:
+ err_msg = "NOTIFICATION_ERROR_PERMISSION_DENIED";
+ break;
+ default:
+ err_msg = "Unknown Error";
+ break;
+ }
+
+ return err_msg;
+}
+
+/**
+ * @function notification_view_add
+ * @since_tizen 3.0
+ * @description Notification View Add
+ * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer
+ * @return notification_view*
+ */
+notification_view *notification_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item)
+{
+ RETVM_IF(NULL == navi, NULL, "navi is null");
+ int ret;
+ notification_view *this = NULL;
+ this = calloc(1, sizeof(notification_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 = "notification_viewer";
+ tbt_info->layout_file = get_edje_path("notification_viewer.edj");
+
+ common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this);
+ RETVM_IF(NULL == this->view, NULL, "navi is null");
+
+ g_NotificationHandle = notification_create(NOTIFICATION_TYPE_NOTI);
+
+ if(this->view->tbt_info->apptype == TBT_APP_NOTIFICATION_TITLE)
+ {
+ ret = notification_set_text(g_NotificationHandle,NOTIFICATION_TEXT_TYPE_TITLE, "IDS_APP_BODY_IM_TITLE", "I'm Title", NOTIFICATION_VARIABLE_TYPE_NONE);
+ RETVM_IF(ret != NOTIFICATION_ERROR_NONE, NULL, "package_manager_set_event_cb failed : %s", get_notification_error(ret));
+
+ ret = notification_post(g_NotificationHandle);
+ RETVM_IF(ret != NOTIFICATION_ERROR_NONE, NULL, "notification_post failed : %s", get_notification_error(ret));
+
+ return this;
+ }
+ else if (this->view->tbt_info->apptype == TBT_APP_NOTIFICATION_TEXT)
+ {
+ ret = notification_status_message_post("Hello World!!!");
+ RETVM_IF(ret != NOTIFICATION_ERROR_NONE, NULL, "notification_status_message_post failed : %s", get_notification_error(ret));
+ return this;
+ }
+ else if (this->view->tbt_info->apptype == TBT_APP_NOTIFICATION_TIME)
+ {
+ ret = notification_set_time_to_text(g_NotificationHandle,NOTIFICATION_TEXT_TYPE_CONTENT, time(NULL));
+ RETVM_IF(ret != NOTIFICATION_ERROR_NONE, NULL, "notification_set_time failed : %s", get_notification_error(ret));
+
+ ret = notification_post(g_NotificationHandle);
+ RETVM_IF(ret != NOTIFICATION_ERROR_NONE, NULL, "notification_post failed : %s", get_notification_error(ret));
+
+ return this;
+
+ }
+ else if (this->view->tbt_info->apptype == TBT_APP_NOTIFICATION_IMAGE)
+ {
+ char image_path[128] = {'\0'};
+ snprintf(image_path, sizeof(image_path), "%simages/%s",app_get_resource_path(),"dial.png");
+
+ DBG("%s",image_path);
+
+ ret = notification_set_image(g_NotificationHandle,NOTIFICATION_IMAGE_TYPE_ICON_FOR_INDICATOR ,image_path);
+ RETVM_IF(ret != NOTIFICATION_ERROR_NONE, NULL, "notification_set_image failed : %s", get_notification_error(ret));
+
+ ret = notification_post(g_NotificationHandle);
+ RETVM_IF(ret != NOTIFICATION_ERROR_NONE, NULL, "notification_post failed : %s", get_notification_error(ret));
+
+ return this;
+ }
+ return this;
+}
+
+
+/**
+ * @function _app_destroy_cb
+ * @since_tizen 2.3
+ * @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");
+
+ int result;
+ notification_view *view = NULL;
+ view = (notification_view*)this;
+ RETM_IF(NULL == view, "view is NULL");
+
+ result = notification_delete(g_NotificationHandle);
+ RETM_IF(result != NOTIFICATION_ERROR_NONE, "notification_delete fail > Error = %s", get_notification_error(result));
+
+ result = notification_free(g_NotificationHandle);
+ RETM_IF(result != NOTIFICATION_ERROR_NONE, "notification_free fail > Error = %s", get_notification_error(result));
+
+ SAFE_DELETE(view->view);
+ SAFE_DELETE(view);
+}
+#endif
--- /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-packagemanager-view.c
+ * @brief retrieves packagemanager info
+ *
+ * @author Nibha Sharma(nibha.sharma@samsung.com)
+ * @date June, 2016
+ * @bug none
+ * @credit
+ *
+ */
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_PACKAGE_MANAGER
+
+#include <Elementary.h>
+#include <locations.h>
+
+#include "utils/logger.h"
+#include "utils/config.h"
+#include "utils/ui-utils.h"
+#include "view/tbt-package-manager-view.h"
+#include "view/tbt-common-view.h"
+
+struct _packagemanager_view
+{
+ common_view* view;
+
+ Evas_Object *packagemanager_label;
+ Evas_Object *packagemanagerstate_label;
+
+};
+
+static void _app_destroy_cb(void* this);
+static void _package_manager_event_cb(const char *type, const char *package, package_manager_event_type_e event_type, package_manager_event_state_e event_state, int progress, package_manager_error_e error, void *user_data);
+
+package_manager_h g_pstPkgMngr;
+
+/**
+ * @function get_package_manager_error
+ * @since_tizen 3.0
+ * @description Get packagemanager Error
+ * @parameter int: Int
+ * @return char*
+ */
+char* get_package_manager_error(int ret)
+{
+ char* err_msg = NULL;
+ switch (ret) {
+ case PACKAGE_MANAGER_ERROR_NONE:
+ err_msg = "PACKAGE_MANAGER_ERROR_NONE";
+ break;
+ case PACKAGE_MANAGER_ERROR_INVALID_PARAMETER:
+ err_msg = "PACKAGE_MANAGER_ERROR_INVALID_PARAMETER";
+ break;
+ case PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY:
+ err_msg = "PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY";
+ break;
+ case PACKAGE_MANAGER_ERROR_IO_ERROR:
+ err_msg = "PACKAGE_MANAGER_ERROR_IO_ERROR";
+ break;
+ case PACKAGE_MANAGER_ERROR_PERMISSION_DENIED:
+ err_msg = "PACKAGE_MANAGER_ERROR_PERMISSION_DENIED";
+ break;
+ default:
+ err_msg = "Unknown Error";
+ break;
+ }
+
+ return err_msg;
+}
+
+/**
+ * @function packagemanager_view_add
+ * @since_tizen 3.0
+ * @description Package Manager View Add
+ * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer
+ * @return packagemanager_view*
+ */
+packagemanager_view *packagemanager_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item)
+{
+ RETVM_IF(NULL == navi, NULL, "navi is null");
+ int ret;
+ packagemanager_view *this = NULL;
+ this = calloc(1, sizeof(packagemanager_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 = "package_manager_viewer";
+ tbt_info->layout_file = get_edje_path("package_manager_viewer.edj");
+
+ common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this);
+ RETVM_IF(NULL == this->view, NULL, "navi is null");
+
+ ui_utils_guide_instruction_popup_button(navi, "To install sample package please follow steps:br/>1.sdb shell<br/>2.cd /home/owner/apps_rw/org.tizen.tbtcoreapp/res/package<br/>Run command pkgcmd -iqt tpk -p native-testapp-itc-1.0.0-arm.tpk in sdb shell <br/><b>Note:While installation you can see in package status that package status and state changes</b>");
+
+ ui_utils_guide_instruction_popup_button(navi, "1.Please Uninstall package from Application manager.<br/>2.Please install package in device manually from sdb shell.<br/>3.Update is re-install same package on the device<br/><b>Note:You can also refer info section</b>");
+
+ ret = package_manager_create(&g_pstPkgMngr);
+ RETVM_IF(ret != PACKAGE_MANAGER_ERROR_NONE, NULL, "package_manager_create failed : %s", get_package_manager_error(ret));
+
+ ret = package_manager_set_event_cb(g_pstPkgMngr,_package_manager_event_cb, this);
+ RETVM_IF(ret != PACKAGE_MANAGER_ERROR_NONE, NULL, "package_manager_set_event_cb failed : %s", get_package_manager_error(ret));
+
+ this->packagemanager_label = ui_utils_label_add(this->view->layout, "Package Status:Install/Uninstall/Update ");
+ elm_label_line_wrap_set(this->packagemanager_label, ELM_WRAP_WORD);
+
+ this->packagemanagerstate_label = ui_utils_label_add(this->view->layout, "State: No Progress");
+ elm_label_line_wrap_set(this->packagemanagerstate_label, ELM_WRAP_WORD);
+
+ elm_object_part_content_set(this->view->layout, "packagemanager_text", this->packagemanager_label);
+ elm_object_part_content_set(this->view->layout, "packagemanager_state", this->packagemanagerstate_label);
+
+ return this;
+}
+
+
+/**
+ * @function _app_destroy_cb
+ * @since_tizen 2.3
+ * @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");
+
+ int result;
+ packagemanager_view *view = NULL;
+ view = (packagemanager_view*)this;
+ RETM_IF(NULL == view, "view is NULL");
+
+ result = package_manager_destroy(g_pstPkgMngr);
+ RETM_IF(result != PACKAGE_MANAGER_ERROR_NONE, "package_manager_destroy fail > Error = %s", get_package_manager_error(result));
+
+ SAFE_DELETE(view->view);
+ SAFE_DELETE(view);
+}
+
+
+/**
+ * @function _package_manager_event_cb
+ * @since_tizen 3.0
+ * @description package manager event Cb
+ * @parameter const char *type, const char *package, package_manager_event_type_e event_type, package_manager_event_state_e event_state, int progress, package_manager_error_e error, void *user_data
+ * @return void
+ */
+static void _package_manager_event_cb(const char *type, const char *package, package_manager_event_type_e event_type, package_manager_event_state_e event_state, int progress, package_manager_error_e error, void *user_data)
+{
+
+ RETM_IF(NULL == user_data, "user_data is null");
+ packagemanager_view *this = NULL;
+ this = (packagemanager_view*) user_data;
+ RETM_IF(NULL == this, "view is NULL");
+
+ DBG("value: %d", event_type);
+
+ switch (event_type)
+ {
+ case PACKAGE_MANAGER_EVENT_TYPE_INSTALL:
+ ui_utils_label_set_text(this->packagemanager_label, "Install event type ", "left");
+ break;
+ case PACKAGE_MANAGER_EVENT_TYPE_UNINSTALL:
+ ui_utils_label_set_text(this->packagemanager_label, "Uninstall event type", "left");
+ break;
+ case PACKAGE_MANAGER_EVENT_TYPE_UPDATE:
+ ui_utils_label_set_text(this->packagemanager_label, "Update event type", "left");
+ break;
+ default:
+ ui_utils_label_set_text(this->packagemanager_label, "unknown state", "left");
+ break;
+ }
+ switch(event_state)
+ {
+ case PACKAGE_MANAGER_EVENT_STATE_STARTED:
+ ui_utils_label_set_text(this->packagemanagerstate_label, "Started event state", "left");
+ break;
+ case PACKAGE_MANAGER_EVENT_STATE_PROCESSING:
+ ui_utils_label_set_text(this->packagemanagerstate_label, "Processing event state", "left");
+ break;
+ case PACKAGE_MANAGER_EVENT_STATE_COMPLETED:
+ ui_utils_label_set_text(this->packagemanagerstate_label, "Completed event state", "left");
+ break;
+ case PACKAGE_MANAGER_EVENT_STATE_FAILED:
+ ui_utils_label_set_text(this->packagemanagerstate_label, "Failed event state", "left");
+ break;
+ default:
+ ui_utils_label_set_text(this->packagemanagerstate_label, "unknown state", "left");
+ break;
+ }
+ return ;
+}
+
+#endif
static void _radio_interrupted_cb(radio_interrupted_code_e code, void *user_data);
radio_h g_pstRadio;
-bool is_not_supported = false;
+static bool is_not_supported = false;
/**
* @function get_radio_type_error
--- /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-soundmanager-view.c
+ * @brief retrieves soundmanager info
+ *
+ * @author Nibha Sharma(nibha.sharma@samsung.com)
+ * @date June, 2016
+ * @bug none
+ * @credit
+ *
+ */
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_SOUND_MANAGER
+
+#include <Elementary.h>
+#include <locations.h>
+
+#include "utils/logger.h"
+#include "utils/config.h"
+#include "utils/ui-utils.h"
+#include "view/tbt-sound-manager-view.h"
+#include "view/tbt-common-view.h"
+
+struct _soundmanager_view
+{
+ common_view* view;
+
+ Evas_Object *info_label;
+ Evas_Object *device_label;
+};
+
+static void _app_destroy_cb(void* this);
+void _sound_device_connected_cb(sound_device_h device, bool is_connected, void *user_data);
+void _sound_device_information_changed_cb(sound_device_h device, sound_device_changed_info_e changed_info, void *user_data);
+
+static bool is_not_supported = false;
+
+/**
+ * @function get_soundmanager_error
+ * @since_tizen 3.0
+ * @description Get SoundManager Error
+ * @parameter int: Int
+ * @return char*
+ */
+char* get_soundmanager_error(int ret)
+{
+ char* err_msg = NULL;
+ switch (ret) {
+ case SOUND_MANAGER_ERROR_NONE:
+ err_msg = "SOUND_MANAGER_ERROR_NONE";
+ break;
+ case SOUND_MANAGER_ERROR_OUT_OF_MEMORY:
+ err_msg = "SOUND_MANAGER_ERROR_OUT_OF_MEMORY";
+ break;
+ case SOUND_MANAGER_ERROR_INVALID_PARAMETER:
+ err_msg = "SOUND_MANAGER_ERROR_INVALID_PARAMETER";
+ break;
+ case SOUND_MANAGER_ERROR_INVALID_OPERATION:
+ err_msg = "SOUND_MANAGER_ERROR_INVALID_OPERATION";
+ break;
+ case SOUND_MANAGER_ERROR_PERMISSION_DENIED:
+ err_msg = "SOUND_MANAGER_ERROR_PERMISSION_DENIED";
+ break;
+ case SOUND_MANAGER_ERROR_NOT_SUPPORTED:
+ err_msg = "SOUND_MANAGER_ERROR_NOT_SUPPORTED";
+ break;
+ case SOUND_MANAGER_ERROR_NO_DATA:
+ err_msg = "SOUND_MANAGER_ERROR_NO_DATA";
+ break;
+ case SOUND_MANAGER_ERROR_NO_PLAYING_SOUND:
+ err_msg = "SOUND_MANAGER_ERROR_NO_PLAYING_SOUND";
+ break;
+ case SOUND_MANAGER_ERROR_INTERNAL:
+ err_msg = "SOUND_MANAGER_ERROR_INTERNAL";
+ break;
+ case SOUND_MANAGER_ERROR_POLICY:
+ err_msg = "SOUND_MANAGER_ERROR_POLICY";
+ break;
+ default:
+ err_msg = "Unknown Error";
+ }
+
+ return err_msg;
+}
+
+
+/**
+ * @function soundmanager_view_add
+ * @since_tizen 3.0
+ * @description soundmanager View Add
+ * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer
+ * @return soundmanager_view*
+ */
+soundmanager_view *soundmanager_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item)
+{
+ RETVM_IF(NULL == navi, NULL, "navi is null");
+ int ret, value;
+ soundmanager_view *this = NULL;
+ this = calloc(1, sizeof(soundmanager_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 = "sound_manager_viewer";
+ tbt_info->layout_file = get_edje_path("sound_manager_viewer.edj");
+
+ common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this);
+ RETVM_IF(NULL == this->view, NULL, "navi is null");
+
+ if(this->view->tbt_info->apptype == TBT_APP_SOUND_MANAGER)
+ {
+ ui_utils_guide_instruction_popup_button(navi, "* Please Insert/Remove Audio jack to change status<br/><b>Note:You can also refer info section</b><br/>");
+
+ ret = sound_manager_set_device_connected_cb(SOUND_DEVICE_IO_DIRECTION_BOTH_MASK,_sound_device_connected_cb,this);
+ RETVM_IF(ret != SOUND_MANAGER_ERROR_NONE && ret != SOUND_MANAGER_ERROR_NOT_SUPPORTED, NULL, "sound_manager_set_device_connected_cb failed : %s", get_soundmanager_error(ret));
+
+ this->info_label = ui_utils_label_add(this->view->layout, "Please change Audio Jack state[Insert/Remove]");
+ elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD);
+
+ if(ret == SOUND_MANAGER_ERROR_NOT_SUPPORTED)
+ {
+ is_not_supported = true;
+ Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message");
+ elm_object_text_set(popup, "Sound Device is not supported");
+ RETVM_IF(!this->view, NULL,"Sound Device is not supported");
+ }
+ elm_object_part_content_set(this->view->layout, "sound_manager_text", this->info_label);
+ return this;
+ }
+ else if (this->view->tbt_info->apptype == TBT_APP_SOUND_MANAGER_DEVICE)
+ {
+ ui_utils_guide_instruction_popup_button(navi, "*Please Insert Audio jack and change sound profile to Sound,Sound state will be changed<br/><b>Note:You can also refer info section</b><br/>");
+
+ ret = sound_manager_set_device_information_changed_cb(SOUND_DEVICE_TYPE_EXTERNAL_MASK, _sound_device_information_changed_cb,this);
+ RETVM_IF(ret != SOUND_MANAGER_ERROR_NONE && ret != SOUND_MANAGER_ERROR_NOT_SUPPORTED, NULL, "sound_manager_set_device_information_changed_cb failed : %s", get_soundmanager_error(ret));
+
+ this->info_label = ui_utils_label_add(this->view->layout, "Please change state of sound profile[Sound]");
+ elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD);
+
+ if(ret == SOUND_MANAGER_ERROR_NOT_SUPPORTED)
+ {
+ is_not_supported = true;
+ Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message");
+ elm_object_text_set(popup, "Sound Device is not supported");
+ RETVM_IF(!this->view, NULL,"Sound Device is not supported");
+ }
+ elm_object_part_content_set(this->view->layout, "sound_manager_text", this->info_label);
+ return this;
+ }
+}
+
+
+/**
+ * @function _app_destroy_cb
+ * @since_tizen 2.3
+ * @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");
+
+ soundmanager_view *view = NULL;
+ view = (soundmanager_view*)this;
+ RETM_IF(NULL == view, "view is NULL");
+
+ if(is_not_supported == true)
+ {
+ view->view->tbt_info->result = TBT_INFO_RESULT_NOT_SUPPORTED;
+ elm_genlist_item_update(view->view->item);
+ }
+
+ SAFE_DELETE(view->view);
+ SAFE_DELETE(view);
+}
+
+
+/**
+ * @function _sound_device_connected_cb
+ * @since_tizen 3.0
+ * @description Sound Device Connected Cb
+ * @parameter sound_device_h device, bool is_connected, void *user_data
+ * @return void
+ */
+void _sound_device_connected_cb(sound_device_h device, bool is_connected, void *user_data)
+{
+
+ RETM_IF(NULL == user_data, "user_data is null");
+ soundmanager_view *this = NULL;
+ this = (soundmanager_view*) user_data;
+
+ DBG("is_connected: %d", is_connected);
+
+ if(is_connected == true)
+ {
+ ui_utils_label_set_text(this->info_label, "Audio Jack connected", "left");
+ }
+ else
+ {
+ ui_utils_label_set_text(this->info_label, "Audio Jack Not connected", "left");
+ }
+
+}
+
+/**
+ * @function _sound_device_information_changed_cb
+ * @since_tizen 3.0
+ * @description sound Device Information Changed Cb
+ * @parameter sound_device_h device, sound_device_changed_info_e changed_info, void *user_data
+ * @return void
+ */
+void _sound_device_information_changed_cb(sound_device_h device, sound_device_changed_info_e changed_info, void *user_data)
+{
+
+ RETM_IF(NULL == user_data, "user_data is null");
+ soundmanager_view *this = NULL;
+ this = (soundmanager_view*) user_data;
+
+ DBG("changed_info: %d", changed_info);
+
+ switch(changed_info)
+ {
+ case SOUND_DEVICE_CHANGED_INFO_STATE :
+ ui_utils_label_set_text(this->info_label, "State of the device was changed", "left");
+ break;
+
+ case SOUND_DEVICE_CHANGED_INFO_IO_DIRECTION:
+ ui_utils_label_set_text(this->info_label, "IO direction of the device was changed", "left");
+ break;
+ default:
+ ui_utils_label_set_text(this->info_label, "Unknown status", "left");
+ break;
+ }
+
+}
+
+#endif
<privilege>http://tizen.org/privilege/internet</privilege>
<privilege>http://tizen.org/privilege/notification</privilege>
<privilege>http://tizen.org/privilege/network.set</privilege>
+ <privilege>http://tizen.org/privilege/volume.set</privilege>
+ <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+ <privilege>http://tizen.org/privilege/packagemanager.clearcache</privilege>
+ <privilege>http://tizen.org/privilege/network.profile</privilege>
</privileges>
</manifest>