[ACR-1842] Deprecate shortcut api 47/310447/11
authorSukhyungKang <shine.kang@samsung.com>
Mon, 29 Apr 2024 06:35:36 +0000 (15:35 +0900)
committerSukhyungKang <shine.kang@samsung.com>
Tue, 25 Jun 2024 00:45:31 +0000 (09:45 +0900)
Change-Id: Ie5abccd20d14beba3eb703efecb6bfacb98c03dc
Signed-off-by: SukhyungKang <shine.kang@samsung.com>
doc/shortcut_doc.h
lib/include/shortcut.h
lib/include/shortcut_error.h
lib/include/shortcut_internal.h
lib/include/shortcut_manager.h
lib/src/shortcut_manager.cc

index 1684d6483b0a242c3b52665de6ad91a5322ec0a8..1c5c1db0960badfc9d18d048bfd9b0ba120fcac3 100755 (executable)
@@ -22,7 +22,7 @@
 
 /**
  * @ingroup CAPI_APPLICATION_FRAMEWORK
- * @defgroup SHORTCUT_MODULE Shortcut
+ * @defgroup SHORTCUT_MODULE Shortcut (Deprecated)
  * @brief To enhance the Add to home feature.
  *        - The other for the application developers who should implement the Add to home feature.
  * @section SHORTCUT_MODULE_HEADER Required Header
index 68e7d4cff75599fd7955e58aef24f2670acefeb3..0d3aa122c57c620d18e13638ceb5d08a3566eba9 100644 (file)
@@ -37,74 +37,6 @@ extern "C" {
  * @{
  */
 
-/**
- * @brief Called to receive the result of add_to_home_shortcut().
- * @since_tizen 2.3
- * @param[in] ret The result value, it could be @c 0 if it succeeds to add a shortcut,
- *                otherwise it returns an errno
- * @param[in] pid The process ID of who handle this add_to_home request
- * @param[in] user_data The user data passed from the registration function
- * @return int @c 0 if there is no error, otherwise errno
- * @see add_to_home_shortcut()
- */
-typedef int (*result_internal_cb)(int ret, int pid, void *user_data);
-
-/**
- * @brief Enumeration for shortcut types.
- * @details Basically, three types of shortcuts are defined.
- *          Every homescreen developer should support these types of shortcuts.
- *          Or return a proper errno to figure out why the application failed to add a shortcut.
- *          #LAUNCH_BY_PACKAGE is used for adding a package itself as a shortcut.
- *          #LAUNCH_BY_URI is used for adding a shortcut for "uri" data.
- * @since_tizen 2.3
- */
-enum shortcut_internal_type {
-       /**< Deprecated type */
-       SHORTCUT_PACKAGE        = 0x00000000,   /**< Launch the package using the given package name */
-       SHORTCUT_DATA           = 0x00000001,   /**< Launch the related package with the given data(content_info) */
-       SHORTCUT_FILE           = 0x00000002,   /**< Launch the related package with the given filename(content_info) */
-
-       LAUNCH_BY_PACKAGE       = 0x00000000,
-
-       SHORTCUT_REMOVE         = 0x40000000,       /**< Remove a shortcut */
-       DYNAMICBOX_REMOVE               = 0x80000000,   /**< Remove a widget */
-
-       DYNAMICBOX_TYPE_DEFAULT   = 0x10000000, /**< Type mask for the default widget */
-       DYNAMICBOX_TYPE_EASY_DEFAULT = 0x30000000,      /**< Type mask for the easy mode widget */
-       DYNAMICBOX_TYPE_1x1       = 0x10010000, /**< 1x1 */
-       DYNAMICBOX_TYPE_2x1       = 0x10020000, /**< 2x1 */
-       DYNAMICBOX_TYPE_2x2       = 0x10040000, /**< 2x2 */
-       DYNAMICBOX_TYPE_4x1       = 0x10080000, /**< 4x1 */
-       DYNAMICBOX_TYPE_4x2       = 0x10100000, /**< 4x2 */
-       DYNAMICBOX_TYPE_4x3       = 0x10200000, /**< 4x3 */
-       DYNAMICBOX_TYPE_4x4       = 0x10400000, /**< 4x4 */
-       DYNAMICBOX_TYPE_4x5       = 0x11000000, /**< 4x5 */
-       DYNAMICBOX_TYPE_4x6       = 0x12000000, /**< 4x6 */
-       DYNAMICBOX_TYPE_EASY_1x1          = 0x30010000, /**< Easy mode 1x1 */
-       DYNAMICBOX_TYPE_EASY_3x1          = 0x30020000, /**< Easy mode 3x2 */
-       DYNAMICBOX_TYPE_EASY_3x3          = 0x30040000, /**< Easy mode 3x3 */
-       DYNAMICBOX_TYPE_UNKNOWN   = 0x1FFF0000, /**< Error */
-};
-
-#define SHORTCUT_ERROR (shortcut_error_quark())
-GQuark shortcut_error_quark(void);
-
-
-/**
- * @brief Definition for a macro to check type.
- * @since_tizen 2.3
- * @param[in] type The type of box
- * @return bool
- * @retval true(1) If it is a dynamicbox
- * @retval false(0) If it is not a dynamicbox
- * @see shortcut_type
- */
-#define ADD_TO_HOME_IS_DYNAMICBOX(type)        (!!((type) & 0x10000000))
-
-/* DEPRECATED API */
-int add_to_home_shortcut(const char *appid, const char *name, int type, const char *content_info, const char *icon, int allow_duplicate, result_internal_cb result_cb, void *data) __attribute__((deprecated));
-int add_to_home_dynamicbox(const char *appid, const char *name, int type, const char *content, const char *icon, double period, int allow_duplicate, result_internal_cb result_cb, void *data) __attribute__((deprecated));
-
 /**
  * @}
  */
index bb91924c31f1565f1ffcc7648d41c356615b776a..ec4ca524ac0db5a1c157110db10074d728ec7de3 100644 (file)
@@ -34,6 +34,7 @@ extern "C" {
  */
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Enumeration for values of shortcut response types.
  * @since_tizen 2.3
  */
index 9d760f36c11fe923568825de7bb147922d3fbb8c..a739803a58f581b1c3cc66501c9cff4ad9a37ee1 100644 (file)
@@ -40,6 +40,17 @@ int shortcut_add_to_home_widget_sync(const char *name,
                const char *icon, double period, int allow_duplicate);
 int shortcut_remove_from_home_sync(const char *name);
 
+/**
+ * @brief Definition for a macro to check type.
+ * @since_tizen 2.3
+ * @param[in] type The type of box
+ * @return bool
+ * @retval true(1) If it is a dynamicbox
+ * @retval false(0) If it is not a dynamicbox
+ * @see shortcut_type
+ */
+#define ADD_TO_HOME_IS_DYNAMICBOX(type)        (!!((type) & 0x10000000))
+
 /**
  * @}
  */
index 0b6fcf36651e37befa1777dd37931d05a2c7b8d3..2a47b896ae23922b82c7402e66040abaee1e48d9 100644 (file)
@@ -37,6 +37,7 @@ extern "C" {
 
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Enumeration for shortcut types.
  * @details Basically, two types of shortcuts are defined.
  *          Every homescreen developer should support these types of shortcuts.
@@ -51,6 +52,7 @@ typedef enum _shortcut_type {
 } shortcut_type;
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Enumeration for sizes of shortcut widget.
  * @since_tizen 2.4
  */
@@ -73,6 +75,7 @@ typedef enum shortcut_widget_size {
 
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Called to receive the result of shortcut_add_to_home().
  * @since_tizen 2.3
  * @param[in] ret The result value, it could be @c 0 if it succeeds to add a shortcut,
@@ -86,6 +89,7 @@ typedef int (*result_cb)(int ret, void *user_data);
 
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Adds a shortcut to home, asynchronously.
  * @since_tizen 2.3
  * @privlevel public
@@ -147,10 +151,11 @@ static int app_create(void *data)
 }
  * @endcode
  */
-int shortcut_add_to_home(const char *name, shortcut_type type, const char *uri, const char *icon, int allow_duplicate, result_cb cb, void *data);
+int shortcut_add_to_home(const char *name, shortcut_type type, const char *uri, const char *icon, int allow_duplicate, result_cb cb, void *data) TIZEN_DEPRECATED_API;
 
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Adds a widget to home, asynchronously.
  * @since_tizen 2.4
  * @privlevel public
@@ -214,10 +219,11 @@ static int app_create(void *data)
 }
  * @endcode
  */
-int shortcut_add_to_home_widget(const char *name, shortcut_widget_size_e size, const char *widget_id, const char *icon, double period, int allow_duplicate, result_cb cb, void *data);
+int shortcut_add_to_home_widget(const char *name, shortcut_widget_size_e size, const char *widget_id, const char *icon, double period, int allow_duplicate, result_cb cb, void *data) TIZEN_DEPRECATED_API;
 
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Removes a shortcut from home, asynchronously.
  * @details If the callback function registered for a widget, the shortcut deletion is possible.
  * @since_tizen 3.0
@@ -261,10 +267,11 @@ int _result_cb(int ret, void *data)
 
  * @endcode
  */
-int shortcut_remove_from_home(const char *name, result_cb cb, void *user_data);
+int shortcut_remove_from_home(const char *name, result_cb cb, void *user_data) TIZEN_DEPRECATED_API;
 
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Called to receive the result of shortcut_get_list().
  * @since_tizen 2.4
  * @param[in] package_name The name of package
@@ -280,6 +287,7 @@ typedef int (*shortcut_list_cb)(const char *package_name, const char *icon, cons
 
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Gets the preset list of shortcut template from the installed package, synchronously.
  * @since_tizen 2.4
  * @privlevel public
@@ -304,10 +312,11 @@ typedef int (*shortcut_list_cb)(const char *package_name, const char *icon, cons
  * @post You have to check the return status from the callback function which is passed by the argument.
  *
  */
-int shortcut_get_list(const char *package_name, shortcut_list_cb list_cb, void *data);
+int shortcut_get_list(const char *package_name, shortcut_list_cb list_cb, void *data) TIZEN_DEPRECATED_API;
 
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Called to the add_to_home request.
  * @details The homescreen should define a callback as this type and implement the service code
  *          for adding a new application shortcut.
@@ -331,6 +340,7 @@ typedef int (*shortcut_request_cb)(const char *package_name, const char *name, i
 
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Called to the shortcut_remove_from_home() request.
  * @since_tizen 3.0
  * @param[in] package_name The name of package
@@ -346,6 +356,7 @@ typedef int (*shortcut_remove_cb)(const char *package_name, const char *name, in
 
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Sets a callback function to listen requests from applications.
  * @since_tizen 2.4
  * @privlevel public
@@ -368,9 +379,10 @@ typedef int (*shortcut_remove_cb)(const char *package_name, const char *name, in
  * @see shortcut_request_cb()
  * @see shortcut_error_e
  */
-int shortcut_set_request_cb(shortcut_request_cb request_cb, void *data);
+int shortcut_set_request_cb(shortcut_request_cb request_cb, void *data) TIZEN_DEPRECATED_API;
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Unsets a callback for the shortcut request.
  * @since_tizen 3.0
  * @privlevel public
@@ -383,10 +395,11 @@ int shortcut_set_request_cb(shortcut_request_cb request_cb, void *data);
  * @see shortcut_set_request_cb()
  * @see get_last_result()
  */
-void shortcut_unset_request_cb(void);
+void shortcut_unset_request_cb(void) TIZEN_DEPRECATED_API;
 
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Sets the callback function to listen the remove requests from applications.
  * @since_tizen 3.0
  * @privlevel public
@@ -409,10 +422,11 @@ void shortcut_unset_request_cb(void);
  * @see shortcut_remove_cb()
  * @see shortcut_error_e
  */
-int shortcut_set_remove_cb(shortcut_remove_cb remove_cb, void *data);
+int shortcut_set_remove_cb(shortcut_remove_cb remove_cb, void *data) TIZEN_DEPRECATED_API;
 
 
 /**
+ * @deprecated Deprecated since 9.0
  * @brief Unsets a callback for the shortcut remove.
  * @since_tizen 3.0
  * @privlevel public
@@ -425,7 +439,7 @@ int shortcut_set_remove_cb(shortcut_remove_cb remove_cb, void *data);
  * @see shortcut_set_remove_cb()
  * @see get_last_result()
  */
-void shortcut_unset_remove_cb(void);
+void shortcut_unset_remove_cb(void) TIZEN_DEPRECATED_API;
 
 
 /**
index 69ffd660578dcef643d33ea6151f27e57a61ecfc..689e75ee0415555555828076966a1b536db3ad02 100644 (file)
@@ -169,6 +169,7 @@ void Connect() {
 }  // namespace
 
 EAPI int shortcut_set_request_cb(shortcut_request_cb request_cb, void* data) {
+  LOGW("DEPRECATION WARNING: shortcut_set_request_cb() is deprecated and will be removed from next release");
   CHECK_SHORTCUT_FEATURE();
   if (request_cb == nullptr)
     return SHORTCUT_ERROR_INVALID_PARAMETER;
@@ -192,6 +193,7 @@ EAPI int shortcut_set_request_cb(shortcut_request_cb request_cb, void* data) {
 }
 
 EAPI void shortcut_unset_request_cb() {
+  LOGW("DEPRECATION WARNING: shortcut_unset_request_cb() is deprecated and will be removed from next release");
   CHECK_SHORTCUT_FEATURE_RET_LAST_RESULT();
 
   try {
@@ -210,6 +212,7 @@ EAPI void shortcut_unset_request_cb() {
 }
 
 EAPI int shortcut_set_remove_cb(shortcut_remove_cb remove_cb, void* data) {
+  LOGW("DEPRECATION WARNING: shortcut_set_remove_cb() is deprecated and will be removed from next release");
   CHECK_SHORTCUT_FEATURE();
 
   if (remove_cb == nullptr)
@@ -231,6 +234,7 @@ EAPI int shortcut_set_remove_cb(shortcut_remove_cb remove_cb, void* data) {
 }
 
 EAPI void shortcut_unset_remove_cb() {
+  LOGW("DEPRECATION WARNING: shortcut_unset_remove_cb() is deprecated and will be removed from next release");
   CHECK_SHORTCUT_FEATURE_RET_LAST_RESULT();
   try {
     ::Connect();
@@ -249,6 +253,7 @@ EAPI void shortcut_unset_remove_cb() {
 EAPI int shortcut_add_to_home(const char* name, shortcut_type type,
     const char* uri, const char* icon, int allow_duplicate,
     result_cb cb, void* data) {
+  LOGW("DEPRECATION WARNING: shortcut_add_to_home() is deprecated and will be removed from next release");
   CHECK_SHORTCUT_FEATURE();
   if (ADD_TO_HOME_IS_DYNAMICBOX(type)) {
     _E("Invalid type used for adding a shortcut");
@@ -283,6 +288,7 @@ EAPI int shortcut_add_to_home(const char* name, shortcut_type type,
 EAPI int shortcut_add_to_home_widget(const char* name,
     shortcut_widget_size_e size, const char* widget_id, const char* icon,
     double period, int allow_duplicate, result_cb cb, void* data) {
+  LOGW("DEPRECATION WARNING: shortcut_add_to_home_widget() is deprecated and will be removed from next release");
   CHECK_SHORTCUT_FEATURE();
 
   if (name == nullptr) {
@@ -323,6 +329,7 @@ EAPI int shortcut_add_to_home_widget(const char* name,
 
 EAPI int shortcut_remove_from_home(const char* name, result_cb cb,
     void* user_data) {
+  LOGW("DEPRECATION WARNING: shortcut_remove_from_home() is deprecated and will be removed from next release");
   CHECK_SHORTCUT_FEATURE();
   if (name == nullptr) {
     _E("name is NULL.");
@@ -354,6 +361,7 @@ EAPI int shortcut_get_list(const char* package_name, shortcut_list_cb list_cb,
     void* data) {
   int ret = SHORTCUT_ERROR_NONE;
 
+  LOGW("DEPRECATION WARNING: shortcut_get_list() is deprecated and will be removed from next release");
   CHECK_SHORTCUT_FEATURE();
   if (list_cb == nullptr)
     return SHORTCUT_ERROR_INVALID_PARAMETER;
@@ -379,6 +387,7 @@ EAPI int shortcut_get_list(const char* package_name, shortcut_list_cb list_cb,
 
 EAPI int shortcut_add_to_home_sync(const char* name, shortcut_type type,
     const char* uri, const char* icon, int allow_duplicate) {
+  LOGW("DEPRECATION WARNING: shortcut_add_to_home_sync() is deprecated and will be removed from next release");
   CHECK_SHORTCUT_FEATURE();
 
   if (ADD_TO_HOME_IS_DYNAMICBOX(type)) {
@@ -414,6 +423,7 @@ EAPI int shortcut_add_to_home_sync(const char* name, shortcut_type type,
 EAPI int shortcut_add_to_home_widget_sync(const char *name,
     shortcut_widget_size_e size, const char *widget_id,
     const char *icon, double period, int allow_duplicate) {
+  LOGW("DEPRECATION WARNING: shortcut_add_to_home_widget_sync() is deprecated and will be removed from next release");
   CHECK_SHORTCUT_FEATURE();
 
   if (name == NULL) {
@@ -452,6 +462,7 @@ EAPI int shortcut_add_to_home_widget_sync(const char *name,
 }
 
 EAPI int shortcut_remove_from_home_sync(const char *name) {
+  LOGW("DEPRECATION WARNING: shortcut_remove_from_home_sync() is deprecated and will be removed from next release");
   CHECK_SHORTCUT_FEATURE();
 
   if (name == NULL) {