BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(db-util)
BuildRequires: pkgconfig(heynoti)
+BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(ail)
BuildRequires: pkgconfig(aul)
+BuildRequires: pkgconfig(appsvc)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(com-core)
BuildRequires: pkgconfig(ecore)
Requires(postun): /sbin/ldconfig
%description
-Client library for sending notifications.
+Client/Server library for sending notifications.
%prep
%setup -q
%package devel
Summary: Notification library (devel)
-Group: Development/Applications
+Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
Development files needed to build software that needs to system a system notification.
+%package service-devel
+Summary: Notification library (service-devel)
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description service-devel
+Development files needed to build notification service
+
%build
%cmake .
make %{?jobs:-j%jobs}
%install
+rm -rf %{buildroot}
%make_install
mkdir -p %{buildroot}/usr/share/license
cp -f LICENSE.APLv2.0 %{buildroot}/usr/share/license/%{name}
+%clean
+rm -rf %{buildroot}
+
%post
/sbin/ldconfig
chown :5000 /opt/dbspace/.notification.db
chown :5000 /opt/dbspace/.notification.db-journal
-chmod 660 /opt/dbspace/.notification.db
-chmod 660 /opt/dbspace/.notification.db-journal
+chmod 640 /opt/dbspace/.notification.db
+chmod 640 /opt/dbspace/.notification.db-journal
chsmack -a 'notification::db' /opt/dbspace/.notification.db*
-vconftool set -t string memory/private/libstatus/message "" -i -g 5000
+SMACK_OPTION="-s system::vconf_misc"
+vconftool set -t string memory/private/libstatus/message "" -i -g 5000 -f $SMACK_OPTION
%postun -p /sbin/ldconfig
%files devel
%defattr(-,root,root,-)
-%{_includedir}/notification/*.h
+%{_includedir}/notification/notification.h
+%{_includedir}/notification/notification_error.h
+%{_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
+%defattr(-,root,root,-)
+%{_includedir}/notification/service/notification_ipc.h
+%{_includedir}/notification/service/notification_noti.h
+%{_includedir}/notification/service/notification_setting_service.h
+%{_libdir}/pkgconfig/notification-service.pc
#include <aul.h>
#include <ail.h>
+#include <appsvc.h>
#include <vconf-keys.h>
#include <vconf.h>
}
}
-/* notification_set_icon will be removed */
-EXPORT_API notification_error_e notification_set_icon(notification_h noti,
- const char *icon_path)
-{
- int ret_err = NOTIFICATION_ERROR_NONE;
-
- ret_err =
- notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON,
- icon_path);
-
- return ret_err;
-}
-
-/* notification_get_icon will be removed */
-EXPORT_API notification_error_e notification_get_icon(notification_h noti,
- char **icon_path)
-{
- int ret_err = NOTIFICATION_ERROR_NONE;
- char *ret_image_path = NULL;
-
- ret_err =
- notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON,
- &ret_image_path);
-
- if (ret_err == NOTIFICATION_ERROR_NONE && icon_path != NULL) {
- *icon_path = ret_image_path;
-
- //NOTIFICATION_DBG("Get icon : %s", *icon_path);
- }
-
- return ret_err;
-}
-
EXPORT_API notification_error_e notification_set_image(notification_h noti,
notification_image_type_e type,
const char *image_path)
return NOTIFICATION_ERROR_NONE;
}
-EXPORT_API notification_error_e notification_set_title(notification_h noti,
- const char *title,
- const char *loc_title)
-{
- int noti_err = NOTIFICATION_ERROR_NONE;
-
- noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
- title, loc_title,
- NOTIFICATION_VARIABLE_TYPE_NONE);
-
- return noti_err;
-}
-
-EXPORT_API notification_error_e notification_get_title(notification_h noti,
- char **title,
- char **loc_title)
-{
- int noti_err = NOTIFICATION_ERROR_NONE;
- char *ret_text = NULL;
-
- noti_err =
- notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
- &ret_text);
-
- if (title != NULL) {
- *title = ret_text;
- }
-
- if (loc_title != NULL) {
- *loc_title = NULL;
- }
-
- return noti_err;
-}
-
-EXPORT_API notification_error_e notification_set_content(notification_h noti,
- const char *content,
- const char *loc_content)
-{
- int noti_err = NOTIFICATION_ERROR_NONE;
-
- noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
- content, loc_content,
- NOTIFICATION_VARIABLE_TYPE_NONE);
-
- return noti_err;
-}
-
-EXPORT_API notification_error_e notification_get_content(notification_h noti,
- char **content,
- char **loc_content)
-{
- int noti_err = NOTIFICATION_ERROR_NONE;
- char *ret_text = NULL;
-
- noti_err =
- notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
- &ret_text);
-
- if (content != NULL) {
- *content = ret_text;
- }
-
- if (loc_content != NULL) {
- *loc_content = NULL;
- }
-
- return noti_err;
-
-#if 0
- ret =
- vconf_get_bool
- (VCONFKEY_SETAPPL_STATE_TICKER_NOTI_DISPLAY_CONTENT_BOOL, &boolval);
-
- if (ret == -1 || boolval == 0) {
- if (content != NULL && noti->default_content != NULL) {
- *content = noti->default_content;
- }
-
- if (loc_content != NULL && noti->loc_default_content != NULL) {
- *loc_content = noti->loc_default_content;
- }
- }
-#endif
-}
-
EXPORT_API notification_error_e notification_set_text(notification_h noti,
notification_text_type_e type,
const char *text,
return NOTIFICATION_ERROR_NONE;
}
-EXPORT_API notification_error_e notification_set_args(notification_h noti,
- bundle * args,
- bundle * group_args)
-{
- if (noti == NULL || args == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
- }
-
- if (noti->args) {
- bundle_free(noti->args);
- }
-
- noti->args = bundle_dup(args);
-
- if (noti->group_args) {
- bundle_free(noti->group_args);
- noti->group_args = NULL;
- }
-
- if (group_args != NULL) {
- noti->group_args = bundle_dup(group_args);
- }
-
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API notification_error_e notification_get_args(notification_h noti,
- bundle ** args,
- bundle ** group_args)
-{
- if (noti == NULL || args == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
- }
-
- if (noti->args) {
- *args = noti->args;
- } else {
- *args = NULL;
- }
-
- if (group_args != NULL && noti->group_args) {
- *group_args = noti->group_args;
- }
-
- return NOTIFICATION_ERROR_NONE;
-}
-
EXPORT_API notification_error_e notification_set_execute_option(notification_h noti,
notification_execute_type_e type,
const char *text,
bundle_add(b, buf_key, key);
}
- switch (type) {
+ switch ((int)type) {
case NOTIFICATION_EXECUTE_TYPE_RESPONDING:
/* Remove previous data if exist */
if (noti->b_service_responding != NULL) {
bundle_dup(service_handle);
}
break;
- case NOTIFICATION_EXECUTE_TYPE_NONE:
- case NOTIFICATION_EXECUTE_TYPE_MAX:
- NOTIFICATION_ERR("invalid execution type");
- break;
}
return NOTIFICATION_ERROR_NONE;
return NOTIFICATION_ERROR_NONE;
}
-EXPORT_API notification_error_e notification_delete_group_by_group_id(const char *pkgname,
- notification_type_e type,
- int group_id)
-{
- int ret = 0;
- char *caller_pkgname = NULL;
-
- if (pkgname == NULL) {
- caller_pkgname = _notification_get_pkgname_by_pid();
- } else {
- caller_pkgname = strdup(pkgname);
- }
-
- ret = notification_ipc_request_delete_multiple(type, caller_pkgname);
- if (ret != NOTIFICATION_ERROR_NONE) {
- if (caller_pkgname) {
- free(caller_pkgname);
- }
- return ret;
- }
-
- if (caller_pkgname) {
- free(caller_pkgname);
- }
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API notification_error_e notification_delete_group_by_priv_id(const char *pkgname,
- notification_type_e type,
- int priv_id)
-{
- int ret = 0;
- char *caller_pkgname = NULL;
-
- if (pkgname == NULL) {
- caller_pkgname = _notification_get_pkgname_by_pid();
- } else {
- caller_pkgname = strdup(pkgname);
- }
-
- ret = notification_ipc_request_delete_single(type, caller_pkgname, priv_id);
- if (ret != NOTIFICATION_ERROR_NONE) {
- if (caller_pkgname) {
- free(caller_pkgname);
- }
- return ret;
- }
-
- if (caller_pkgname) {
- free(caller_pkgname);
- }
- return NOTIFICATION_ERROR_NONE;
-}
-
EXPORT_API notification_error_e notification_delete_by_priv_id(const char *pkgname,
notification_type_e type,
int priv_id)
notification_cb_list_s *noti_cb_list_new = NULL;
notification_cb_list_s *noti_cb_list = NULL;
+ if (changed_cb == NULL) {
+ return NOTIFICATION_ERROR_INVALID_DATA;
+ }
if (notification_ipc_monitor_init() != NOTIFICATION_ERROR_NONE) {
return NOTIFICATION_ERROR_IO;
}
noti_cb_list = g_notification_cb_list;
+ if (changed_cb == NULL) {
+ return NOTIFICATION_ERROR_INVALID_DATA;
+ }
if (noti_cb_list == NULL) {
return NOTIFICATION_ERROR_INVALID_DATA;
}
notification_cb_list_s *noti_cb_list_new = NULL;
notification_cb_list_s *noti_cb_list = NULL;
+ if (detailed_changed_cb == NULL) {
+ return NOTIFICATION_ERROR_INVALID_DATA;
+ }
if (notification_ipc_monitor_init() != NOTIFICATION_ERROR_NONE) {
return NOTIFICATION_ERROR_IO;
}
noti_cb_list = g_notification_cb_list;
+ if (detailed_changed_cb == NULL) {
+ return NOTIFICATION_ERROR_INVALID_DATA;
+ }
if (noti_cb_list == NULL) {
return NOTIFICATION_ERROR_INVALID_DATA;
}
int ret = 0;
int noti_count = 0;
+ if (count == NULL) {
+ return NOTIFICATION_ERROR_INVALID_DATA;
+ }
+
ret =
notification_noti_get_count(type, pkgname, group_id, priv_id,
¬i_count);
return ret;
}
- if (count != NULL) {
- *count = noti_count;
- }
+ *count = noti_count;
return NOTIFICATION_ERROR_NONE;
}
notification_list_h get_list = NULL;
int ret = 0;
+ if (list == NULL) {
+ return NOTIFICATION_ERROR_INVALID_DATA;
+ }
+
ret = notification_noti_get_grouping_list(type, count, &get_list);
if (ret != NOTIFICATION_ERROR_NONE) {
return ret;
notification_list_h get_list = NULL;
int ret = 0;
+ if (list == NULL) {
+ return NOTIFICATION_ERROR_INVALID_DATA;
+ }
+
ret = notification_noti_get_grouping_list(type, count, &get_list);
if (ret != NOTIFICATION_ERROR_NONE) {
return ret;
notification_list_h get_list = NULL;
int ret = 0;
+ if (list == NULL) {
+ return NOTIFICATION_ERROR_INVALID_DATA;
+ }
+
ret =
notification_noti_get_detail_list(pkgname, group_id, priv_id, count,
&get_list);
notification_h noti = NULL;
if (list == NULL) {
- NOTIFICATION_ERR("INVALID DATA : list == NULL");
return NOTIFICATION_ERROR_INVALID_DATA;
}
notification_add_deffered_task(
void (*deffered_task_cb)(void *data), void *user_data)
{
+ if (deffered_task_cb == NULL) {
+ return NOTIFICATION_ERROR_INVALID_DATA;
+ }
+
return notification_ipc_add_deffered_task(deffered_task_cb, user_data);
}
notification_del_deffered_task(
void (*deffered_task_cb)(void *data))
{
+ if (deffered_task_cb == NULL) {
+ return NOTIFICATION_ERROR_INVALID_DATA;
+ }
+
return notification_ipc_del_deffered_task(deffered_task_cb);
}
+
+/* notification_set_icon will be removed */
+EXPORT_API notification_error_e notification_set_icon(notification_h noti,
+ const char *icon_path)
+{
+ int ret_err = NOTIFICATION_ERROR_NONE;
+
+ ret_err =
+ notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON,
+ icon_path);
+
+ return ret_err;
+}
+
+/* notification_get_icon will be removed */
+EXPORT_API notification_error_e notification_get_icon(notification_h noti,
+ char **icon_path)
+{
+ int ret_err = NOTIFICATION_ERROR_NONE;
+ char *ret_image_path = NULL;
+
+ ret_err =
+ notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON,
+ &ret_image_path);
+
+ if (ret_err == NOTIFICATION_ERROR_NONE && icon_path != NULL) {
+ *icon_path = ret_image_path;
+
+ //NOTIFICATION_DBG("Get icon : %s", *icon_path);
+ }
+
+ return ret_err;
+}
+
+EXPORT_API notification_error_e notification_set_title(notification_h noti,
+ const char *title,
+ const char *loc_title)
+{
+ int noti_err = NOTIFICATION_ERROR_NONE;
+
+ noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
+ title, loc_title,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
+
+ return noti_err;
+}
+
+EXPORT_API notification_error_e notification_get_title(notification_h noti,
+ char **title,
+ char **loc_title)
+{
+ int noti_err = NOTIFICATION_ERROR_NONE;
+ char *ret_text = NULL;
+
+ noti_err =
+ notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
+ &ret_text);
+
+ if (title != NULL) {
+ *title = ret_text;
+ }
+
+ if (loc_title != NULL) {
+ *loc_title = NULL;
+ }
+
+ return noti_err;
+}
+
+EXPORT_API notification_error_e notification_set_content(notification_h noti,
+ const char *content,
+ const char *loc_content)
+{
+ int noti_err = NOTIFICATION_ERROR_NONE;
+
+ noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
+ content, loc_content,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
+
+ return noti_err;
+}
+
+EXPORT_API notification_error_e notification_get_content(notification_h noti,
+ char **content,
+ char **loc_content)
+{
+ int noti_err = NOTIFICATION_ERROR_NONE;
+ char *ret_text = NULL;
+
+ noti_err =
+ notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
+ &ret_text);
+
+ if (content != NULL) {
+ *content = ret_text;
+ }
+
+ if (loc_content != NULL) {
+ *loc_content = NULL;
+ }
+
+ return noti_err;
+
+#if 0
+ ret =
+ vconf_get_bool
+ (VCONFKEY_SETAPPL_STATE_TICKER_NOTI_DISPLAY_CONTENT_BOOL, &boolval);
+
+ if (ret == -1 || boolval == 0) {
+ if (content != NULL && noti->default_content != NULL) {
+ *content = noti->default_content;
+ }
+
+ if (loc_content != NULL && noti->loc_default_content != NULL) {
+ *loc_content = noti->loc_default_content;
+ }
+ }
+#endif
+}
+
+EXPORT_API notification_error_e notification_set_args(notification_h noti,
+ bundle * args,
+ bundle * group_args)
+{
+ if (noti == NULL || args == NULL) {
+ return NOTIFICATION_ERROR_INVALID_DATA;
+ }
+
+ if (noti->args) {
+ bundle_free(noti->args);
+ }
+
+ noti->args = bundle_dup(args);
+
+ if (noti->group_args) {
+ bundle_free(noti->group_args);
+ noti->group_args = NULL;
+ }
+
+ if (group_args != NULL) {
+ noti->group_args = bundle_dup(group_args);
+ }
+
+ return NOTIFICATION_ERROR_NONE;
+}
+
+EXPORT_API notification_error_e notification_get_args(notification_h noti,
+ bundle ** args,
+ bundle ** group_args)
+{
+ if (noti == NULL || args == NULL) {
+ return NOTIFICATION_ERROR_INVALID_DATA;
+ }
+
+ if (noti->args) {
+ *args = noti->args;
+ } else {
+ *args = NULL;
+ }
+
+ if (group_args != NULL && noti->group_args) {
+ *group_args = noti->group_args;
+ }
+
+ return NOTIFICATION_ERROR_NONE;
+}
+
+EXPORT_API notification_error_e notification_delete_group_by_group_id(const char *pkgname,
+ notification_type_e type,
+ int group_id)
+{
+ int ret = 0;
+ char *caller_pkgname = NULL;
+
+ if (pkgname == NULL) {
+ caller_pkgname = _notification_get_pkgname_by_pid();
+ } else {
+ caller_pkgname = strdup(pkgname);
+ }
+
+ ret = notification_ipc_request_delete_multiple(type, caller_pkgname);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ if (caller_pkgname) {
+ free(caller_pkgname);
+ }
+ return ret;
+ }
+
+ if (caller_pkgname) {
+ free(caller_pkgname);
+ }
+ return NOTIFICATION_ERROR_NONE;
+}
+
+EXPORT_API notification_error_e notification_delete_group_by_priv_id(const char *pkgname,
+ notification_type_e type,
+ int priv_id)
+{
+ int ret = 0;
+ char *caller_pkgname = NULL;
+
+ if (pkgname == NULL) {
+ caller_pkgname = _notification_get_pkgname_by_pid();
+ } else {
+ caller_pkgname = strdup(pkgname);
+ }
+
+ ret = notification_ipc_request_delete_single(type, caller_pkgname, priv_id);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ if (caller_pkgname) {
+ free(caller_pkgname);
+ }
+ return ret;
+ }
+
+ if (caller_pkgname) {
+ free(caller_pkgname);
+ }
+ return NOTIFICATION_ERROR_NONE;
+}