Tizen 2.1 base
[framework/pim/calendar-service.git] / include / calendar_reminder.h
1 /*
2  * Calendar Service
3  *
4  * Copyright (c) 2012 - 2013 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 #ifndef __TIZEN_SOCAIL_CALENDAR_REMINDER_H__
21 #define __TIZEN_SOCAIL_CALENDAR_REMINDER_H__
22
23 #ifndef API
24 #define API __attribute__ ((visibility("default")))
25 #endif
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /**
32  * @addtogroup CAPI_SOCIAL_CALENDAR_SVC_REMINDER_MODULE
33  * @{
34  */
35
36 /**
37  * @brief   Adds a receiver to get noti when alarm alerts.
38  *
39  * @remarks If failed to run appsvc, added receiver will be removed from the table.
40  *
41  * @param[in]   pkgname                     The package name to add.
42  * @param[in]   extra_data_key          The user defined key to be passed via appsvc.
43  * @param[in]   extra_data_value        THe user defined value to be passed via appsvc.
44  *
45  * @return  0 on success, otherwise a negative error value.
46  * @retval  #CALENDAR_ERROR_NONE        Successful
47  * @retval  #CALENDAR_ERROR_DB_FAILED   Database operation failure
48  *
49  * @see calendar_reminder_remove_receiver()
50  */
51 API int calendar_reminder_add_receiver(const char *pkgname, const char *extra_data_key, const char *extra_data_value);
52
53 /**
54  * @brief   Removes a receiver to get noti when alarm alerts.
55  *
56  * @param[in]   pkgname                     The package name to add.
57  *
58  * @return  0 on success, otherwise a negative error value.
59  * @retval  #CALENDAR_ERROR_NONE        Successful
60  * @retval  #CALENDAR_ERROR_DB_FAILED   Database operation failure
61  *
62  * @see calendar_reminder_remove_receiver()
63  */
64 API int calendar_reminder_remove_receiver(const char *pkgname);
65
66 /**
67  * @brief   Activates a receiver to get noti when alarm alerts.
68  *
69  * @param[in]   pkgname                     The package name to add.
70  *
71  * @return  0 on success, otherwise a negative error value.
72  * @retval  #CALENDAR_ERROR_NONE        Successful
73  * @retval  #CALENDAR_ERROR_DB_FAILED   Database operation failure
74  *
75  * @see calendar_reminder_remove_receiver()
76  */
77 API int calendar_reminder_activate_receiver(const char *pkgname);
78
79 /**
80  * @brief   Deactivates a receiver to get noti when alarm alerts.
81  *
82  * @param[in]   pkgname                     The package name to add.
83  *
84  * @return  0 on success, otherwise a negative error value.
85  * @retval  #CALENDAR_ERROR_NONE        Successful
86  * @retval  #CALENDAR_ERROR_DB_FAILED   Database operation failure
87  *
88  * @see calendar_reminder_remove_receiver()
89  */
90 API int calendar_reminder_deactivate_receiver(const char *pkgname);
91
92 /**
93  * @brief   Check whether receiver exist in the table or not.
94  *
95  * @param[in]   pkgname                     The package name to add.
96  *
97  * @return  0 on success, otherwise a negative error value.
98  * @retval  #CALENDAR_ERROR_NONE        Successful
99  * @retval  #CALENDAR_ERROR_DB_FAILED   Database operation failure
100  *
101  * @see calendar_reminder_remove_receiver()
102  */
103 API bool calendar_reminder_has_receiver(const char *pkgname);
104
105 /**
106  * @}
107  */
108
109 #ifdef __cplusplus
110 }
111 #endif
112
113 #endif /* __TIZEN_SOCAIL_CALENDAR_REMINDER_H__ */
114