From: Nibha Sharma Date: Fri, 10 Jun 2016 06:11:10 +0000 (+0900) Subject: [TBT][All][DPTTIZEN-1952][Scenario for sound manager connection and device status... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3eb6635b14a34ccd52cae1af8e531a6566fcd2b6;p=test%2Ftct%2Fnative%2Fbehavior.git [TBT][All][DPTTIZEN-1952][Scenario for sound manager connection and device status,media key,package-manager,notification-text,notification-time,notification-title,notification-image,connection,nfc attach detach and error callback has been added] Change-Id: I633f92331e46676624399d45a9bb9537db1c401c Signed-off-by: Nibha Sharma --- diff --git a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk index 0e2177c..6ef0b6b 100644 Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ diff --git a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk index 7fdd163..309d4b7 100644 Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk differ diff --git a/tbtcoreapp/CMakeLists.txt b/tbtcoreapp/CMakeLists.txt index 2c8450e..2947313 100755 --- a/tbtcoreapp/CMakeLists.txt +++ b/tbtcoreapp/CMakeLists.txt @@ -67,6 +67,7 @@ nsd-ssdp capi-network-mtp ecore-wayland efl +notification ) INCLUDE(FindPkgConfig) @@ -115,6 +116,7 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} elementary evas glib-2.0 + gobject-2.0 json-glib-1.0 curl m @@ -131,6 +133,7 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} capi-network-mtp efl data-control + notification ) CONFIGURE_FILE(tizen-manifest.xml ${PACKAGE_NAME}.xml) diff --git a/tbtcoreapp/inc/model/tbt-info.h b/tbtcoreapp/inc/model/tbt-info.h index 9df84c6..4b56778 100644 --- a/tbtcoreapp/inc/model/tbt-info.h +++ b/tbtcoreapp/inc/model/tbt-info.h @@ -188,7 +188,25 @@ typedef enum { 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; @@ -357,7 +375,8 @@ static char *feature_list[1024] = "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__ */ diff --git a/tbtcoreapp/inc/utils/app_module_config.h b/tbtcoreapp/inc/utils/app_module_config.h index cf855ba..9c349cd 100644 --- a/tbtcoreapp/inc/utils/app_module_config.h +++ b/tbtcoreapp/inc/utils/app_module_config.h @@ -181,4 +181,23 @@ #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 diff --git a/tbtcoreapp/inc/utils/ui-utils.h b/tbtcoreapp/inc/utils/ui-utils.h index 527400e..266b26e 100644 --- a/tbtcoreapp/inc/utils/ui-utils.h +++ b/tbtcoreapp/inc/utils/ui-utils.h @@ -221,4 +221,11 @@ Evas_Object *ui_utils_progressbar_add(void *data, Evas_Object *parent, Evas_Smar * @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__ */ diff --git a/tbtcoreapp/inc/view/tbt-connection-view.h b/tbtcoreapp/inc/view/tbt-connection-view.h new file mode 100755 index 0000000..f0a0cc0 --- /dev/null +++ b/tbtcoreapp/inc/view/tbt-connection-view.h @@ -0,0 +1,55 @@ +/******************************************************************************* + * 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 +#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__ diff --git a/tbtcoreapp/inc/view/tbt-media-key-view.h b/tbtcoreapp/inc/view/tbt-media-key-view.h new file mode 100644 index 0000000..d29f716 --- /dev/null +++ b/tbtcoreapp/inc/view/tbt-media-key-view.h @@ -0,0 +1,58 @@ +/******************************************************************************* + * 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 +#include "model/tbt-list.h" +#include + + +/** + * @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__ diff --git a/tbtcoreapp/inc/view/tbt-notification-view.h b/tbtcoreapp/inc/view/tbt-notification-view.h new file mode 100644 index 0000000..0fef4c1 --- /dev/null +++ b/tbtcoreapp/inc/view/tbt-notification-view.h @@ -0,0 +1,58 @@ +/******************************************************************************* + * 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 +#include "model/tbt-list.h" +#include + + +/** + * @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__ diff --git a/tbtcoreapp/inc/view/tbt-package-manager-view.h b/tbtcoreapp/inc/view/tbt-package-manager-view.h new file mode 100644 index 0000000..e9169df --- /dev/null +++ b/tbtcoreapp/inc/view/tbt-package-manager-view.h @@ -0,0 +1,58 @@ +/******************************************************************************* + * 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 +#include "model/tbt-list.h" +#include + + +/** + * @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__ diff --git a/tbtcoreapp/inc/view/tbt-sound-manager-view.h b/tbtcoreapp/inc/view/tbt-sound-manager-view.h new file mode 100644 index 0000000..393d378 --- /dev/null +++ b/tbtcoreapp/inc/view/tbt-sound-manager-view.h @@ -0,0 +1,58 @@ +/******************************************************************************* + * 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 +#include "model/tbt-list.h" +#include + + +/** + * @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__ diff --git a/tbtcoreapp/packaging/org.tizen.tbtcoreapp.spec b/tbtcoreapp/packaging/org.tizen.tbtcoreapp.spec index 447e4f4..b5b7b41 100755 --- a/tbtcoreapp/packaging/org.tizen.tbtcoreapp.spec +++ b/tbtcoreapp/packaging/org.tizen.tbtcoreapp.spec @@ -107,6 +107,7 @@ BuildRequires: pkgconfig(nsd-ssdp) BuildRequires: pkgconfig(capi-network-mtp) BuildRequires: pkgconfig(ecore-wayland) BuildRequires: pkgconfig(efl) +BuildRequires: pkgconfig(capi-system-media-key) %description Platform Project @@ -173,6 +174,8 @@ chsmack -a %{name} %{_resdir} %{_resdir}/images/YUV/*.raw %{_resdir}/images/AGIF/*.gif +%{_resdir}/package/*.tpk + %{_resdir}/sounds/*.raw %{_resdir}/sounds/*.aac %{_resdir}/sounds/*.amr diff --git a/tbtcoreapp/res/edje/3.0/mobile/connection_viewer.edc b/tbtcoreapp/res/edje/3.0/mobile/connection_viewer.edc new file mode 100755 index 0000000..262c622 --- /dev/null +++ b/tbtcoreapp/res/edje/3.0/mobile/connection_viewer.edc @@ -0,0 +1,39 @@ +/* + * 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; } + } + } + } + } +} diff --git a/tbtcoreapp/res/edje/3.0/mobile/mediakey_viewer.edc b/tbtcoreapp/res/edje/3.0/mobile/mediakey_viewer.edc new file mode 100644 index 0000000..d4b9be3 --- /dev/null +++ b/tbtcoreapp/res/edje/3.0/mobile/mediakey_viewer.edc @@ -0,0 +1,51 @@ +/* + * 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; } + } + } + + } + } +} diff --git a/tbtcoreapp/res/edje/3.0/mobile/notification_viewer.edc b/tbtcoreapp/res/edje/3.0/mobile/notification_viewer.edc new file mode 100644 index 0000000..58bd2a0 --- /dev/null +++ b/tbtcoreapp/res/edje/3.0/mobile/notification_viewer.edc @@ -0,0 +1,50 @@ +/* + * 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; } + } + }*/ + } + } +} diff --git a/tbtcoreapp/res/edje/3.0/mobile/package_manager_viewer.edc b/tbtcoreapp/res/edje/3.0/mobile/package_manager_viewer.edc new file mode 100644 index 0000000..96c5537 --- /dev/null +++ b/tbtcoreapp/res/edje/3.0/mobile/package_manager_viewer.edc @@ -0,0 +1,50 @@ +/* + * 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; } + } + } + } + } +} diff --git a/tbtcoreapp/res/edje/3.0/mobile/sound_manager_viewer.edc b/tbtcoreapp/res/edje/3.0/mobile/sound_manager_viewer.edc new file mode 100644 index 0000000..b005247 --- /dev/null +++ b/tbtcoreapp/res/edje/3.0/mobile/sound_manager_viewer.edc @@ -0,0 +1,39 @@ +/* + * 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; } + } + } + } + } +} diff --git a/tbtcoreapp/res/package/native-testapp-itc-1.0.0-arm.tpk b/tbtcoreapp/res/package/native-testapp-itc-1.0.0-arm.tpk new file mode 100755 index 0000000..54c0270 Binary files /dev/null and b/tbtcoreapp/res/package/native-testapp-itc-1.0.0-arm.tpk differ diff --git a/tbtcoreapp/src/model/tbt-list.c b/tbtcoreapp/src/model/tbt-list.c index 98c9c01..5bb6e78 100644 --- a/tbtcoreapp/src/model/tbt-list.c +++ b/tbtcoreapp/src/model/tbt-list.c @@ -502,7 +502,7 @@ static tbt_info tbtapps[] = .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
2.Now remove phone from the nfc tag it shows nfc detach", .result = 0, .required_features_count = 2, .features_required = {17,77} @@ -518,7 +518,7 @@ static tbt_info tbtapps[] = .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
2.Now remove phone from each other it shows nfc detach", .result = 0, .required_features_count = 2, .features_required = {17,76} @@ -1533,6 +1533,138 @@ static tbt_info tbtapps[] = .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
2. Please install package in device from sdb shell
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
2.Please press back button and again open connection view
3.You will see updated connection status
", + .result = 0, + .required_features_count = 2, + .features_required = {24,21} } #endif #endif diff --git a/tbtcoreapp/src/utils/ui-utils.c b/tbtcoreapp/src/utils/ui-utils.c index cb396b5..ee96bcb 100644 --- a/tbtcoreapp/src/utils/ui-utils.c +++ b/tbtcoreapp/src/utils/ui-utils.c @@ -37,6 +37,27 @@ #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 @@ -435,3 +456,21 @@ void ui_utils_show_toast(const char* message, const Evas_Object* data, float tim 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); +} diff --git a/tbtcoreapp/src/view/tbt-connection-view.c b/tbtcoreapp/src/view/tbt-connection-view.c new file mode 100755 index 0000000..8063a86 --- /dev/null +++ b/tbtcoreapp/src/view/tbt-connection-view.c @@ -0,0 +1,269 @@ +/******************************************************************************* + * 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 +#include + +#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 + +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
2.Please press back button and again open connection view
3.You will see updated connection status
Note:You can also refer info section"); + + 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 diff --git a/tbtcoreapp/src/view/tbt-genlist-view.c b/tbtcoreapp/src/view/tbt-genlist-view.c index aa5c7d0..0181d20 100644 --- a/tbtcoreapp/src/view/tbt-genlist-view.c +++ b/tbtcoreapp/src/view/tbt-genlist-view.c @@ -85,6 +85,11 @@ #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 { @@ -973,8 +978,43 @@ static void _gl_item_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void 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; diff --git a/tbtcoreapp/src/view/tbt-media-key-view.c b/tbtcoreapp/src/view/tbt-media-key-view.c new file mode 100644 index 0000000..3386f99 --- /dev/null +++ b/tbtcoreapp/src/view/tbt-media-key-view.c @@ -0,0 +1,218 @@ +/******************************************************************************* + * 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 +#include + +#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
2.Press that key and you can see media key status changes
Note:You can also refer info section"); + + 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 diff --git a/tbtcoreapp/src/view/tbt-nfc-view.c b/tbtcoreapp/src/view/tbt-nfc-view.c index 36fe25c..883db67 100644 --- a/tbtcoreapp/src/view/tbt-nfc-view.c +++ b/tbtcoreapp/src/view/tbt-nfc-view.c @@ -118,6 +118,8 @@ nfc_view *nfc_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *i 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
2.Now remove phone from the nfc tag it shows nfc detachNote:You can also refer info section
"); + tbt_info->layout_group = "nfc_viewer_tag"; tbt_info->layout_file = get_edje_path("nfc_viewer.edj"); @@ -125,6 +127,8 @@ nfc_view *nfc_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *i } 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
2.Now remove phone from each other it shows nfc detachNote:You can also refer info section
"); + tbt_info->layout_group = "nfc_viewer_p2p"; tbt_info->layout_file = get_edje_path("nfc_viewer.edj"); } @@ -377,6 +381,91 @@ switch(error_code) 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 @@ -593,7 +682,18 @@ void _nfc_tag_discovered_cb(nfc_discovered_type_e type, nfc_tag_h tag, void *use 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); } } } @@ -694,28 +794,42 @@ void _nfc_p2p_target_discovered_cb(nfc_discovered_type_e type, nfc_p2p_target_h 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); } - } @@ -896,12 +1010,13 @@ void _nfc_tag_transceive_completed_cb(nfc_error_e result, unsigned char *buffer, 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); } @@ -1020,7 +1135,7 @@ void _tag_write_completed_cb(nfc_error_e result, void *user_data) } else { - elm_object_text_set(this->nfc_label, "Write Error"); + elm_object_text_set(this->nfc_label, get_nfc_string_error(result)); } } @@ -1281,8 +1396,12 @@ void _nfc_tag_read_completed_cb(nfc_error_e result, nfc_ndef_message_h message, 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); @@ -1409,6 +1528,10 @@ void _nfc_p2p_send_completed_cb(nfc_error_e result, void *user_data) { 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"); + } } diff --git a/tbtcoreapp/src/view/tbt-notification-view.c b/tbtcoreapp/src/view/tbt-notification-view.c new file mode 100644 index 0000000..738fbf8 --- /dev/null +++ b/tbtcoreapp/src/view/tbt-notification-view.c @@ -0,0 +1,199 @@ +/******************************************************************************* + * 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 +#include +#include + +#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 diff --git a/tbtcoreapp/src/view/tbt-package-manager-view.c b/tbtcoreapp/src/view/tbt-package-manager-view.c new file mode 100644 index 0000000..33e052f --- /dev/null +++ b/tbtcoreapp/src/view/tbt-package-manager-view.c @@ -0,0 +1,212 @@ +/******************************************************************************* + * 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 +#include + +#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
2.cd /home/owner/apps_rw/org.tizen.tbtcoreapp/res/package
Run command pkgcmd -iqt tpk -p native-testapp-itc-1.0.0-arm.tpk in sdb shell
Note:While installation you can see in package status that package status and state changes"); + + ui_utils_guide_instruction_popup_button(navi, "1.Please Uninstall package from Application manager.
2.Please install package in device manually from sdb shell.
3.Update is re-install same package on the device
Note:You can also refer info section"); + + 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 diff --git a/tbtcoreapp/src/view/tbt-radio-view.c b/tbtcoreapp/src/view/tbt-radio-view.c index d117f55..5c52369 100644 --- a/tbtcoreapp/src/view/tbt-radio-view.c +++ b/tbtcoreapp/src/view/tbt-radio-view.c @@ -46,7 +46,7 @@ static void _app_destroy_cb(void* this); 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 diff --git a/tbtcoreapp/src/view/tbt-sound-manager-view.c b/tbtcoreapp/src/view/tbt-sound-manager-view.c new file mode 100644 index 0000000..97656a2 --- /dev/null +++ b/tbtcoreapp/src/view/tbt-sound-manager-view.c @@ -0,0 +1,255 @@ +/******************************************************************************* + * 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 +#include + +#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
Note:You can also refer info section
"); + + 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
Note:You can also refer info section
"); + + 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 diff --git a/tbtcoreapp/tizen-manifest.xml b/tbtcoreapp/tizen-manifest.xml index ab13c99..03f2f50 100644 --- a/tbtcoreapp/tizen-manifest.xml +++ b/tbtcoreapp/tizen-manifest.xml @@ -22,5 +22,9 @@ http://tizen.org/privilege/internet http://tizen.org/privilege/notification http://tizen.org/privilege/network.set + http://tizen.org/privilege/volume.set + http://tizen.org/privilege/packagemanager.info + http://tizen.org/privilege/packagemanager.clearcache + http://tizen.org/privilege/network.profile