4 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Youngjoo Park <yjoo93.park@samsung.com>,
7 * Seungtaek Chung <seungtaek.chung@samsung.com>, Youngsub Ko <ys4610.ko@samsung.com>
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 #ifndef __BADGE_INTERNAL_DEF_H__
24 #define __BADGE_INTERNAL_DEF_H__
29 #include "badge_error.h"
33 #define EXPORT_API __attribute__ ((visibility("default")))
38 #endif /* __cplusplus */
40 typedef struct _badge_h badge_h;
42 char *_badge_get_pkgname_by_pid(void);
44 int _badge_is_existing(const char *pkgname, bool *existing);
46 int _badge_foreach_existed(badge_cb callback, void *data);
48 int _badge_insert(badge_h *badge);
50 int _badge_remove(const char *caller, const char *pkgname);
52 int _badget_set_count(const char *caller, const char *pkgname,
55 int _badget_get_count(const char *pkgname, unsigned int *count);
57 int _badget_set_display(const char *pkgname,
58 unsigned int is_display);
60 int _badget_get_display(const char *pkgname, unsigned int *is_display);
62 int _badge_register_changed_cb(badge_change_cb callback, void *data);
64 int _badge_unregister_changed_cb(badge_change_cb callback);
66 int _badge_free(badge_h *badge);
68 badge_h *_badge_new(const char *pkgname, const char *writable_pkgs,
71 char *_badge_pkgs_new(int *err, const char *pkg1, ...);
73 char *_badge_pkgs_new_valist(int *err,
74 const char *pkg1, va_list args);
76 void badge_changed_cb_call(unsigned int action, const char *pkgname,
81 * @brief Creates a badge for the designated package.
84 * @privilege %http://tizen.org/privilege/notification
85 * @details Creates new badge to display.
86 * @param[in] pkgname The name of the designated package
87 * @param[in] writable_pkg The name of package which is authorized to change the badge
88 * @return #BADGE_ERROR_NONE if success, other value if failure
95 int err = BADGE_ERROR_NONE;
97 err = badge_create("org.tizen.sms", "org.tizen.sms2");
98 if(err != BADGE_ERROR_NONE) {
105 int badge_create(const char *pkgname, const char *writable_pkg);
108 * @brief This function sets badge property for designated package.
109 * @param[in] pkgname The name of designated package
110 * @param[in] property name
111 * @param[in] property value
112 * @return #BADGE_ERROR_NONE if success, other value if failure
113 * @see #badge_error_e
115 int badge_setting_property_set(const char *pkgname, const char *property, const char *value);
118 * @brief This function gets badge property for designated package.
119 * @param[in] pkgname The name of designated package
120 * @param[in] property name
121 * @param[in] pointer which can save the getting value
122 * @return #BADGE_ERROR_NONE if success, other value if failure
123 * @see #badge_error_e
125 int badge_setting_property_get(const char *pkgname, const char *property, char **value);
129 #endif /* __cplusplus */
131 #endif /* __BADGE_INTERNAL_DEF_H__ */