Using gdbus for IPC instead of com-core package
[platform/core/api/notification.git] / src / notification_error.c
1 /*
2  *  libnotification
3  *
4  * Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #include <gio/gio.h>
21 #include "notification_error.h"
22
23 static const GDBusErrorEntry dbus_error_entries[] =
24 {
25         {NOTIFICATION_ERROR_INVALID_PARAMETER, "org.freedesktop.Notification.Error.INVALID_PARAMETER"},
26         {NOTIFICATION_ERROR_OUT_OF_MEMORY,     "org.freedesktop.Notification.Error.OUT_OF_MEMORY"},
27         {NOTIFICATION_ERROR_IO_ERROR,          "org.freedesktop.Notification.Error.IO_ERROR"},
28         {NOTIFICATION_ERROR_PERMISSION_DENIED, "org.freedesktop.Notification.Error.PERMISSION_DENIED"},
29         {NOTIFICATION_ERROR_FROM_DB,           "org.freedesktop.Notification.Error.FROM_DB"},
30         {NOTIFICATION_ERROR_ALREADY_EXIST_ID,  "org.freedesktop.Notification.Error.ALREADY_EXIST_ID"},
31         {NOTIFICATION_ERROR_FROM_DBUS,         "org.freedesktop.Notification.Error.FROM_DBUS"},
32         {NOTIFICATION_ERROR_NOT_EXIST_ID,      "org.freedesktop.Notification.Error.NOT_EXIST_ID"},
33         {NOTIFICATION_ERROR_SERVICE_NOT_READY, "org.freedesktop.Notification.Error.SERVICE_NOT_READY"},
34         {NOTIFICATION_ERROR_INVALID_OPERATION, "org.freedesktop.Notification.Error.INVALID_OPERATION"},
35 };
36
37 EXPORT_API GQuark notification_error_quark (void)
38 {
39         static volatile gsize quark_volatile = 0;
40         g_dbus_error_register_error_domain ("notification-error-quark",
41                         &quark_volatile,
42                         dbus_error_entries,
43                         G_N_ELEMENTS(dbus_error_entries));
44         return (GQuark) quark_volatile;
45 }
46