3.0 Native API reference english examination
[platform/core/pim/calendar-service.git] / include / calendar_filter.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_FILTER_H__
21 #define __TIZEN_SOCIAL_CALENDAR_FILTER_H__
22
23 #include <calendar_types.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /**
30  * @file calendar_filter.h
31  */
32
33 /**
34  * @addtogroup CAPI_SOCIAL_CALENDAR_SVC_FILTER_MODULE
35  * @{
36  */
37
38 /**
39  * @brief Creates a filter handle.
40  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
41  * @remarks You must release @a filter using calendar_filter_destroy().
42  * @param[in] view_uri The view URI of a filter
43  * @param[out] filter The filter handle
44  * @return @c 0 on success,
45  *         otherwise a negative error value
46  * @retval #CALENDAR_ERROR_NONE Successful
47  * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
48  * @retval #CALENDAR_ERROR_OUT_OF_MEMORY Out of memory
49  * @pre calendar_connect() should be called to initialize.
50  * @see calendar_filter_destroy()
51  */
52 int calendar_filter_create(const char* view_uri, calendar_filter_h* filter);
53
54
55 /**
56  * @brief Destroys a filter handle.
57  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
58  * @param[in] filter The filter handle
59  * @return @c 0 on success,
60  *         otherwise a negative error value
61  * @retval #CALENDAR_ERROR_NONE Successful
62  * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
63  * @see calendar_filter_create()
64  */
65 int     calendar_filter_destroy(calendar_filter_h filter);
66
67
68 /**
69  * @brief Adds a condition for the string type property.
70  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
71  * @param[in] filter The filter handle
72  * @param[in] property_id The property ID to add a condition
73  * @param[in] match The match flag
74  * @param[in] match_value The match value
75  * @return @c 0 on success,
76  *         otherwise a negative error value
77  * @retval #CALENDAR_ERROR_NONE Successful
78  * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
79  * @see calendar_filter_add_operator()
80  */
81 int     calendar_filter_add_str(calendar_filter_h filter, unsigned int property_id, calendar_match_str_flag_e match, const char* match_value);
82
83
84 /**
85  * @brief Adds a condition for the integer type property.
86  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
87  * @param[in] filter The filter handle
88  * @param[in] property_id The property ID to add a condition
89  * @param[in] match The match flag
90  * @param[in] match_value The match value
91  * @return @c 0 on success,
92  *         otherwise a negative error value
93  * @retval #CALENDAR_ERROR_NONE Successful
94  * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
95  * @see calendar_filter_add_operator()
96  */
97 int     calendar_filter_add_int(calendar_filter_h filter, unsigned int property_id, calendar_match_int_flag_e match, int match_value);
98
99
100 /**
101  * @brief Adds a condition for the double type property.
102  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
103  * @param[in] filter The filter handle
104  * @param[in] property_id The property ID to add a condition
105  * @param[in] match The match flag
106  * @param[in] match_value The match value
107  * @return @c 0 on success,
108  *         otherwise a negative error value
109  * @retval #CALENDAR_ERROR_NONE Successful
110  * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
111  * @see calendar_filter_add_operator()
112  */
113 int     calendar_filter_add_double(calendar_filter_h filter, unsigned int property_id, calendar_match_int_flag_e match, double match_value);
114
115
116 /**
117  * @brief Adds a condition for the long long int type property.
118  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
119  * @param[in] filter The filter handle
120  * @param[in] property_id The property ID to add a condition
121  * @param[in] match The match flag
122  * @param[in] match_value The match value
123  * @return @c 0 on success,
124  *         otherwise a negative error value
125  * @retval #CALENDAR_ERROR_NONE Successful
126  * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
127  * @see calendar_filter_add_operator()
128  */
129 int     calendar_filter_add_lli(calendar_filter_h filter, unsigned int property_id, calendar_match_int_flag_e match, long long int match_value);
130
131
132 /**
133  * @brief Adds a condition for the calendar_time_s type property.
134  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
135  * @param[in] filter The filter handle
136  * @param[in] property_id The property ID to add a condition
137  * @param[in] match The match flag
138  * @param[in] match_value The match value
139  * @return @c 0 on success,
140  *         otherwise a negative error value
141  * @retval #CALENDAR_ERROR_NONE Successful
142  * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
143  * @see calendar_filter_add_operator()
144  */
145 int     calendar_filter_add_caltime(calendar_filter_h filter, unsigned int property_id, calendar_match_int_flag_e match, calendar_time_s match_value);
146
147
148 /**
149  * @brief Adds a child filter to a parent filter.
150  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
151  * @param[in] parent_filter The parent filter handle
152  * @param[in] child_filter The child filter handle
153  * @return @c 0 on success,
154  *         otherwise a negative error value
155  * @retval #CALENDAR_ERROR_NONE Successful
156  * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
157  * @see calendar_filter_add_operator()
158  */
159 int calendar_filter_add_filter(calendar_filter_h parent_filter, calendar_filter_h child_filter);
160
161
162 /**
163  * @brief Adds an operator between conditions.
164  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
165  * @param[in] filter The filter handle
166  * @param[in] operator_type The operator type
167  * @return @c 0 on success,
168  *         otherwise a negative error value
169  * @retval #CALENDAR_ERROR_NONE Successful
170  * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
171  * @see calendar_filter_add_str()
172  * @see calendar_filter_add_int()
173  * @see calendar_filter_add_double()
174  * @see calendar_filter_add_caltime()
175  * @see calendar_filter_add_filter()
176  */
177 int calendar_filter_add_operator(calendar_filter_h filter, calendar_filter_operator_e operator_type);
178
179
180 /**
181  * @}
182  */
183
184 #ifdef __cplusplus
185 }
186 #endif
187
188 #endif /* __TIZEN_SOCIAL_CALENDAR_FILTER_H__ */
189