4 * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef __TIZEN_SOCIAL_CALENDAR_FILTER_H__
21 #define __TIZEN_SOCIAL_CALENDAR_FILTER_H__
23 #include <calendar_types.h>
30 * @file calendar_filter.h
34 * @addtogroup CAPI_SOCIAL_CALENDAR_SVC_FILTER_MODULE
39 * @brief Creates a filter handle.
41 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
43 * @remarks You must release @a filter using calendar_filter_destroy().
45 * @param[in] view_uri The view URI of a filter
46 * @param[out] filter The filter handle
48 * @return @c 0 on success,
49 * otherwise a negative error value
50 * @retval #CALENDAR_ERROR_NONE Successful
51 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
52 * @retval #CALENDAR_ERROR_OUT_OF_MEMORY Out of memory
54 * @pre calendar_connect() should be called to initialize.
56 * @see calendar_filter_destroy()
58 int calendar_filter_create(const char* view_uri, calendar_filter_h* filter);
61 * @brief Destroys a filter handle.
63 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
65 * @param[in] filter The filter handle
67 * @return @c 0 on success,
68 * otherwise a negative error value
69 * @retval #CALENDAR_ERROR_NONE Successful
70 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
72 * @see calendar_filter_create()
74 int calendar_filter_destroy(calendar_filter_h filter);
77 * @brief Adds a condition for the string type property.
79 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
81 * @param[in] filter The filter handle
82 * @param[in] property_id The property ID to add a condition
83 * @param[in] match The match flag
84 * @param[in] match_value The match value
86 * @return @c 0 on success,
87 * otherwise a negative error value
88 * @retval #CALENDAR_ERROR_NONE Successful
89 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
91 * @see calendar_filter_add_operator()
93 int calendar_filter_add_str(calendar_filter_h filter, unsigned int property_id, calendar_match_str_flag_e match, const char* match_value);
96 * @brief Adds a condition for the integer type property.
98 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
100 * @param[in] filter The filter handle
101 * @param[in] property_id The property ID to add a condition
102 * @param[in] match The match flag
103 * @param[in] match_value The match value
105 * @return @c 0 on success,
106 * otherwise a negative error value
107 * @retval #CALENDAR_ERROR_NONE Successful
108 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
110 * @see calendar_filter_add_operator()
112 int calendar_filter_add_int(calendar_filter_h filter, unsigned int property_id, calendar_match_int_flag_e match, int match_value);
115 * @brief Adds a condition for the double type property.
117 * @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
124 * @return @c 0 on success,
125 * otherwise a negative error value
126 * @retval #CALENDAR_ERROR_NONE Successful
127 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
129 * @see calendar_filter_add_operator()
131 int calendar_filter_add_double(calendar_filter_h filter, unsigned int property_id, calendar_match_int_flag_e match, double match_value);
134 * @brief Adds a condition for the long long int type property.
136 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
138 * @param[in] filter The filter handle
139 * @param[in] property_id The property ID to add a condition
140 * @param[in] match The match flag
141 * @param[in] match_value The match value
143 * @return @c 0 on success,
144 * otherwise a negative error value
145 * @retval #CALENDAR_ERROR_NONE Successful
146 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
148 * @see calendar_filter_add_operator()
150 int calendar_filter_add_lli(calendar_filter_h filter, unsigned int property_id, calendar_match_int_flag_e match, long long int match_value);
153 * @brief Adds a condition for the calendar_time_s type property.
155 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
157 * @param[in] filter The filter handle
158 * @param[in] property_id The property ID to add a condition
159 * @param[in] match The match flag
160 * @param[in] match_value The match value
162 * @return @c 0 on success,
163 * otherwise a negative error value
164 * @retval #CALENDAR_ERROR_NONE Successful
165 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
167 * @see calendar_filter_add_operator()
169 int calendar_filter_add_caltime(calendar_filter_h filter, unsigned int property_id, calendar_match_int_flag_e match, calendar_time_s match_value);
172 * @brief Adds a child filter to a parent filter.
174 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
176 * @param[in] parent_filter The parent filter handle
177 * @param[in] child_filter The child filter handle
179 * @return @c 0 on success,
180 * otherwise a negative error value
181 * @retval #CALENDAR_ERROR_NONE Successful
182 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
184 * @see calendar_filter_add_operator()
186 int calendar_filter_add_filter(calendar_filter_h parent_filter, calendar_filter_h child_filter);
189 * @brief Adds an operator between conditions.
191 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
193 * @param[in] filter The filter handle
194 * @param[in] operator_type The operator type
196 * @return @c 0 on success,
197 * otherwise a negative error value
198 * @retval #CALENDAR_ERROR_NONE Successful
199 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
201 * @see calendar_filter_add_str()
202 * @see calendar_filter_add_int()
203 * @see calendar_filter_add_double()
204 * @see calendar_filter_add_caltime()
205 * @see calendar_filter_add_filter()
207 int calendar_filter_add_operator(calendar_filter_h filter, calendar_filter_operator_e operator_type);
217 #endif /* __TIZEN_SOCIAL_CALENDAR_FILTER_H__ */