e885f342d48484021b061aee81dbef9787b84964
[platform/core/pim/calendar-service.git] / include / calendar_reminder.h
1 /*
2  * Calendar Service
3  *
4  * Copyright (c) 2012 - 2015 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_SOCIAL_CALENDAR_REMINDER_H__
21 #define __TIZEN_SOCIAL_CALENDAR_REMINDER_H__
22
23 #include <calendar_types.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /**
30  * @file calendar_reminder.h
31  */
32
33 /**
34  * @addtogroup CAPI_SOCIAL_CALENDAR_SVC_REMINDER_MODULE
35  * @{
36  */
37
38 /**
39  * @brief Called when an alarm is alerted.
40  *
41  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
42  *
43  * @param[in]   param  Value string like id=value&time=value&tick=value&unit=value&type=value
44  * @param[in]   user_data   The user data passed from the callback registration function
45  *
46  * @see calendar_reminder_add_cb()
47  */
48 typedef void (*calendar_reminder_cb)(const char *param, void* user_data);
49
50 /**
51  * @brief Adds a callback to get a notification when an alarm alerts.
52  *
53  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
54  *
55  * @privlevel public
56  * @privilege %http://tizen.org/privilege/calendar.read
57  *
58  * @param[in]   callback     The callback to be added
59  * @param[in]   user_data        The user data
60  *
61  * @return  @c 0 on success,
62  *          otherwise a negative error value
63  * @retval  #CALENDAR_ERROR_NONE            Successful
64  * @retval  #CALENDAR_ERROR_OUT_OF_MEMORY   Out of memory
65  * @retval  #CALENDAR_ERROR_NOT_PERMITTED   Operation not permitted
66  * @retval  #CALENDAR_ERROR_IPC             Unknown IPC error
67  *
68  * @see calendar_reminder_remove_cb()
69  */
70 int calendar_reminder_add_cb(calendar_reminder_cb callback, void *user_data);
71
72 /**
73  * @brief Removes a callback to get a notification when an alarm alerts.
74  *
75  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
76  *
77  * @param[in]   callback       The callback to be removed
78  * @param[in]   user_data      The user data
79  *
80  * @return  @c 0 on success,
81  *          otherwise a negative error value
82  * @retval  #CALENDAR_ERROR_NONE        Successful
83  * @retval  #CALENDAR_ERROR_DB_FAILED   Database operation failure
84  *
85  * @see calendar_reminder_add_cb()
86  */
87 int calendar_reminder_remove_cb(calendar_reminder_cb callback, void *user_data);
88
89 /**
90  * @}
91  */
92
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif /* __TIZEN_SOCIAL_CALENDAR_REMINDER_H__ */
98