NOTI_EX_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
NOTI_EX_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
NOTI_EX_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
- NOTI_EX_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Function not implemented */
NOTI_EX_ERROR_FROM_DB = TIZEN_ERROR_NOTIFICATION | 0x01, /**< Error from DB query */
- NOTI_EX_ERROR_ALREADY_EXIST_ID = TIZEN_ERROR_NOTIFICATION | 0x02, /**< Private ID already exists */
+ NOTI_EX_ERROR_ALREADY_EXIST_ID = TIZEN_ERROR_NOTIFICATION | 0x02, /**< Already exist private ID */
NOTI_EX_ERROR_FROM_DBUS = TIZEN_ERROR_NOTIFICATION | 0x03, /**< Error from DBus */
- NOTI_EX_ERROR_NOT_EXIST_ID = TIZEN_ERROR_NOTIFICATION | 0x04, /**< Private ID does not exist */
+ NOTI_EX_ERROR_NOT_EXIST_ID = TIZEN_ERROR_NOTIFICATION | 0x04, /**< Not exist private ID */
NOTI_EX_ERROR_SERVICE_NOT_READY = TIZEN_ERROR_NOTIFICATION | 0x05, /**< No response from notification service */
- NOTI_EX_ERROR_MAX_EXCEEDED = TIZEN_ERROR_NOTIFICATION | 0x06, /**< Max notification count exceeded */
} noti_ex_error_e;
#define NOTI_EX_RECEIVER_GROUP_POPUP "tizen.org/receiver/popup"
/**
+ * @brief Default sound.
+ * @since_tizen 5.5
+ */
+#define NOTIFICATION_SOUND_TYPE_DEFAULT "__SOUND_TYPE_DEFAULT__"
+
+/**
+ * @brief Default vibration.
+ * @since_tizen 5.5
+ */
+#define NOTIFICATION_VIBRATION_TYPE_DEFAULT "__VIBRATION_TYPE_DEFAULT__"
+
+/**
* @brief Enumeration for notification_ex item types.
* @since_tizen 5.5
*/
NOTI_EX_ITEM_POLICY_NONE = 0, /**< No policy */
NOTI_EX_ITEM_POLICY_ON_BOOT_CLEAR = 1 << 0, /**< On boot clear */
NOTI_EX_ITEM_POLICY_SIM_MODE = 1 << 1, /**< SIM mode */
+ NOTI_EX_ITEM_POLICY_DISABLE_AUTO_DELETE = 1 << 2, /**< Disable auto delete */
} noti_ex_item_policy_e;
/**
int noti_ex_item_get_type(noti_ex_item_h handle, int *type);
/**
- * @brief Gets the path of shared files.
- * @since_tizen 5.5
- * @remarks Each path in the @a paths must be released using free(), then the @a paths must be released using free().
- * @param[in] handle The notification_ex item handle
- * @param[out] paths The absolute paths of shared files
- * @param[out] count The number of paths
- * @return #NOTI_EX_ERROR_NONE On success, other value on failure
- * @retval #NOTI_EX_ERROR_NONE Success
- * @retval #NOTI_EX_ERROR_INVALID_PARAMETER Invalid parameter
- * @see #noti_ex_item_h
- * @par Sample code:
- * @code
-#include <notification_ex.h>
-
-{
- int ret;
- char **paths = NULL;
- int count;
-
- ret = noti_ex_item_get_shared_paths(item_handle, &paths, &count);
-}
- * @endcode
- */
-int noti_ex_item_get_shared_paths(noti_ex_item_h handle, char ***paths, int *count);
-
-/**
* @brief Gets the id of a notification_ex item.
* @since_tizen 5.5
* @remarks @a id must be released using free().
* @since_tizen 5.5
* @param[in] handle The notification_ex item handle
* @param[in] path The absolute path of sound for notification_ex item
+ * If you want to set a default sound, enter #NOTIFICATION_SOUND_TYPE_DEFAULT.
* @return #NOTI_EX_ERROR_NONE On success, other value on failure
* @retval #NOTI_EX_ERROR_NONE Success
* @retval #NOTI_EX_ERROR_INVALID_PARAMETER Invalid parameter
* @remarks @a path must be released using free().
* @param[in] handle The notification_ex item handle
* @param[out] path The absolute path of sound for notification_ex item
+ * If not set, you will get NULL.
+ * If set default, you will get #NOTIFICATION_SOUND_TYPE_DEFAULT.
* @return #NOTI_EX_ERROR_NONE On success, other value on failure
* @retval #NOTI_EX_ERROR_NONE Success
* @retval #NOTI_EX_ERROR_INVALID_PARAMETER Invalid parameter
* @since_tizen 5.5
* @param[in] handle The notification_ex item handle
* @param[in] path The absolute path of vibration for notification_ex item
+ * If you want to set a default sound, enter #NOTIFICATION_VIBRATION_TYPE_DEFAULT.
* @return #NOTI_EX_ERROR_NONE On success, other value on failure
* @retval #NOTI_EX_ERROR_NONE Success
* @retval #NOTI_EX_ERROR_INVALID_PARAMETER Invalid parameter
* @remarks @a path must be released using free().
* @param[in] handle The notification_ex item handle
* @param[out] path The absolute path of vibration for a notification_ex item
+ * If not set, you will get NULL.
+ * If set default, you will get #NOTIFICATION_VIBRATION_TYPE_DEFAULT.
* @return #NOTI_EX_ERROR_NONE On success, other value on failure
* @retval #NOTI_EX_ERROR_NONE Success
* @retval #NOTI_EX_ERROR_INVALID_PARAMETER Invalid parameter
* @see #noti_ex_item_h
* @par Sample code:
* @code
-#include <notification_exh>
+#include <notification_ex.h>
{
int ret;
noti_ex_item_h *item);
/**
+ * @brief Gets the extension data.
+ * @since_tizen 5.5
+ * @remarks The @a value should be released using bundle_free().
+ * @param[in] handle The notification_ex item handle
+ * @param[in] key The key
+ * @param[out] value The bundle data
+ * @return #NOTI_EX_ERROR_NONE On success, other value on failure
+ * @retval #NOTI_EX_ERROR_NONE Success
+ * @retval #NOTI_EX_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see #noti_ex_item_h
+ * @par Sample code:
+ * @code
+#include <notification_ex.h>
+
+{
+ int ret;
+ char *key = "ADDITIONAL_DATA_KEY";
+ bundle *b;
+
+ ret = noti_ex_item_get_extension_data(item_handle, key, &b);
+ ...
+ bundle_free(b);
+}
+ * @endcode
+ */
+int noti_ex_item_get_extension_data(noti_ex_item_h handle, const char *key,
+ bundle **value);
+
+/**
+ * @brief Sets the extension data.
+ * @since_tizen 5.5
+ * @param[in] handle The notification_ex item handle
+ * @param[in] key The key
+ * @param[in] value The bundle data
+ * @return #NOTI_EX_ERROR_NONE On success, other value on failure
+ * @retval #NOTI_EX_ERROR_NONE Success
+ * @retval #NOTI_EX_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see #noti_ex_item_h
+ * @par Sample code:
+ * @code
+#include <notification_ex.h>
+
+{
+ int ret;
+ char *key = "ADDITIONAL_DATA_KEY";
+ bundle *b = bundle_create();
+ bundle_add_str(b, "key", "value");
+
+ ret = noti_ex_item_set_extension_data(item_handle, key, b);
+ bundle_free(b);
+}
+ * @endcode
+ */
+int noti_ex_item_set_extension_data(noti_ex_item_h handle, const char *key,
+ bundle *value);
+
+/**
* @}
*/
return NOTI_EX_ERROR_NONE;
}
-extern "C" EXPORT_API int noti_ex_item_get_shared_paths(noti_ex_item_h handle,
- char ***path, int *count) {
- if (handle == nullptr || path == nullptr || count == nullptr) {
- LOGE("Invalid parameter");
- return NOTI_EX_ERROR_INVALID_PARAMETER;
- }
- Handle* p = static_cast<Handle*>(handle);
- list<string> shared_path = p->Get()->GetSharedPath();
- char** tmp_path = (char**)calloc(shared_path.size(), sizeof(char*));
- if (tmp_path == nullptr) {
- LOGE("Fail to create items");
- return NOTI_EX_ERROR_OUT_OF_MEMORY;
- }
-
- int idx = 0;
- for (auto& i : shared_path) {
- tmp_path[idx] = strdup(i.c_str());
- if (tmp_path[idx] == nullptr) {
- __noti_ex_free_str_array(tmp_path, idx);
- LOGE("Out of memory");
- return NOTI_EX_ERROR_OUT_OF_MEMORY;
- }
- idx++;
- }
-
- *path = tmp_path;
- *count = shared_path.size();
- return NOTI_EX_ERROR_NONE;
-}
-
extern "C" EXPORT_API int noti_ex_item_get_id(noti_ex_item_h handle,
char **id) {
if (handle == nullptr || id == nullptr) {