2. new internal API set for setting/getting property of settings.
Change-Id: I982fce9538d11d6465a02e6abb4f91431e1145f8
Signed-off-by: Kyuho Jo <kyuho.jo@samsung.com>
SET(MAJOR_VER 0)
SET(VERSION ${MAJOR_VER}.1.0)
-ADD_SUBDIRECTORY(test-app)
+# ADD_SUBDIRECTORY(test-app)
SET(SRCS
./src/notification.c
./include/notification_error.h
./include/notification_type.h
./include/notification_list.h
- ./include/notification_status.h)
+ ./include/notification_status.h
+ ./include/notification_setting.h
+ )
+
SET(HEADERS-SERVICE-DEVEL
./include/notification_ipc.h
return;
}
- noti_err = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER);
+ noti_err = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER | NOTIFICATION_DISPLAY_APP_INDICATOR);
if(noti_err != NOTIFICATION_ERROR_NONE) {
notification_free(noti);
return;
int notification_post(notification_h noti);
/**
+ * @brief Sets permissions to application for updating or deletin the notification
+ * @since_tizen 2.4
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/notification
+ * @param[in] noti Notification handle
+ * @param[in] permission_type permission type
+ * @param[in] app_id target application id
+ * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
+ * @see #notification_get_permission
+ * @see #notification_permission_type_e
+ * @see #notification_h
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ notification_h noti = NULL;
+ int noti_err = NOTIFICATION_ERROR_NONE;
+
+ noti = notification_create(NOTIFICATION_TYPE_NOTI);
+ if(noti == NULL) {
+ return;
+ }
+ ...
+
+ noti_err = notification_set_permission(noti, NOTIFICATION_PERMISSION_TYPE_DELETE, "org.tizen.xxx");
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_set_permission(notification_h handle, notification_permission_type_e permission_type, const char *app_id);
+
+/**
+ * @brief Gets permissions of the notification
+ * @remarks app_id must not be freed. This will be free with notification_free.
+ * @since_tizen 2.4
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/notification
+ * @param[in] noti Notification handle
+ * @param[out] permission_type permission type
+ * @param[out] app_id target application id
+ * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
+ * @see #notification_set_permission
+ * @see #notification_permission_type_e
+ * @see #notification_h
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ int noti_err = NOTIFICATION_ERROR_NONE;
+ notification_permission_type_e permission_type;
+ const char *app_id = NULL;
+
+ ...
+
+ noti_err = notification_get_permission(noti, &permission_type, &app_id);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_get_permission(notification_h handle, notification_permission_type_e *permission_type, const char **app_id);
+
+
+/**
* @}
*/
bundle **service_handle);
/**
- * @internal
- * @brief This function sets notification property for designated package.
- * @since_tizen 2.3
- * @privlevel public
- * @privilege http://tizen.org/privilege/core/notification
- * @param[in] pkgname The name of designated package
- * @param[in] property name
- * @param[in] property value
- * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
- * @see #notification_error_e
- */
-int notification_setting_property_set(const char *pkgname, const char *property, const char *value);
-
-/**
- * @internal
- * @brief This function gets notification property for designated package.
- * @since_tizen 2.3
- * @privlevel public
- * @privilege http://tizen.org/privilege/core/notification
- * @param[in] pkgname The name of designated package
- * @param[in] property name
- * @param[in] pointer which can save the getting value
- * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
- * @see #notification
- */
-int notification_setting_property_get(const char *pkgname, const char *property, char **value);
-
-/**
* @}
*/
extern "C" {
#endif
-notification_error_e notification_setting_property_set(const char *pkgname, const char *property, const char *value);
-notification_error_e notification_setting_property_get(const char *pkgname, const char *property, char **value);
+typedef enum _notification_setting_property {
+ NOTIFICATION_SETTING_PROPERTY_ALLOW_TO_NOTIFY = 1,
+ NOTIFICATION_SETTING_PROPERTY_DO_NOT_DISTURB = 2,
+ NOTIFICATION_SETTING_PROPERTY_VISIBILITY_CLASS = 3,
+} notification_setting_property_e;
+
+
+
+/**
+ * @internal
+ * @brief This function sets notification property for designated package.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/core/notification
+ * @param[in] pkgname The name of designated package
+ * @param[in] property name
+ * @param[in] property value
+ * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
+ * @see #notification_error_e
+ */
+int notification_setting_property_set(const char *pkgname, const char *property, const char *value);
+
+/**
+ * @internal
+ * @brief This function gets notification property for designated package.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/core/notification
+ * @param[in] pkgname The name of designated package
+ * @param[in] property name
+ * @param[in] pointer which can save the getting value
+ * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
+ * @see #notification
+ */
+int notification_setting_property_get(const char *pkgname, const char *property, char **value);
#ifdef __cplusplus
}
notification_h noti; /**< Notification handler */
} notification_op;
+typedef enum notification_permission_type {
+ NOTIFICATION_PERMISSION_TYPE_NONE = 0,
+ NOTIFICATION_PERMISSION_TYPE_DELETE = 1,
+ NOTIFICATION_PERMISSION_TYPE_UPDATE = 2,
+} notification_permission_type_e;
/**
* @}
*/
Name: notification
Summary: notification library
-Version: 0.2.25
+Version: 0.2.27
Release: 1
Group: TBD
License: Apache
chown :5000 /opt/dbspace/.notification.db
chown :5000 /opt/dbspace/.notification.db-journal
-chmod 640 /opt/dbspace/.notification.db
-chmod 640 /opt/dbspace/.notification.db-journal
+chmod 644 /opt/dbspace/.notification.db
+chmod 644 /opt/dbspace/.notification.db-journal
if [ -f /usr/lib/rpm-plugins/msm.so ]
then
chsmack -a 'notification::db' /opt/dbspace/.notification.db*
%{_includedir}/notification/notification_type.h
%{_includedir}/notification/notification_list.h
%{_includedir}/notification/notification_status.h
+%{_includedir}/notification/notification_setting.h
%{_libdir}/pkgconfig/notification.pc
%files service-devel
char buf_key[32] = { 0, };
const char *ret_val = NULL;
const char *get_str = NULL;
- const char *get_check_type_str = NULL;
notification_text_type_e check_type = NOTIFICATION_TEXT_TYPE_NONE;
//int display_option_flag = 0;
void notification_call_posted_toast_cb(const char *message)
{
if (posted_toast_message_cb != NULL) {
- posted_toast_message_cb(message);
+ posted_toast_message_cb((void*)message);
}
}
+
+EXPORT_API int notification_set_permission(notification_h handle, notification_permission_type_e permission_type, const char *app_id)
+{
+ return NOTIFICATION_ERROR_INVALID_OPERATION;
+}
+
+EXPORT_API int notification_get_permission(notification_h handle, notification_permission_type_e *permission_type, const char **app_id)
+{
+ return NOTIFICATION_ERROR_INVALID_OPERATION;
+}
return ret;
}
-static void
-popup_timeout_cb(void *data, Evas_Object *obj, void *event_info)
+static void popup_timeout_cb(void *data, Evas_Object *obj, void *event_info)
{
Eina_List *list = NULL;
char *msg = NULL;
#include <notification_debug.h>
#include <notification_ipc.h>
#include <notification_private.h>
+#include <notification_setting.h>
#define NOTIFICATION_SETTING_DB "notification_setting"
#define NOTIFICATION_SETTING_DB_PATH "/opt/usr/dbspace/.notification_parser.db"