From: Nibha Sharma Date: Mon, 13 Jun 2016 09:38:13 +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=refs%2Fchanges%2F35%2F74235%2F1;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,radio,storage,runtime info 8 new scenarios ,nfc attach detach and error callback has been added] Change-Id: I85b395f0c96928bd3f138d8ba531ae341f17264c Signed-off-by: Nibha Sharma --- diff --git a/release/binary-arm/org.tizen.tbtcoreapp-1.0.0-arm.tpk b/release/binary-arm/org.tizen.tbtcoreapp-1.0.0-arm.tpk index 4f3866f..d4cd5a2 100644 Binary files a/release/binary-arm/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-arm/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 6f08033..fabbd8b 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/inc/model/tbt-info.h b/tbtcoreapp/inc/model/tbt-info.h index 8776edc..b39dbce 100644 --- a/tbtcoreapp/inc/model/tbt-info.h +++ b/tbtcoreapp/inc/model/tbt-info.h @@ -148,7 +148,15 @@ typedef enum { TBT_APP_FEATURE_SUMMARY, - TBT_APP_RUNTIME_INFO, + TBT_APP_AUDIO_JACK, + TBT_APP_KEY_VIBRATION, + TBT_APP_BATTERY, + TBT_APP_GPS_STATUS, + TBT_APP_USB_CONNECTED, + TBT_APP_BLUETOOTH_ENABLED, + TBT_APP_AUTO_ROTATION_ENABLED, + TBT_APP_LOCATION_SERVICE_ENABLED, + TBT_APP_WIFI_HOTSPOT_ENABLED, TBT_APP_OAUTH2, @@ -170,6 +178,29 @@ typedef enum { TBT_APP_WIDGET, + TBT_APP_STORAGE, + + TBT_APP_MEDIA_KEY, + + TBT_APP_PACKAGE_MANAGER, + + TBT_APP_RADIO, + + TBT_APP_SOUND_MANAGER, + + TBT_APP_SOUND_MANAGER_DEVICE, + + + TBT_APP_NOTIFICATION_TEXT, + + TBT_APP_NOTIFICATION_TIME, + + TBT_APP_NOTIFICATION_TITLE, + + TBT_APP_NOTIFICATION_IMAGE, + + TBT_APP_CONNECTION, + TBT_APP_SYSTEM_SETTINGS_FONT, TBT_APP_SYSTEM_SETTINGS_TIMEFORMAT, TBT_APP_SYSTEM_SETTINGS_TIMECHANGE, @@ -349,8 +380,10 @@ static char *feature_list[1024] = "tizen.org/feature/bluetooth.spp", "tizen.org/feature/network.nfc.p2p", "tizen.org/feature/network.nfc.tag", - "tizen.org/feature/sensor.photometer," - "tizen.org/feature/sensor.ultraviolet" + "tizen.org/feature/sensor.photometer", + "tizen.org/feature/sensor.ultraviolet", + "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 ea19af0..4bb4834 100644 --- a/tbtcoreapp/inc/utils/app_module_config.h +++ b/tbtcoreapp/inc/utils/app_module_config.h @@ -153,12 +153,45 @@ //#define TBT_MODULE_PUSH //#define TBT_MODULE_APP_PUSH_SERVICE -//#define TBT_MODULE_RUNTIME -//#define TBT_MODULE_APP_RUNTIME_INFO +#define TBT_MODULE_RUNTIME +#define TBT_MODULE_APP_AUDIO_JACK +#define TBT_MODULE_APP_KEY_VIBRATION +#define TBT_MODULE_APP_BATTERY +#define TBT_MODULE_APP_GPS_STATUS +#define TBT_MODULE_APP_USB_CONNECTED +#define TBT_MODULE_APP_BLUETOOTH_ENABLED +#define TBT_MODULE_APP_AUTO_ROTATION_ENABLED +#define TBT_MODULE_APP_LOCATION_SERVICE_ENABLED +#define TBT_MODULE_APP_WIFI_HOTSPOT_ENABLED #define TBT_MODULE_FEATURE #define TBT_MODULE_APP_FEATURE_SUMMARY +#define TBT_MODULE_STORAGE +#define TBT_MODULE_APP_STORAGE + +#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 + #define TBT_MODULE_SYSTEMSETTINGS #define TBT_MODULE_APP_SYSTEM_SETTINGS_FONT #define TBT_MODULE_APP_SYSTEM_SETTINGS_TIMEFORMAT 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-radio-view.h b/tbtcoreapp/inc/view/tbt-radio-view.h new file mode 100644 index 0000000..a1ba8d8 --- /dev/null +++ b/tbtcoreapp/inc/view/tbt-radio-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-radio-view.h + * @brief retrieves radio info + * @since_tizen 3.0 + * @author Nibha Sharma(nibha.sharma@samsung.com) + * @date June, 2016 + * @bug none + * @credit + * @credit + * + */ + +#ifndef __TBT_RADIO_VIEW_H__ +#define __TBT_RADIO_VIEW_H__ + +#include "utils/app_module_config.h" +#ifdef TBT_MODULE_RADIO + +#include +#include "model/tbt-list.h" +#include + + +/** + * @typedef radio_viewer_view + * @since_tizen 3.0 + * @brief A radio viewer view handle. + */ +typedef struct _radio_view radio_view; + +/** + * @brief Create radio 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 radio on success, otherwise NULL + */ +radio_view *radio_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item); + +#endif +#endif // __TBT_RADIO_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/inc/view/tbt-storage-view.h b/tbtcoreapp/inc/view/tbt-storage-view.h new file mode 100644 index 0000000..421235a --- /dev/null +++ b/tbtcoreapp/inc/view/tbt-storage-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-storage-view.h + * @brief retrieves runtime info + * @since_tizen 3.0 + * @author Nibha Sharma(nibha.sharma@samsung.com) + * @date June, 2016 + * @bug none + * @credit + * @credit + * + */ + +#ifndef __TBT_STORAGE_VIEW_H__ +#define __TBT_STORAGE_VIEW_H__ + +#include "utils/app_module_config.h" +#ifdef TBT_MODULE_STORAGE + +#include +#include "model/tbt-list.h" +#include + + +/** + * @typedef storage_viewer_view + * @since_tizen 3.0 + * @brief A storage viewer view handle. + */ +typedef struct _storage_view storage_view; + +/** + * @brief Create storage 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 storage on success, otherwise NULL + */ +storage_view *storage_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item); + +#endif +#endif // __TBT_STORAGE_VIEW_H__ diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_216_432/connection_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/connection_viewer.edc new file mode 100755 index 0000000..8bbca2d --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/connection_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_216_432/mediakey_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/mediakey_viewer.edc new file mode 100644 index 0000000..e6291e3 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/mediakey_viewer.edc @@ -0,0 +1,54 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_216_432/notification_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/notification_viewer.edc new file mode 100644 index 0000000..77b6b2b --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/notification_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_216_432/package_manager_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/package_manager_viewer.edc new file mode 100644 index 0000000..654cf8d --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/package_manager_viewer.edc @@ -0,0 +1,53 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_216_432/radio_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/radio_viewer.edc new file mode 100644 index 0000000..9c660bd --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/radio_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +collections +{ + base_scale: 1.8; + group + { + name: "radio_viewer"; + parts{ + part{ + name: "radio_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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_216_432/sound_manager_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/sound_manager_viewer.edc new file mode 100644 index 0000000..44a6046 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/sound_manager_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_216_432/storage_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/storage_viewer.edc new file mode 100644 index 0000000..2f5f2a9 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_216_432/storage_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +collections +{ + base_scale: 1.8; + group + { + name: "storage_viewer"; + parts{ + part{ + name: "info_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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_320_320/connection_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/connection_viewer.edc new file mode 100755 index 0000000..8bbca2d --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/connection_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_320_320/mediakey_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/mediakey_viewer.edc new file mode 100644 index 0000000..e6291e3 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/mediakey_viewer.edc @@ -0,0 +1,54 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_320_320/notification_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/notification_viewer.edc new file mode 100644 index 0000000..77b6b2b --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/notification_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_320_320/package_manager_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/package_manager_viewer.edc new file mode 100644 index 0000000..654cf8d --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/package_manager_viewer.edc @@ -0,0 +1,53 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_320_320/radio_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/radio_viewer.edc new file mode 100644 index 0000000..9c660bd --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/radio_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +collections +{ + base_scale: 1.8; + group + { + name: "radio_viewer"; + parts{ + part{ + name: "radio_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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_320_320/sound_manager_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/sound_manager_viewer.edc new file mode 100644 index 0000000..44a6046 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/sound_manager_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_320_320/storage_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/storage_viewer.edc new file mode 100644 index 0000000..2f5f2a9 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_320_320/storage_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_toolbar.edc" + +collections +{ + base_scale: 1.8; + group + { + name: "storage_viewer"; + parts{ + part{ + name: "info_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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_360/connection_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/connection_viewer.edc new file mode 100755 index 0000000..9b12bad --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/connection_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_circle_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_360/mediakey_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/mediakey_viewer.edc new file mode 100644 index 0000000..7d38e33 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/mediakey_viewer.edc @@ -0,0 +1,55 @@ +/* + * 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 +#define HEADER_HIGHT 0.23 + +#include "wearable_circle_toolbar.edc" + +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 HEADER_HIGHT+0.0; } + rel2 {relative: 1.0 HEADER_HIGHT+TEXT_HEIGHT; } + } + } + part{ + name: "media_key"; + type: SWALLOW; + description{ + state: "default" 0.0; + align: 0.0 0.0; + visible: 1; + rel1 {relative: 0.0 HEADER_HIGHT+TEXT_HEIGHT; } + rel2 {relative: 1.0 HEADER_HIGHT+2*TEXT_HEIGHT; } + } + } + WEARABLE_TOOLBAR_PART + + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_360/notification_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/notification_viewer.edc new file mode 100644 index 0000000..627c4c5 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/notification_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_circle_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_360/package_manager_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/package_manager_viewer.edc new file mode 100644 index 0000000..8a9ef8d --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/package_manager_viewer.edc @@ -0,0 +1,53 @@ +/* + * 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 + +#include "wearable_circle_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_360/radio_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/radio_viewer.edc new file mode 100644 index 0000000..f740299 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/radio_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_circle_toolbar.edc" + +collections +{ + base_scale: 1.8; + group + { + name: "radio_viewer"; + parts{ + part{ + name: "radio_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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_360/sound_manager_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/sound_manager_viewer.edc new file mode 100644 index 0000000..8a2f455 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/sound_manager_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_circle_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_360/storage_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/storage_viewer.edc new file mode 100644 index 0000000..ee78e71 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_360/storage_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_circle_toolbar.edc" + +collections +{ + base_scale: 1.8; + group + { + name: "storage_viewer"; + parts{ + part{ + name: "info_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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/connection_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/connection_viewer.edc new file mode 100755 index 0000000..7e43d0a --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/connection_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_360_x_480_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/mediakey_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/mediakey_viewer.edc new file mode 100644 index 0000000..89fa6ad --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/mediakey_viewer.edc @@ -0,0 +1,54 @@ +/* + * 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 + +#include "wearable_360_x_480_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/notification_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/notification_viewer.edc new file mode 100644 index 0000000..6d1093a --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/notification_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_360_x_480_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/package_manager_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/package_manager_viewer.edc new file mode 100644 index 0000000..62b3850 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/package_manager_viewer.edc @@ -0,0 +1,53 @@ +/* + * 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 + +#include "wearable_360_x_480_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/radio_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/radio_viewer.edc new file mode 100644 index 0000000..4e70730 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/radio_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_360_x_480_toolbar.edc" + +collections +{ + base_scale: 1.8; + group + { + name: "radio_viewer"; + parts{ + part{ + name: "radio_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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/sound_manager_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/sound_manager_viewer.edc new file mode 100644 index 0000000..531295b --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/sound_manager_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_360_x_480_toolbar.edc" + +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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/storage_viewer.edc b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/storage_viewer.edc new file mode 100644 index 0000000..b074d41 --- /dev/null +++ b/tbtcoreapp/res/edje/2.3.1/wearable_360_x_480/storage_viewer.edc @@ -0,0 +1,42 @@ +/* + * 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 + +#include "wearable_360_x_480_toolbar.edc" + +collections +{ + base_scale: 1.8; + group + { + name: "storage_viewer"; + parts{ + part{ + name: "info_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; } + } + } + WEARABLE_TOOLBAR_PART + } + } +} diff --git a/tbtcoreapp/src/model/tbt-list.c b/tbtcoreapp/src/model/tbt-list.c index 70c4599..8044443 100644 --- a/tbtcoreapp/src/model/tbt-list.c +++ b/tbtcoreapp/src/model/tbt-list.c @@ -1386,18 +1386,124 @@ static tbt_info tbtapps[] = #endif #ifdef TBT_MODULE_RUNTIME - #ifdef TBT_MODULE_APP_RUNTIME_INFO + #ifdef TBT_MODULE_APP_AUDIO_JACK //Runtime Info { - .name = "Runtime Info", + .name = "Audio Jack Status", .parent = "Runtime Info", - .apptype = TBT_APP_RUNTIME_INFO, + .apptype = TBT_APP_AUDIO_JACK, .icon_name = "dummy", .info = "View Audio Jack
Insert Info", .result = 0 }, #endif + #ifdef TBT_MODULE_APP_KEY_VIBRATION + + //Runtime Info + { + .name = "Key Vibration Status", + .parent = "Runtime Info", + .apptype = TBT_APP_KEY_VIBRATION, + .icon_name = "dummy", + .info = "View Audio Jack
Insert Info", + .result = 0 + }, + #endif + #ifdef TBT_MODULE_APP_BATTERY + + //Runtime Info + { + .name = "Battery Status", + .parent = "Runtime Info", + .apptype = TBT_APP_BATTERY, + .icon_name = "dummy", + .info = "View Audio Jack
Insert Info", + .result = 0 + }, + #endif + #ifdef TBT_MODULE_APP_GPS_STATUS + + //Runtime Info + { + .name = "Gps Status", + .parent = "Runtime Info", + .apptype = TBT_APP_GPS_STATUS, + .icon_name = "dummy", + .info = "View Audio Jack
Insert Info", + .result = 0, + .required_features_count = 1, + .features_required = {11} + }, + #endif + #ifdef TBT_MODULE_APP_USB_CONNECTED + + //Runtime Info + { + .name = "USB Status", + .parent = "Runtime Info", + .apptype = TBT_APP_USB_CONNECTED, + .icon_name = "dummy", + .info = "View Audio Jack
Insert Info", + .result = 0 + }, + #endif + #ifdef TBT_MODULE_APP_BLUETOOTH_ENABLED + + //Runtime Info + { + .name = "Bluetooth Status", + .parent = "Runtime Info", + .apptype = TBT_APP_BLUETOOTH_ENABLED, + .icon_name = "dummy", + .info = "View Audio Jack
Insert Info", + .result = 0, + .required_features_count = 1, + .features_required = {16} + }, + #endif + #ifdef TBT_MODULE_APP_AUTO_ROTATION_ENABLED + + //Runtime Info + { + .name = "Auto Rotate Status", + .parent = "Runtime Info", + .apptype = TBT_APP_AUTO_ROTATION_ENABLED, + .icon_name = "dummy", + .info = "View Audio Jack
Insert Info", + .result = 0, + .required_features_count = 1, + .features_required = {41} + }, + #endif + #ifdef TBT_MODULE_APP_LOCATION_SERVICE_ENABLED + + //Runtime Info + { + .name = "Location Status", + .parent = "Runtime Info", + .apptype = TBT_APP_LOCATION_SERVICE_ENABLED, + .icon_name = "dummy", + .info = "View Audio Jack
Insert Info", + .result = 0, + .required_features_count = 1, + .features_required = {10} + }, + #endif + #ifdef TBT_MODULE_APP_WIFI_HOTSPOT_ENABLED + + //Runtime Info + { + .name = "Wifi HotSpot Status", + .parent = "Runtime Info", + .apptype = TBT_APP_WIFI_HOTSPOT_ENABLED, + .icon_name = "dummy", + .info = "View Audio Jack
Insert Info", + .result = 0, + .required_features_count = 1, + .features_required = {24} + }, + #endif #endif #ifdef TBT_MODULE_FEATURE @@ -1415,6 +1521,166 @@ static tbt_info tbtapps[] = #endif #endif +#ifdef TBT_MODULE_STORAGE + #ifdef TBT_MODULE_APP_STORAGE + + //Storage + { + .name = "SD-Card", + .parent = "Storage", + .apptype = TBT_APP_STORAGE, + .icon_name = "dummy", + .info = "Check Sd-Card
", + .result = 0 + }, + #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_RADIO + #ifdef TBT_MODULE_APP_RADIO + + //RADIO + { + .name = "Radio", + .parent = "Radio", + .apptype = TBT_APP_RADIO, + .icon_name = "dummy", + .info = "Check Earphone", + .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_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, + }, + #endif +#endif #ifdef TBT_MODULE_SYSTEMSETTINGS #ifdef TBT_MODULE_APP_SYSTEM_SETTINGS_FONT diff --git a/tbtcoreapp/src/view/tbt-connection-view.c b/tbtcoreapp/src/view/tbt-connection-view.c new file mode 100755 index 0000000..e5065bd --- /dev/null +++ b/tbtcoreapp/src/view/tbt-connection-view.c @@ -0,0 +1,267 @@ +/******************************************************************************* + * 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 = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.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; + + 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, "1cnt", 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 89c7020..047085b 100644 --- a/tbtcoreapp/src/view/tbt-genlist-view.c +++ b/tbtcoreapp/src/view/tbt-genlist-view.c @@ -80,6 +80,13 @@ #include "view/tbt-ime-view.h" #include "view/tbt-widget-view.h" #include "view/tbt-bluetoothle-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" #include "view/tbt-systemsettings-view.h" //#include "view/tbt-contacts-view.h" @@ -993,9 +1000,33 @@ static void _gl_item_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void #endif #ifdef TBT_MODULE_RUNTIME - case TBT_APP_RUNTIME_INFO: + case TBT_APP_AUDIO_JACK: runtimeinfo_view_add(view->navi, info, it); break; + case TBT_APP_KEY_VIBRATION: + runtimeinfo_view_add(view->navi, info, it); + break; + case TBT_APP_BATTERY: + runtimeinfo_view_add(view->navi, info, it); + break; + case TBT_APP_GPS_STATUS: + runtimeinfo_view_add(view->navi, info, it); + break; + case TBT_APP_USB_CONNECTED: + runtimeinfo_view_add(view->navi, info, it); + break; + case TBT_APP_BLUETOOTH_ENABLED: + runtimeinfo_view_add(view->navi, info, it); + break; + case TBT_APP_AUTO_ROTATION_ENABLED: + runtimeinfo_view_add(view->navi, info, it); + break; + case TBT_APP_LOCATION_SERVICE_ENABLED: + runtimeinfo_view_add(view->navi, info, it); + break; + case TBT_APP_WIFI_HOTSPOT_ENABLED: + runtimeinfo_view_add(view->navi, info, it); + break; #endif #ifdef TBT_MODULE_FEATURE @@ -1003,7 +1034,53 @@ static void _gl_item_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void feature_view_add(view->navi, info, it); break; #endif - + #ifdef TBT_MODULE_STORAGE + case TBT_APP_STORAGE: + storage_view_add(view->navi, info, it); + break; + #endif + #ifdef TBT_MODULE_RADIO + case TBT_APP_RADIO: + 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 #ifdef TBT_MODULE_SYSTEMSETTINGS case TBT_APP_SYSTEM_SETTINGS_FONT: systemsettings_view_add(view->navi, info, it); diff --git a/tbtcoreapp/src/view/tbt-media-key-view.c b/tbtcoreapp/src/view/tbt-media-key-view.c new file mode 100755 index 0000000..c672be2 --- /dev/null +++ b/tbtcoreapp/src/view/tbt-media-key-view.c @@ -0,0 +1,216 @@ +/******************************************************************************* + * 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 = "3_part_cnt_cnt_btn"; + tbt_info->layout_file = get_edje_path("3_part_cnt2.75_cnt_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + 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, "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, "Type[Press audiojack key]"); + elm_label_line_wrap_set(this->mediakey2_label, ELM_WRAP_WORD); + + elm_object_part_content_set(this->view->layout, "1cnt", this->mediakey_label); + elm_object_part_content_set(this->view->layout, "1cnt_2cnt", 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 3b0e528..034259a 100644 --- a/tbtcoreapp/src/view/tbt-nfc-view.c +++ b/tbtcoreapp/src/view/tbt-nfc-view.c @@ -377,6 +377,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 +678,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,25 +790,40 @@ 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 +1007,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); } @@ -1016,13 +1128,11 @@ void _tag_write_completed_cb(nfc_error_e result, void *user_data) if(result == NFC_ERROR_NONE) { - //elm_object_text_set(this->nfc_label, "Write Completed Successfully"); - ui_utils_label_set_text(this->nfc_label, "Write Completed Successfully", "center"); + elm_object_text_set(this->nfc_label, "Write Completed Successfully"); } else { - //elm_object_text_set(this->nfc_label, "Write Error"); - ui_utils_label_set_text(this->nfc_label, "Write Error", "left"); + elm_object_text_set(this->nfc_label, get_nfc_string_error(result)); } } @@ -1177,8 +1287,7 @@ static void toolbar_tab_1_cb(void *data, Evas_Object *obj, void *event_info) elm_list_clear(this->nfc_list); evas_object_hide(this->control); elm_object_part_content_unset(this->view->layout, "controlr_part"); - //elm_object_text_set(this->nfc_label, "NFC Read"); - ui_utils_label_set_text(this->nfc_label, "NFC Read", "left"); + elm_object_text_set(this->nfc_label, "NFC Read"); } @@ -1204,8 +1313,7 @@ static void toolbar_tab_2_cb(void *data, Evas_Object *obj, void *event_info) elm_list_clear(this->nfc_list); - //elm_object_text_set(this->nfc_label, "NFC Write"); - ui_utils_label_set_text(this->nfc_label, "NFC Write", "left"); + elm_object_text_set(this->nfc_label, "NFC Write"); } @@ -1285,8 +1393,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); @@ -1413,6 +1525,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 100755 index 0000000..95a9bda --- /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 = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.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 100755 index 0000000..b19e275 --- /dev/null +++ b/tbtcoreapp/src/view/tbt-package-manager-view.c @@ -0,0 +1,208 @@ +/******************************************************************************* + * 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 = "3_part_cnt_cnt_btn"; + tbt_info->layout_file = get_edje_path("3_part_cnt2.75_cnt_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + 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, "1cnt", this->packagemanager_label); + elm_object_part_content_set(this->view->layout, "1cnt_2cnt", 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 new file mode 100755 index 0000000..8bea35c --- /dev/null +++ b/tbtcoreapp/src/view/tbt-radio-view.c @@ -0,0 +1,235 @@ +/******************************************************************************* + * 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-radio-view.c + * @brief retrieves radio info + * + * @author Nibha Sharma(nibha.sharma@samsung.com) + * @date June, 2016 + * @bug none + * @credit + * + */ +#include "utils/app_module_config.h" +#ifdef TBT_MODULE_RADIO + +#include +#include + +#include "utils/logger.h" +#include "utils/config.h" +#include "utils/ui-utils.h" +#include "view/tbt-radio-view.h" +#include "view/tbt-common-view.h" + +struct _radio_view +{ + common_view* view; + + Evas_Object *radio_label; +}; + +static void _app_destroy_cb(void* this); +static void _radio_interrupted_cb(radio_interrupted_code_e code, void *user_data); + +radio_h g_pstRadio; +static bool is_not_supported = false; + +/** + * @function get_radio_type_error + * @since_tizen 3.0 + * @description Get radio Error + * @parameter int: Int + * @return char* + */ +char* get_radio_type_error(int ret) +{ + char* err_msg = NULL; + switch (ret) { + case RADIO_ERROR_NONE: + err_msg = "RADIO_ERROR_NONE"; + break; + case RADIO_ERROR_INVALID_PARAMETER: + err_msg = "RADIO_ERROR_INVALID_PARAMETER"; + break; + case RADIO_ERROR_INVALID_OPERATION: + err_msg = "RADIO_ERROR_INVALID_OPERATION"; + break; + case RADIO_ERROR_OUT_OF_MEMORY: + err_msg = "RADIO_ERROR_OUT_OF_MEMORY"; + break; + case RADIO_ERROR_INVALID_STATE: + err_msg = "RADIO_ERROR_INVALID_STATE"; + break; + case RADIO_ERROR_SOUND_POLICY: + err_msg = "RADIO_ERROR_SOUND_POLICY"; + break; + default: + err_msg = "Unknown Error"; + break; + } + + return err_msg; +} + +/** + * @function radio_view_add + * @since_tizen 3.0 + * @description Radio View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return radio_view* + */ +radio_view *radio_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + int ret; + radio_view *this = NULL; + this = calloc(1, sizeof(radio_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 = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + ret = radio_create(&g_pstRadio); + RETVM_IF(ret != RADIO_ERROR_NONE && ret != RADIO_ERROR_NOT_SUPPORTED, NULL, "radio_create failed : %s", get_radio_type_error(ret)); + + ret = radio_start(g_pstRadio); + RETVM_IF(ret != RADIO_ERROR_NONE && ret != RADIO_ERROR_NOT_SUPPORTED, NULL, "radio_start failed : %s", get_radio_type_error(ret)); + + ret = radio_set_interrupted_cb(g_pstRadio,_radio_interrupted_cb, this); + RETVM_IF(ret != RADIO_ERROR_NONE && ret != RADIO_ERROR_NOT_SUPPORTED, NULL, "radio_set_interrupted_cb failed : %s", get_radio_type_error(ret)); + + this->radio_label = ui_utils_label_add(this->view->layout, "Latitude: "); + elm_label_line_wrap_set(this->radio_label, ELM_WRAP_WORD); + + if(ret == RADIO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Radio is not supported"); + RETVM_IF(!this->view, NULL,"Radio is not supported"); + } + + radio_state_e estate; + ret = radio_get_state (g_pstRadio, &estate); + RETVM_IF(ret != RADIO_ERROR_NONE && ret != RADIO_ERROR_NOT_SUPPORTED, NULL, "radio_set_interrupted_cb failed : %s", get_radio_type_error(ret)); + + if(estate == RADIO_STATE_PLAYING) + { + ui_utils_label_set_text(this->radio_label, "RADIO is Playing", "left"); + } + + elm_object_part_content_set(this->view->layout, "1cnt", this->radio_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; + radio_view *view = NULL; + view = (radio_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 = radio_unset_interrupted_cb(g_pstRadio); + RETM_IF(result != RADIO_ERROR_NONE, "radio_unset_interrupted_cb fail > Error = %s", get_radio_type_error(result)); + + result = radio_stop(g_pstRadio); + RETM_IF(result != RADIO_ERROR_NONE, "radio_stop fail > Error = %s", get_radio_type_error(result)); + + result = radio_destroy(g_pstRadio); + RETM_IF(result != RADIO_ERROR_NONE, "radio_destroy fail > Error = %s", get_radio_type_error(result)); + + SAFE_DELETE(view->view); + SAFE_DELETE(view); +} + + +/** + * @function _radio_interrupted_cb + * @since_tizen 3.0 + * @description radio interrupted Cb + * @parameter radio_interrupted_code_e code, void *user_data + * @return void + */ +static void _radio_interrupted_cb(radio_interrupted_code_e code, void *user_data) +{ + + RETM_IF(NULL == user_data, "user_data is null"); + radio_view *this = NULL; + this = (radio_view*) user_data; + RETM_IF(NULL == this, "view is NULL"); + + DBG("value: %d", code); + + switch (code) + { + case RADIO_INTERRUPTED_COMPLETED: + ui_utils_label_set_text(this->radio_label, "Interrupt completed", "left"); + break; + case RADIO_INTERRUPTED_BY_MEDIA: + ui_utils_label_set_text(this->radio_label, "Interrupted by a non-resumable media application", "left"); + break; + case RADIO_INTERRUPTED_BY_CALL: + ui_utils_label_set_text(this->radio_label, "Interrupted by an incoming call", "left"); + break; + case RADIO_INTERRUPTED_BY_EARJACK_UNPLUG : + ui_utils_label_set_text(this->radio_label, "Interrupted by unplugging headphones", "left"); + break; + case RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT : + ui_utils_label_set_text(this->radio_label, "Interrupted by a resource conflict", "left"); + break; + case RADIO_INTERRUPTED_BY_ALARM : + ui_utils_label_set_text(this->radio_label, "Interrupted by an alarm", "left"); + break; + case RADIO_INTERRUPTED_BY_EMERGENCY : + ui_utils_label_set_text(this->radio_label, "Interrupted by a resumable media application", "left"); + break; + case RADIO_INTERRUPTED_BY_NOTIFICATION : + ui_utils_label_set_text(this->radio_label, "Interrupted by a notification", "left"); + break; + default: + ui_utils_label_set_text(this->radio_label, "unknown state", "left"); + break; + } + return ; +} + +#endif diff --git a/tbtcoreapp/src/view/tbt-runtimeinfo-view.c b/tbtcoreapp/src/view/tbt-runtimeinfo-view.c index dd27f9f..2b44f74 100644 --- a/tbtcoreapp/src/view/tbt-runtimeinfo-view.c +++ b/tbtcoreapp/src/view/tbt-runtimeinfo-view.c @@ -42,9 +42,18 @@ struct _runtimeinfo_view Evas_Object *info_label; }; +static bool is_not_supported = false; + static void _app_destroy_cb(void* this); void _runtime_info_changed_cb(runtime_info_key_e key, void *user_data); - +static void _vibrate_state_changed_cb(runtime_info_key_e key, void *user_data); +static void _battery_state_changed_cb(runtime_info_key_e key, void *user_data); +static void _usb_state_changed_cb(runtime_info_key_e key, void *user_data); +static void _gps_state_changed_cb(runtime_info_key_e key, void *user_data); +static void _bluetooth_state_changed_cb(runtime_info_key_e key, void *user_data); +static void _rotate_state_changed_cb(runtime_info_key_e key, void *user_data); +static void _location_state_changed_cb(runtime_info_key_e key, void *user_data); +static void _wifi_state_changed_cb(runtime_info_key_e key, void *user_data); /** * @function get_runtime_info_error @@ -112,61 +121,442 @@ runtimeinfo_view *runtimeinfo_view_add(Evas_Object *navi, tbt_info *tbt_info, El this->view = calloc(1, sizeof(common_view)); RETVM_IF(!this->view, NULL, "calloc failed"); - tbt_info->layout_group = "runtimeinfo_viewer"; - tbt_info->layout_file = get_edje_path("runtimeinfo_viewer.edj"); - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + tbt_info->layout_group = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); - ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_AUDIO_JACK_STATUS, _runtime_info_changed_cb, this); - RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_set_changed_cb failed : %s", get_runtime_info_error(ret)); + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + bool bvalue; + if(this->view->tbt_info->apptype == TBT_APP_AUDIO_JACK) + { - this->info_label = ui_utils_label_add(this->view->layout, "Latitude: "); - elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); + ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_AUDIO_JACK_STATUS, _runtime_info_changed_cb, this); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_set_changed_cb failed : %s", get_runtime_info_error(ret)); - if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) - { - ui_utils_label_set_text(this->info_label, "Audio Jack is not supported", "left"); - elm_object_part_content_set(this->view->layout, "info_text", this->info_label); - return this; - } + this->info_label = ui_utils_label_add(this->view->layout, "Latitude: "); + elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); - ret = runtime_info_get_value_int(RUNTIME_INFO_KEY_AUDIO_JACK_STATUS, &value); - RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_get_value_int failed: %s",get_runtime_info_error(ret)); - if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) - { - ui_utils_label_set_text(this->info_label, "Audio Jack is not supported", "left"); - elm_object_part_content_set(this->view->layout, "info_text", this->info_label); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Audio Jack is not supported"); + RETVM_IF(!this->view, NULL,"Audio Jack is not supported"); + } + else + { + ret = runtime_info_get_value_int(RUNTIME_INFO_KEY_AUDIO_JACK_STATUS, &value); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_get_value_int failed: %s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Audio Jack is not supported"); + RETVM_IF(!this->view, NULL,"Audio Jack is not supported"); + } + else + { + DBG("value: %d", value); + switch(value) + { + case 0: + ui_utils_label_set_text(this->info_label, "Audio Jack Not connected", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "Audio Jack Connected with 3 wire earjack", "left"); + break; + + case 2: + ui_utils_label_set_text(this->info_label, "Audio Jack Connected with 4 wire earjack", "left"); + break; + + default: + ui_utils_label_set_text(this->info_label, "Unknown status", "left"); + break; + + } + } + } + elm_object_part_content_set(this->view->layout, "1cnt", this->info_label); return this; } + else if (this->view->tbt_info->apptype == TBT_APP_KEY_VIBRATION) + { - DBG("value: %d", value); - -switch(value) -{ - case 0: - ui_utils_label_set_text(this->info_label, "Audio Jack Not connected", "left"); - break; - - case 1: - ui_utils_label_set_text(this->info_label, "Audio Jack Connected with 3 wire earjack", "left"); - break; + ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_VIBRATION_ENABLED, _vibrate_state_changed_cb, this); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_set_changed_cb failed : %s", get_runtime_info_error(ret)); - case 2: - ui_utils_label_set_text(this->info_label, "Audio Jack Connected with 4 wire earjack", "left"); - break; - - default: - ui_utils_label_set_text(this->info_label, "Unknown status", "left"); - break; + this->info_label = ui_utils_label_add(this->view->layout, "Longitude: "); + elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Vibration Mode is not supported"); + RETVM_IF(!this->view, NULL,"Vibration Mode is not supported"); } + else + { + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_VIBRATION_ENABLED, &bvalue); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_get_value_int failed: %s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Vibration Mode is not supported"); + RETVM_IF(!this->view, NULL,"Vibration Mode is not supported"); + } + else + { + DBG("value: %d", bvalue); + + switch(bvalue) + { + case 0: + ui_utils_label_set_text(this->info_label, "Vibrate Mode is Not Enabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "Vibrate Mode is Enabled", "left"); + break; + } + } + } + elm_object_part_content_set(this->view->layout, "1cnt", this->info_label); + return this; + } + else if (this->view->tbt_info->apptype == TBT_APP_BATTERY) + { + ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_BATTERY_IS_CHARGING, _battery_state_changed_cb, this); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_set_changed_cb failed : %s", get_runtime_info_error(ret)); + + this->info_label = ui_utils_label_add(this->view->layout, "Percentage: "); + elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); + + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Battery Charging is not supported"); + RETVM_IF(!this->view, NULL,"Battery Charging is not supported"); + } + else + { + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_BATTERY_IS_CHARGING, &bvalue); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_get_value_int failed: %s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Battery Charging is not supported"); + RETVM_IF(!this->view, NULL,"Battery Charging is not supported"); + } + else + { + DBG("value: %d", bvalue); + switch(bvalue) + { + case 0: + ui_utils_label_set_text(this->info_label, " Battery Not Charging", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "Battery Charging Started", "left"); + break; + } + } + } + elm_object_part_content_set(this->view->layout, "1cnt", this->info_label); + return this; + } + else if (this->view->tbt_info->apptype == TBT_APP_GPS_STATUS) + { + this->info_label = ui_utils_label_add(this->view->layout, "GPS: "); + elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); + + ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_GPS_STATUS , _gps_state_changed_cb, this); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_set_changed_cb failed : %s", get_runtime_info_error(ret)); + + this->info_label = ui_utils_label_add(this->view->layout, "GPS: "); + elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); + + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "GPS is not supported"); + RETVM_IF(!this->view, NULL,"GPS is not supported"); + } + else + { + + ret = runtime_info_get_value_int(RUNTIME_INFO_KEY_GPS_STATUS , &value); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_get_value_int failed: %s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "GPS is not supported"); + RETVM_IF(!this->view, NULL,"GPS is not supported"); + } + else + { + DBG("value: %d", value); + switch(value) + { + case 0: + ui_utils_label_set_text(this->info_label, "GPS is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "GPS is searching for satellites", "left"); + break; + + case 2: + ui_utils_label_set_text(this->info_label, "GPS connection is established", "left"); + break; + + default: + ui_utils_label_set_text(this->info_label, "Unknown status", "left"); + break; + + } + } + } + elm_object_part_content_set(this->view->layout, "1cnt", this->info_label); + return this; + } + else if (this->view->tbt_info->apptype == TBT_APP_USB_CONNECTED) + { + ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_USB_CONNECTED , _usb_state_changed_cb, this); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_set_changed_cb failed : %s", get_runtime_info_error(ret)); + + this->info_label = ui_utils_label_add(this->view->layout, "usb: "); + elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); + + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "USB is not supported"); + RETVM_IF(!this->view, NULL,"USB is not supported"); + } + else + { + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_USB_CONNECTED , &bvalue); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_get_value_int failed: %s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "USB is not supported"); + RETVM_IF(!this->view, NULL,"USB is not supported"); + } + else + { + DBG("value: %d", bvalue); + + switch(bvalue) + { + case 0: + ui_utils_label_set_text(this->info_label, "USB Not Connected", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "USB is Connected", "left"); + break; + } + } + } + elm_object_part_content_set(this->view->layout, "1cnt", this->info_label); + return this; + } + else if (this->view->tbt_info->apptype == TBT_APP_BLUETOOTH_ENABLED) + { + ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_BLUETOOTH_ENABLED , _bluetooth_state_changed_cb, this); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_set_changed_cb failed : %s", get_runtime_info_error(ret)); + + this->info_label = ui_utils_label_add(this->view->layout, "bluetooth: "); + elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); + + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Bluetooth is not supported"); + RETVM_IF(!this->view, NULL,"Bluetooth is not supported"); + } + else + { + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_BLUETOOTH_ENABLED , &bvalue); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_get_value_int failed: %s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Bluetooth is not supported"); + RETVM_IF(!this->view, NULL,"Bluetooth is not supported"); + } + else + { + DBG("value: %d", bvalue); + switch(bvalue) + { + case 0: + ui_utils_label_set_text(this->info_label, "Bluetooth Not Enabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "Bluetooth is Enabled", "left"); + break; + } + } + } + elm_object_part_content_set(this->view->layout, "1cnt", this->info_label); + return this; + } + else if (this->view->tbt_info->apptype == TBT_APP_AUTO_ROTATION_ENABLED) + { - elm_object_part_content_set(this->view->layout, "info_text", this->info_label); - - - return this; + ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_AUTO_ROTATION_ENABLED , _rotate_state_changed_cb, this); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_set_changed_cb failed : %s", get_runtime_info_error(ret)); + + this->info_label = ui_utils_label_add(this->view->layout, "rotate: "); + elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); + + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "AUTO_ROTATION is not supported"); + RETVM_IF(!this->view, NULL,"AUTO_ROTATION is not supported"); + } + else + { + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_AUTO_ROTATION_ENABLED , &bvalue); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_get_value_int failed: %s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "AUTO_ROTATION is not supported"); + RETVM_IF(!this->view, NULL,"AUTO_ROTATION is not supported"); + } + else + { + DBG("value: %d", bvalue); + + switch(bvalue) + { + case 0: + ui_utils_label_set_text(this->info_label, "Auto Rotate Not Enabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "Auto Rotate is Enabled", "left"); + break; + } + } + } + elm_object_part_content_set(this->view->layout, "1cnt", this->info_label); + return this; + } + else if (this->view->tbt_info->apptype == TBT_APP_LOCATION_SERVICE_ENABLED) + { + + ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_LOCATION_SERVICE_ENABLED , _location_state_changed_cb, this); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_set_changed_cb failed : %s", get_runtime_info_error(ret)); + + this->info_label = ui_utils_label_add(this->view->layout, "location: "); + elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); + + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Location is not supported"); + RETVM_IF(!this->view, NULL,"Location is not supported"); + } + else + { + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_LOCATION_SERVICE_ENABLED , &bvalue); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_get_value_int failed: %s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Location is not supported"); + RETVM_IF(!this->view, NULL,"Location is not supported"); + } + else + { + DBG("value: %d", bvalue); + switch(bvalue) + { + case 0: + ui_utils_label_set_text(this->info_label, "Location Not Enabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "Location is Enabled", "left"); + break; + } + } + } + elm_object_part_content_set(this->view->layout, "1cnt", this->info_label); + return this; + } + else if (this->view->tbt_info->apptype == TBT_APP_WIFI_HOTSPOT_ENABLED) + { + ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_WIFI_HOTSPOT_ENABLED , _wifi_state_changed_cb, this); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_set_changed_cb failed : %s", get_runtime_info_error(ret)); + + this->info_label = ui_utils_label_add(this->view->layout, "wifi: "); + elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); + + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Wifi Hotspot is not supported"); + RETVM_IF(!this->view, NULL,"Wifi Hotspot is not supported"); + } + else + { + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_WIFI_HOTSPOT_ENABLED , &bvalue); + RETVM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED, NULL, "runtime_info_get_value_int failed: %s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Wifi Hotspot is not supported"); + RETVM_IF(!this->view, NULL,"Wifi Hotspot is not supported"); + } + else + { + DBG("value: %d", bvalue); + switch(bvalue) + { + case 0: + ui_utils_label_set_text(this->info_label, "Wifi Hotspot Not Enabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "Wifi Hotspot is Enabled", "left"); + break; + } + } + } + elm_object_part_content_set(this->view->layout, "1cnt", this->info_label); + return this; + + } + return this; } @@ -186,6 +576,12 @@ static void _app_destroy_cb(void* this) view = (runtimeinfo_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); } @@ -236,4 +632,319 @@ switch(value) } } +/** + * @function _vibrate_state_changed_cb + * @since_tizen 2.3 + * @description vibrate State Changed Cb + * @parameter runtime_info_key_e key, void *user_data + * @return static void + */ +static void _vibrate_state_changed_cb(runtime_info_key_e key, void *user_data) +{ + RETM_IF(NULL == user_data, "user_data is null"); + int ret; + bool bvalue; + runtimeinfo_view *this = NULL; + this = (runtimeinfo_view*) user_data; + + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_VIBRATION_ENABLED, &bvalue); + RETM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED,"runtime_info_get_value_int failed :%s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + ui_utils_label_set_text(this->info_label, "Device Vibration is not supported", "left"); + return; + } + + DBG("value: %d", bvalue); + +switch(bvalue) +{ + case 0: + ui_utils_label_set_text(this->info_label, "Device Vibration is Not Enabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "Device Vibration is Enabled", "left"); + break; + } +} + +/** + * @function _battery_state_changed_cb + * @since_tizen 2.3 + * @description battery State Changed Cb + * @parameter runtime_info_key_e key, void *user_data + * @return static void + */ +static void _battery_state_changed_cb(runtime_info_key_e key, void *user_data) +{ + RETM_IF(NULL == user_data, "user_data is null"); + int ret; + bool bvalue; + runtimeinfo_view *this = NULL; + this = (runtimeinfo_view*) user_data; + + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_BATTERY_IS_CHARGING, &bvalue); + RETM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED,"runtime_info_get_value_int failed :%s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + ui_utils_label_set_text(this->info_label, "Battery Charging is not supported", "left"); + return; + } + + DBG("value: %d", bvalue); + + switch(bvalue) + { + case 0: + ui_utils_label_set_text(this->info_label, "Battery Not Charging", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "Battery Charging Started", "left"); + break; + } + +} + +/** + * @function _gps_state_changed_cb + * @since_tizen 2.3 + * @description gps state Changed Cb + * @parameter runtime_info_key_e key, void *user_data + * @return void + */ +void _gps_state_changed_cb(runtime_info_key_e key, void *user_data) +{ + + RETM_IF(NULL == user_data, "user_data is null"); + int ret, value; + runtimeinfo_view *this = NULL; + this = (runtimeinfo_view*) user_data; + + ret = runtime_info_get_value_int(RUNTIME_INFO_KEY_GPS_STATUS, &value); + RETM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED,"runtime_info_get_value_int failed :%s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + ui_utils_label_set_text(this->info_label, "GPS is not supported", "left"); + return; + } + + DBG("value: %d", value); + + switch(value) + { + case 0: + ui_utils_label_set_text(this->info_label, "GPS is disabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "GPS is searching for satellites", "left"); + break; + + case 2: + ui_utils_label_set_text(this->info_label, "GPS connection is established", "left"); + break; + + default: + ui_utils_label_set_text(this->info_label, "Unknown status", "left"); + break; + + } +} + +/** + * @function _usb_state_changed_cb + * @since_tizen 2.3 + * @description usb State Changed Cb + * @parameter runtime_info_key_e key, void *user_data + * @return static void + */ +static void _usb_state_changed_cb(runtime_info_key_e key, void *user_data) +{ + RETM_IF(NULL == user_data, "user_data is null"); + int ret; + bool bvalue; + runtimeinfo_view *this = NULL; + this = (runtimeinfo_view*) user_data; + + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_USB_CONNECTED, &bvalue); + RETM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED,"runtime_info_get_value_int failed :%s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + ui_utils_label_set_text(this->info_label, "USB is not supported", "left"); + return; + } + + DBG("value: %d", bvalue); + + switch(bvalue) + { + case 0: + ui_utils_label_set_text(this->info_label, "USB Not Connected", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "USB is Connected", "left"); + break; + } + +} + +/** + * @function _bluetooth_state_changed_cb + * @since_tizen 2.3 + * @description bluetooth State Changed Cb + * @parameter runtime_info_key_e key, void *user_data + * @return static void + */ +static void _bluetooth_state_changed_cb(runtime_info_key_e key, void *user_data) +{ + RETM_IF(NULL == user_data, "user_data is null"); + int ret; + bool bvalue; + runtimeinfo_view *this = NULL; + this = (runtimeinfo_view*) user_data; + + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_BLUETOOTH_ENABLED , &bvalue); + RETM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED,"runtime_info_get_value_int failed :%s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + ui_utils_label_set_text(this->info_label, "Bluetooth is not supported", "left"); + return; + } + + DBG("value: %d", bvalue); + + switch(bvalue) + { + case 0: + ui_utils_label_set_text(this->info_label, "Bluetooth Not Enabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "Bluetooth is Enabled", "left"); + break; + } + +} + +/** + * @function _rotate_state_changed_cb + * @since_tizen 2.3 + * @description rotate State Changed Cb + * @parameter runtime_info_key_e key, void *user_data + * @return static void + */ +static void _rotate_state_changed_cb(runtime_info_key_e key, void *user_data) +{ + RETM_IF(NULL == user_data, "user_data is null"); + int ret; + bool bvalue; + runtimeinfo_view *this = NULL; + this = (runtimeinfo_view*) user_data; + + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_AUTO_ROTATION_ENABLED , &bvalue); + RETM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED,"runtime_info_get_value_int failed :%s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + ui_utils_label_set_text(this->info_label, "Auto Rotate is not supported", "left"); + return; + } + + DBG("value: %d", bvalue); + + switch(bvalue) + { + case 0: + ui_utils_label_set_text(this->info_label, "Auto Rotate Not Enabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "Auto Rotate is Enabled", "left"); + break; + } + + +} + +/** + * @function _location_state_changed_cb + * @since_tizen 2.3 + * @description location State Changed Cb + * @parameter runtime_info_key_e key, void *user_data + * @return static void + */ +static void _location_state_changed_cb(runtime_info_key_e key, void *user_data) +{ + RETM_IF(NULL == user_data, "user_data is null"); + int ret; + bool bvalue; + runtimeinfo_view *this = NULL; + this = (runtimeinfo_view*) user_data; + + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_LOCATION_SERVICE_ENABLED , &bvalue); + RETM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED,"runtime_info_get_value_int failed :%s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + ui_utils_label_set_text(this->info_label, "Location is not supported", "left"); + return; + } + + DBG("value: %d", bvalue); + + switch(bvalue) + { + case 0: + ui_utils_label_set_text(this->info_label, "Location Not Enabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "Location is Enabled", "left"); + break; + } + + +} + +/** + * @function _wifi_state_changed_cb + * @since_tizen 2.3 + * @description wifi State Changed Cb + * @parameter runtime_info_key_e key, void *user_data + * @return static void + */ +static void _wifi_state_changed_cb(runtime_info_key_e key, void *user_data) +{ + RETM_IF(NULL == user_data, "user_data is null"); + int ret; + bool bvalue; + runtimeinfo_view *this = NULL; + this = (runtimeinfo_view*) user_data; + + ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_WIFI_HOTSPOT_ENABLED , &bvalue); + RETM_IF(ret != RUNTIME_INFO_ERROR_NONE && ret != RUNTIME_INFO_ERROR_NOT_SUPPORTED,"runtime_info_get_value_int failed :%s",get_runtime_info_error(ret)); + if(ret == RUNTIME_INFO_ERROR_NOT_SUPPORTED) + { + ui_utils_label_set_text(this->info_label, "Wifi Hotspot is not supported", "left"); + return; + } + + DBG("value: %d", bvalue); + + switch(bvalue) + { + case 0: + ui_utils_label_set_text(this->info_label, "Wifi Hotspot Not Enabled", "left"); + break; + + case 1: + ui_utils_label_set_text(this->info_label, "Wifi Hotspot is Enabled", "left"); + break; + } + + +} + + #endif diff --git a/tbtcoreapp/src/view/tbt-sound-manager-view.c b/tbtcoreapp/src/view/tbt-sound-manager-view.c new file mode 100755 index 0000000..a9a96f3 --- /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; + 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 = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.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) + { + + 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, "1cnt", this->info_label); + return this; + } + else if (this->view->tbt_info->apptype == TBT_APP_SOUND_MANAGER_DEVICE) + { + + 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, "Insert Audio jack and change sound profile to 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, "1cnt", this->info_label); + 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"); + + 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/src/view/tbt-storage-view.c b/tbtcoreapp/src/view/tbt-storage-view.c new file mode 100755 index 0000000..65ea561 --- /dev/null +++ b/tbtcoreapp/src/view/tbt-storage-view.c @@ -0,0 +1,219 @@ +/******************************************************************************* + * 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-runtimeinfo-view.c + * @brief retrieves runtime info + * + * @author Nibha Sharma(nibha.sharma@samsung.com) + * @date June, 2016 + * @bug none + * @credit + * + */ +#include "utils/app_module_config.h" +#ifdef TBT_MODULE_STORAGE + +#include +#include + +#include "utils/logger.h" +#include "utils/config.h" +#include "utils/ui-utils.h" +#include "view/tbt-storage-view.h" +#include "view/tbt-common-view.h" + +struct _storage_view +{ + common_view* view; + + Evas_Object *info_label; +}; + +static void _app_destroy_cb(void* this); +static void _storage_state_changed_cb(int storage_id, storage_state_e state, void *user_data); +bool storage_device_supported_cb_p(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data); + +static int StorageID; +static bool is_not_supported = false; + +/** + * @function get_storage_error + * @since_tizen 3.0 + * @description Get Storage Error + * @parameter int: Int + * @return char* + */ +char* get_storage_type_error(int ret) +{ + char* err_msg = NULL; + switch (ret) { + case STORAGE_ERROR_NONE: + err_msg = "STORAGE_ERROR_NONE"; + break; + case STORAGE_ERROR_INVALID_PARAMETER: + err_msg = "STORAGE_ERROR_INVALID_PARAMETER"; + break; + case STORAGE_ERROR_OUT_OF_MEMORY: + err_msg = "STORAGE_ERROR_OUT_OF_MEMORY"; + break; + case STORAGE_ERROR_NOT_SUPPORTED: + err_msg = "STORAGE_ERROR_NOT_SUPPORTED"; + break; + case STORAGE_ERROR_OPERATION_FAILED: + err_msg = "STORAGE_ERROR_OPERATION_FAILED"; + break; + default: + err_msg = "Unknown Error"; + break; + } + + return err_msg; +} + + + +/** +* @function storage_device_supported_cb_p +* @description callback for supported devices +* @parameter storage_id : storage id, type : storage type, state : state, path : storage path, user_data : user data passed to callback +* @return bool +*/ +bool storage_device_supported_cb_p(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data) +{ + StorageID = 0; + storage_view *this = NULL; + this = (storage_view*) user_data; + if(type == STORAGE_TYPE_EXTERNAL) + { + StorageID=storage_id; + return false; + } + return true; +} + +/** + * @function storage_view_add + * @since_tizen 3.0 + * @description storage View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return storage_view* + */ +storage_view *storage_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + int ret; + storage_view *this = NULL; + this = calloc(1, sizeof(storage_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 = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + ret = storage_foreach_device_supported(storage_device_supported_cb_p, this); + RETVM_IF(ret != STORAGE_ERROR_NONE && ret != STORAGE_ERROR_NOT_SUPPORTED, NULL, "storage_foreach_device_supported failed : %s", get_storage_type_error(ret)); + if(ret == STORAGE_ERROR_NOT_SUPPORTED) + { + is_not_supported = true; + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Storage is not supported"); + RETVM_IF(!this->view, NULL,"Storage is not supported"); + } + + ret = storage_set_state_changed_cb(StorageID, _storage_state_changed_cb, this); + RETVM_IF(ret != STORAGE_ERROR_NONE, NULL, "storage_set_state_changed_cb failed : %s", get_storage_type_error(ret)); + + this->info_label = ui_utils_label_add(this->view->layout, "Please Change SD Card state[Remove/Insert]"); + elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); + + elm_object_part_content_set(this->view->layout, "1cnt", 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"); + + storage_view *view = NULL; + view = (storage_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); + } + + int ret = storage_unset_state_changed_cb( StorageID, _storage_state_changed_cb); + RETM_IF(ret != STORAGE_ERROR_NONE, "storage_unset_state_changed_cb fail > Error = %s", get_storage_type_error(ret)); + + SAFE_DELETE(view->view); + SAFE_DELETE(view); +} + + +/** + * @function storage_state_changed_cb + * @since_tizen 3.0 + * @description storage Info Changed Cb + * @parameter int storage_id, storage_state_e state, void *user_data + * @return void + */ +static void _storage_state_changed_cb(int storage_id, storage_state_e state, void *user_data) +{ + + RETM_IF(NULL == user_data, "user_data is null"); + storage_view *this = NULL; + this = (storage_view*) user_data; + + DBG("value: %d", state); + + switch (state) + { + case STORAGE_STATE_UNMOUNTABLE: + ui_utils_label_set_text(this->info_label, "STORAGE_STATE_UNMOUNTABLE", "left"); + break; + case STORAGE_STATE_REMOVED: + ui_utils_label_set_text(this->info_label, "STORAGE_STATE_REMOVED", "left"); + break; + case STORAGE_STATE_MOUNTED: + ui_utils_label_set_text(this->info_label, "STORAGE_STATE_MOUNTED", "left"); + break; + case STORAGE_STATE_MOUNTED_READ_ONLY: + ui_utils_label_set_text(this->info_label, "STORAGE_STATE_MOUNTED_READ_ONLY", "left"); + break; + default: + ui_utils_label_set_text(this->info_label, "unknown state", "left"); + break; + } +} + +#endif diff --git a/tbtcoreapp/tizen-manifest.xml b/tbtcoreapp/tizen-manifest.xml index 4509b62..e913861 100644 --- a/tbtcoreapp/tizen-manifest.xml +++ b/tbtcoreapp/tizen-manifest.xml @@ -1,7 +1,7 @@ - + tbtcoreapp.png @@ -19,9 +19,14 @@ http://tizen.org/privilege/internet http://tizen.org/privilege/network.set http://tizen.org/privilege/notification - http://tizen.org/privilege/callhistory.read + http://tizen.org/privilege/packagemanager.info + http://tizen.org/privilege/packagemanager.clearcache + http://tizen.org/privilege/network.set + http://tizen.org/privilege/volume.set + http://tizen.org/privilege/network.profile + http://tizen.org/privilege/callhistory.read http://tizen.org/privilege/callhistory.write http://tizen.org/privilege/contact.read http://tizen.org/privilege/contact.write - +