Modify error code for badge API
[platform/core/appfw/badge.git] / include / badge_setting.h
1 /*
2  * Copyright (c) 2016 - 2017 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
18 #ifndef __BADGE_SETTING_H__
19 #define __BADGE_SETTING_H__
20
21 #include <stdbool.h>
22 #include <sys/types.h>
23 #include "badge_error.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /*  __cplusplus */
28
29 /**
30  * @file badge_setting.h
31  * @brief This file contains the badge APIs.
32  */
33
34 /**
35  * @addtogroup BADGE_MODULE
36  * @{
37  */
38
39 typedef struct badge_setting *badge_setting_h;
40
41 struct badge_setting {
42         char *pkgname;
43         char *appid;
44         int allow_to_display;
45 };
46
47 int badge_setting_get_pkgname(badge_setting_h setting, char **pkgname);
48 int badge_setting_get_appid(badge_setting_h setting, char **appid);
49 int badge_setting_set_allow_to_display(badge_setting_h setting, bool value);
50 int badge_setting_get_allow_to_display(badge_setting_h setting, bool *value);
51 int badge_setting_update_setting(badge_setting_h setting);
52 int badge_setting_update_setting_for_uid(badge_setting_h setting, uid_t uid);
53 int badge_setting_get_setting_by_appid(badge_setting_h *setting, const char *appid);
54 int badge_setting_get_setting_by_appid_for_uid(badge_setting_h *setting, const char *appid, uid_t uid);
55 int badge_setting_free_setting(badge_setting_h setting);
56
57 /**
58  * @}
59  */
60
61 #ifdef __cplusplus
62 }
63 #endif /* __cplusplus */
64
65 #endif /* __BADGE_SETTING_H__ */