[Attach-panel] Add attach_panel feature 50/164250/1 submit/tizen/20180116.222316 submit/tizen/20180121.213450 submit/tizen/20180123.042020
authormoon87.park <moon87.park@samsung.com>
Mon, 18 Dec 2017 08:09:04 +0000 (17:09 +0900)
committermoon87.park <moon87.park@samsung.com>
Mon, 18 Dec 2017 08:09:04 +0000 (17:09 +0900)
Change-Id: Icb384a6d86ceb724ed6b613bc18e15bfcf4cdb18

doc/attach_panel_doc.h
include/attach_panel.h
include/attach_panel_private.h [new file with mode: 0644]
src/attach_panel.c

index 6dcfb954cf9bb686df186637cd92232cd907af0f..26eb86ad08bc16aae4330e3ba4b71b510a3a6b15 100755 (executable)
@@ -38,7 +38,8 @@
  * @section CAPI_PANEL_ATTACH_MODULE_FEATURE Related Features
  * This API is related with the following features: \n
  *  - %http://tizen.org/feature/camera \n
- *  - %http://tizen.org/feature/microphone
+ *  - %http://tizen.org/feature/microphone \n
+ *  - %http://tizen.org/feature/attach_panel\n
  * It is recommended to design feature related codes in your application for reliability. \n
  * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n
  * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
index a356e16b20362f59336bc81ea10e476a7ad535c5..1a329a63da01f3d9c593d2bba5bcceb3580782e2 100644 (file)
@@ -137,6 +137,8 @@ typedef enum attach_panel_error {
        ATTACH_PANEL_ERROR_NOT_INITIALIZED = TIZEN_ERROR_PANEL | 0x02, /**< The panel is not initialized yet */
        ATTACH_PANEL_ERROR_UNSUPPORTED_CONTENT_CATEGORY = TIZEN_ERROR_PANEL | 0x03, /**< Not supported content category */
        ATTACH_PANEL_ERROR_ALREADY_DESTROYED = TIZEN_ERROR_PANEL | 0x05, /**< The panel is already removed */
+       ATTACH_PANEL_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED,   /**< Not supported (Since 5.0) */
+
 } attach_panel_error_e;
 
 
@@ -154,6 +156,7 @@ typedef enum attach_panel_error {
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #ATTACH_PANEL_ERROR_ALREADY_EXISTS Already exists
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  * @see attach_panel_destroy()
  * @see attach_panel_add_content_category()
  * @see attach_panel_remove_content_category()
@@ -266,6 +269,7 @@ int attach_panel_create(Evas_Object *conformant, attach_panel_h *attach_panel);
  * @retval #ATTACH_PANEL_ERROR_NONE Successful
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  * @see attach_panel_create()
  * @see attach_panel_add_content_category()
  * @see attach_panel_remove_content_category()
@@ -364,6 +368,7 @@ int attach_panel_destroy(attach_panel_h attach_panel);
  * @retval #ATTACH_PANEL_ERROR_NOT_INITIALIZED not initialized
  * @retval #ATTACH_PANEL_ERROR_UNSUPPORTED_CONTENT_CATEGORY not supported content category
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  * @pre Call attach_panel_create() before calling this function.
  * @see attach_panel_create()
  * @see attach_panel_destroy()
@@ -487,6 +492,7 @@ int attach_panel_add_content_category(attach_panel_h attach_panel, attach_panel_
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_NOT_INITIALIZED not initialized
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  * @pre Call attach_panel_create() before calling this function.
  * @see attach_panel_create()
  * @see attach_panel_destroy()
@@ -580,6 +586,7 @@ int attach_panel_remove_content_category(attach_panel_h attach_panel, attach_pan
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
  * @retval #ATTACH_PANEL_ERROR_OUT_OF_MEMORY Fail to set the extra data
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  * @pre Call attach_panel_create() before calling this function.
  * @see attach_panel_create()
  * @see attach_panel_destroy()
@@ -738,6 +745,7 @@ int attach_panel_set_extra_data(attach_panel_h attach_panel, attach_panel_conten
  * @retval #ATTACH_PANEL_ERROR_NONE Successful
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  * @pre Call attach_panel_create() before calling this function.
  * @post The result_cb set with attach_panel_set_result_cb() will be called after an user select something to attach.
  * @see attach_panel_create()
@@ -851,6 +859,7 @@ int attach_panel_set_result_cb(attach_panel_h attach_panel, attach_panel_result_
  * @retval #ATTACH_PANEL_ERROR_NONE Successful
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  *
  * @pre Call attach_panel_create() before calling this function.
  * @see attach_panel_create()
@@ -932,6 +941,7 @@ int attach_panel_unset_result_cb(attach_panel_h attach_panel);
  * @retval #ATTACH_PANEL_ERROR_NONE Successful
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  *
  * @pre Call attach_panel_create() before calling this function.
  * @post The event_cb set with attach_panel_set_event_cb() will be called after publishing reserved events.
@@ -1014,6 +1024,7 @@ int attach_panel_set_event_cb(attach_panel_h attach_panel, attach_panel_event_cb
  * @retval #ATTACH_PANEL_ERROR_NONE Successful
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  * @pre Call attach_panel_create() before calling this function.
  * @see attach_panel_create()
  * @see attach_panel_destroy()
@@ -1070,6 +1081,7 @@ int attach_panel_unset_event_cb(attach_panel_h attach_panel);
  * @retval #ATTACH_PANEL_ERROR_NONE Successful
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  * @pre Call attach_panel_create() before calling this function.
  * @see attach_panel_create()
  * @see attach_panel_destroy()
@@ -1179,6 +1191,7 @@ int attach_panel_show(attach_panel_h attach_panel);
  * @retval #ATTACH_PANEL_ERROR_NONE Successful
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED The panel has been already destroyed
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  * @pre Call attach_panel_create() before calling this function.
  * @see attach_panel_create()
  * @see attach_panel_show()
@@ -1283,6 +1296,7 @@ int attach_panel_show_without_animation(attach_panel_h attach_panel);
  * @retval #ATTACH_PANEL_ERROR_NONE Successful
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  * @pre Call attach_panel_create() before calling this function.
  * @see attach_panel_create()
  * @see attach_panel_destroy()
@@ -1355,6 +1369,7 @@ int attach_panel_hide(attach_panel_h attach_panel);
  * @retval #ATTACH_PANEL_ERROR_NONE Successful
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED The panel has been already destroyed
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  * @pre Call attach_panel_create() before calling this function.
  * @see attach_panel_create()
  * @see attach_panel_hide()
@@ -1423,6 +1438,7 @@ int attach_panel_hide_without_animation(attach_panel_h attach_panel);
  * @retval #ATTACH_PANEL_ERROR_NONE Successful
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  * @pre Call attach_panel_create() before calling this function.
  * @see attach_panel_create()
  * @see attach_panel_destroy()
@@ -1507,6 +1523,7 @@ int attach_panel_get_visibility(attach_panel_h attach_panel, bool *visible);
  * @retval #ATTACH_PANEL_ERROR_NONE Successful
  * @retval #ATTACH_PANEL_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #ATTACH_PANEL_ERROR_ALREADY_DESTROYED already removed
+ * @retval #ATTACH_PANEL_ERROR_NOT_SUPPORTED Not supported
  *
  * @pre Call attach_panel_create() before calling this function.
  * @see attach_panel_state_e
diff --git a/include/attach_panel_private.h b/include/attach_panel_private.h
new file mode 100644 (file)
index 0000000..76afd84
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
+#ifndef __ATTACH_PANEL_PRIVATE_H__
+#define __ATTACH_PANEL_PRIVATE_H__
+
+#include <system_info.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define ATTACH_PANEL_FEATURE "http://tizen.org/feature/attach_panel"
+#define CHECK_ATTACH_PANEL_FEATURE() \
+       do { \
+               bool is_supported = false; \
+               if (!system_info_get_platform_bool(ATTACH_PANEL_FEATURE, &is_supported)) { \
+                       if (is_supported == false) { \
+                               _E("[%s] feature is disabled", ATTACH_PANEL_FEATURE); \
+                               return ATTACH_PANEL_ERROR_NOT_SUPPORTED; \
+                       } \
+               } \
+       } while (0)
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __ATTACH_PANEL_PRIVATE_H__ */
index 4c760df12d443c17b83426a5649d32d5ba72ca64..c473c6bbed7bc4a8c74e64d7cac803693369af71 100644 (file)
@@ -301,7 +301,7 @@ EXPORT_API int attach_panel_create(Evas_Object *conformant, attach_panel_h *atta
        int width = 0;
        int height = 0;
        int base_height = 0;
-
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
        retv_if(!conformant, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
 
@@ -417,6 +417,7 @@ extern void _attach_panel_del(attach_panel_h attach_panel)
 
 EXPORT_API int attach_panel_destroy(attach_panel_h attach_panel)
 {
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
        _D("%s : attach panel will be destroyed", __func__);
 
@@ -503,6 +504,7 @@ EXPORT_API int attach_panel_add_content_category(attach_panel_h attach_panel, at
        int ret = SYSTEM_INFO_ERROR_NONE;
        bool value = false;
 
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
        retv_if(!attach_panel->ui_manager, ATTACH_PANEL_ERROR_NOT_INITIALIZED);
        retv_if(content_category < ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
@@ -587,6 +589,7 @@ EXPORT_API int attach_panel_remove_content_category(attach_panel_h attach_panel,
        content_s *content_info = NULL;
        Eina_List *l = NULL;
 
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
        retv_if(!attach_panel->ui_manager, ATTACH_PANEL_ERROR_NOT_INITIALIZED);
        retv_if(content_category < ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
@@ -622,6 +625,7 @@ EXPORT_API int attach_panel_set_extra_data(attach_panel_h attach_panel, attach_p
        int ret = ATTACH_PANEL_ERROR_NONE;
        int bundle_is_op = 0;
 
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
        retv_if(!attach_panel->ui_manager, ATTACH_PANEL_ERROR_NOT_INITIALIZED);
        retv_if(content_category < ATTACH_PANEL_CONTENT_CATEGORY_IMAGE, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
@@ -701,6 +705,7 @@ EXPORT_API int attach_panel_set_extra_data(attach_panel_h attach_panel, attach_p
 
 EXPORT_API int attach_panel_set_result_cb(attach_panel_h attach_panel, attach_panel_result_cb result_cb, void *user_data)
 {
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
        retv_if(!result_cb, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
 
@@ -719,6 +724,7 @@ EXPORT_API int attach_panel_set_result_cb(attach_panel_h attach_panel, attach_pa
 
 EXPORT_API int attach_panel_unset_result_cb(attach_panel_h attach_panel)
 {
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
 
        if (EINA_TRUE == attach_panel->is_delete) {
@@ -736,6 +742,7 @@ EXPORT_API int attach_panel_unset_result_cb(attach_panel_h attach_panel)
 
 EXPORT_API int attach_panel_set_event_cb(attach_panel_h attach_panel, attach_panel_event_cb event_cb, void *user_data)
 {
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
        retv_if(!event_cb, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
 
@@ -754,6 +761,7 @@ EXPORT_API int attach_panel_set_event_cb(attach_panel_h attach_panel, attach_pan
 
 EXPORT_API int attach_panel_unset_event_cb(attach_panel_h attach_panel)
 {
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
 
        if (EINA_TRUE == attach_panel->is_delete) {
@@ -775,6 +783,7 @@ EXPORT_API int attach_panel_show(attach_panel_h attach_panel)
        content_s *content_info = NULL;
        int height = 0;
 
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
        retv_if(!attach_panel->ui_manager, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
 
@@ -832,6 +841,7 @@ EXPORT_API int attach_panel_show_without_animation(attach_panel_h attach_panel)
        content_s *content_info = NULL;
        int height = 0;
 
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
        retv_if(!attach_panel->ui_manager, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
 
@@ -885,6 +895,7 @@ EXPORT_API int attach_panel_show_without_animation(attach_panel_h attach_panel)
 
 EXPORT_API int attach_panel_hide(attach_panel_h attach_panel)
 {
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
        retv_if(!attach_panel->ui_manager, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
 
@@ -902,6 +913,7 @@ EXPORT_API int attach_panel_hide(attach_panel_h attach_panel)
 
 EXPORT_API int attach_panel_hide_without_animation(attach_panel_h attach_panel)
 {
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
        retv_if(!attach_panel->ui_manager, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
 
@@ -919,6 +931,7 @@ EXPORT_API int attach_panel_hide_without_animation(attach_panel_h attach_panel)
 
 EXPORT_API int attach_panel_get_visibility(attach_panel_h attach_panel, bool *visible)
 {
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
        retv_if(!visible, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
 
@@ -946,6 +959,7 @@ EXPORT_API int attach_panel_get_visibility(attach_panel_h attach_panel, bool *vi
 
 EXPORT_API int attach_panel_get_state(attach_panel_h attach_panel, attach_panel_state_e *state)
 {
+       CHECK_ATTACH_PANEL_FEATURE();
        retv_if(!attach_panel, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
        retv_if(!state, ATTACH_PANEL_ERROR_INVALID_PARAMETER);
 
@@ -985,7 +999,7 @@ static Eina_Bool _reply_timer_cb(void *data)
        attach_panel->result_cb(attach_panel
                        , content_info->innate_content_info->content_category
                        , attach_panel->reply
-                       , attach_panel->result 
+                       , attach_panel->result
                        , attach_panel->result_data);
        app_control_destroy(attach_panel->reply);
        attach_panel->reply = NULL;