Initialize Tizen 2.3
[platform/core/appfw/badge.git] / include / badge_internal.h
1 /*
2  *  libbadge
3  *
4  * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Youngjoo Park <yjoo93.park@samsung.com>,
7  *      Seungtaek Chung <seungtaek.chung@samsung.com>, Youngsub Ko <ys4610.ko@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the License);
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an AS IS BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23 #ifndef __BADGE_INTERNAL_DEF_H__
24 #define __BADGE_INTERNAL_DEF_H__
25
26 #include <stdbool.h>
27 #include <stdarg.h>
28
29 #include "badge_error.h"
30 #include "badge.h"
31
32 #ifndef EXPORT_API
33 #define EXPORT_API __attribute__ ((visibility("default")))
34 #endif
35
36 typedef struct _badge_h badge_h;
37
38 char *_badge_get_pkgname_by_pid(void);
39
40 badge_error_e _badge_is_existing(const char *pkgname, bool *existing);
41
42 badge_error_e _badge_foreach_existed(badge_cb callback, void *data);
43
44 badge_error_e _badge_insert(badge_h *badge);
45
46 badge_error_e _badge_remove(const char *caller, const char *pkgname);
47
48 badge_error_e _badget_set_count(const char *caller, const char *pkgname,
49                         unsigned int count);
50
51 badge_error_e _badget_get_count(const char *pkgname, unsigned int *count);
52
53 badge_error_e _badget_set_display(const char *pkgname,
54                         unsigned int is_display);
55
56 badge_error_e _badget_get_display(const char *pkgname, unsigned int *is_display);
57
58 badge_error_e _badge_register_changed_cb(badge_change_cb callback, void *data);
59
60 badge_error_e _badge_unregister_changed_cb(badge_change_cb callback);
61
62 badge_error_e _badge_free(badge_h *badge);
63
64 badge_h *_badge_new(const char *pkgname, const char *writable_pkgs,
65                 badge_error_e *err);
66
67 char *_badge_pkgs_new(badge_error_e *err, const char *pkg1, ...);
68
69 char *_badge_pkgs_new_valist(badge_error_e *err,
70                         const char *pkg1, va_list args);
71
72 void badge_changed_cb_call(unsigned int action, const char *pkgname,
73                         unsigned int count);
74
75 #endif /* __BADGE_INTERNAL_DEF_H__ */
76