Add multi-user feature
[platform/core/api/notification.git] / include / notification_setting_internal.h
1 /*
2  * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __NOTIFICATION_SETTING_INTERNAL_H__
18 #define __NOTIFICATION_SETTING_INTERNAL_H__
19
20 #include <stdbool.h>
21 #include "notification.h"
22 #include "notification_setting.h"
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /* Application setting */
29 struct notification_setting {
30         char *package_name;
31         bool  allow_to_notify;
32         bool  do_not_disturb_except;
33         int   visibility_class;
34 };
35
36 int notification_setting_get_setting_array(notification_setting_h *setting_array, int *count);
37 int notification_setting_get_setting_by_package_name(const char *package_name, notification_setting_h *setting);
38
39 int notification_setting_get_package_name(notification_setting_h setting, char **value);
40 int notification_setting_set_package_name(notification_setting_h setting, char *value);
41
42 int notification_setting_get_allow_to_notify(notification_setting_h setting, bool *value);
43 int notification_setting_set_allow_to_notify(notification_setting_h setting, bool value);
44
45 int notification_setting_get_do_not_disturb_except(notification_setting_h setting, bool *value);
46 int notification_setting_set_do_not_disturb_except(notification_setting_h setting, bool value);
47
48 int notification_setting_insert_package_for_uid(const char *package_id, uid_t uid);
49 int notification_setting_delete_package_for_uid(const char *package_id, uid_t uid);
50
51 /* System setting */
52 typedef struct notification_system_setting *notification_system_setting_h;
53
54 int notification_system_setting_load_system_setting(notification_system_setting_h *system_setting);
55 int notification_system_setting_update_system_setting(notification_system_setting_h system_setting);
56 int notification_system_setting_free_system_setting(notification_system_setting_h system_setting);
57
58 int notification_system_setting_get_do_not_disturb(notification_system_setting_h system_setting, bool *value);
59 int notification_system_setting_set_do_not_disturb(notification_system_setting_h system_setting, bool value);
60
61 int notification_system_setting_get_visibility_class(notification_system_setting_h system_setting, int *value);
62 int notification_system_setting_set_visibility_class(notification_system_setting_h system_setting, int value);
63
64 /* OLD IMPLEMENTATION */
65 int notification_setting_property_set(const char *pkgname, const char *property, const char *value) NOTIFICATION_DEPRECATED_API;
66 int notification_setting_property_get(const char *pkgname, const char *property, char **value) NOTIFICATION_DEPRECATED_API;
67
68 #ifdef __cplusplus
69 }
70 #endif
71 #endif /* __NOTIFICATION_SETTING_INTERNAL_H__ */
72