2be178c7cdeef7109feca38205681e505be46bcf
[profile/ivi/wrt-plugins-tizen.git] / src / platform / Tizen / Calendar / CalendarFilterValidator.cpp
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 #include "CalendarFilterValidator.h"
19 #include "CalendarFilter.h"
20
21 namespace TizenApis {
22 namespace Platform {
23 namespace Calendar {
24
25 using namespace TizenApis::Api::Tizen;
26
27 static PropertyStructArray properties =
28 {
29     {CALENDAR_FILTER_ATTRIBUTE_ID_UID,              PrimitiveType_String},
30     {CALENDAR_FILTER_ATTRIBUTE_LAST_MODIFIED_DATE,  PrimitiveType_Time},
31     {CALENDAR_FILTER_ATTRIBUTE_DESCRIPTION,         PrimitiveType_String},
32     {CALENDAR_FILTER_ATTRIBUTE_SUMMARY,             PrimitiveType_String},
33     {CALENDAR_FILTER_ATTRIBUTE_START_DATE,          PrimitiveType_Time},
34     {CALENDAR_FILTER_ATTRIBUTE_LOCATION,            PrimitiveType_String},
35     {CALENDAR_FILTER_ATTRIBUTE_LATITUDE,            PrimitiveType_Double},
36     {CALENDAR_FILTER_ATTRIBUTE_LONGITUDE,           PrimitiveType_Double},
37     {CALENDAR_FILTER_ATTRIBUTE_ORGANIZER,           PrimitiveType_String},
38     {CALENDAR_FILTER_ATTRIBUTE_VISIBILITY,          PrimitiveType_String},
39     {CALENDAR_FILTER_ATTRIBUTE_STATUS,              PrimitiveType_String},
40     {CALENDAR_FILTER_ATTRIBUTE_CATEGORIES,          PrimitiveType_String},
41     {CALENDAR_FILTER_ATTRIBUTE_PRIORITY,            PrimitiveType_String},
42     {CALENDAR_FILTER_ATTRIBUTE_DUE_DATE,            PrimitiveType_Time},
43     {CALENDAR_FILTER_ATTRIBUTE_IS_ALL_DAY,          PrimitiveType_Boolean},
44     {CALENDAR_FILTER_ATTRIBUTE_END_DATE,            PrimitiveType_Time},
45     {CALENDAR_FILTER_ATTRIBUTE_AVAILABILITY,        PrimitiveType_String},
46     {0, PrimitiveType_Notype}
47 };
48
49 static MatchFlagStrArray matchFlag
50 {
51         "EXACTLY",
52         "CONTAINS",
53         "STARTSWITH",
54         "ENDSWITH",
55         "EXISTS",
56         0
57 };
58
59 FilterValidatorPtr CalendarFilterValidatorFactory::getCalendarFilterValidator()
60 {
61     static FilterValidatorPtr theInstance =
62                 FilterValidatorPtr(new FilterValidator(properties, matchFlag));
63     return theInstance;
64 }
65
66 } // Calendar
67 } // Platform
68 } // TizenApis