2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file FScl_AddressbookFilterImpl.h
18 * @brief This is the header file for the %_AddressbookFilterImpl class.
20 * This header file contains the declarations of the %_AddressbookFilterImpl class.
22 #ifndef _FSCL_ADDRESSBOOK_FILTER_IMPL_H_
23 #define _FSCL_ADDRESSBOOK_FILTER_IMPL_H_
26 #include <FBaseTypes.h>
27 #include <FSclTypes.h>
28 #include <FBaseObject.h>
30 namespace Tizen { namespace Base
35 namespace Tizen { namespace Social
38 class AddressbookFilter;
48 class _OSP_EXPORT_ _AddressbookFilterImpl
49 : public Tizen::Base::Object
52 _AddressbookFilterImpl(AddressbookFilterType type);
54 virtual ~_AddressbookFilterImpl(void);
56 virtual bool Equals(const Tizen::Base::Object& rhs) const;
58 virtual int GetHashCode(void) const;
60 contacts_filter_h GetFilterHandle(void) const;
62 AddressbookFilterType GetType(void) const;
64 bool IsEmpty(void) const;
66 result AppendInt(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, int value);
68 result AppendBool(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, bool value);
70 result AppendString(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterStringOperator comparisonOperator, const Tizen::Base::String& value);
72 result AppendFilter(FilterConjunctiveOperator conjunctiveOperator, const _AddressbookFilterImpl& filter);
74 static const char* GetUriFromType(AddressbookFilterType type);
76 static __DataType GetPropertyType(AddressbookFilterType type, unsigned long filterProperty);
78 static bool IsValidProperty(AddressbookFilterType type, unsigned long filterProperty);
80 static unsigned int GetViewPropertyId(AddressbookFilterType type, unsigned long filterProperty);
82 static const _AddressbookFilterImpl* GetInstance(const AddressbookFilter& filter);
84 static _AddressbookFilterImpl* GetInstance(AddressbookFilter& filter);
87 struct __FilterPropertyInfoEntry
89 unsigned long propertyId;
90 unsigned long viewPropertyId;
94 struct __FilterInfoEntry
96 unsigned long filterType;
98 unsigned long baseIndex;
99 unsigned long propertyInfoCount;
100 const __FilterPropertyInfoEntry* propertyInfos;
103 static const __FilterPropertyInfoEntry __addressbookFilterPropertyInfos[];
104 static const __FilterPropertyInfoEntry __personFilterPropertyInfos[];
105 static const __FilterPropertyInfoEntry __contactFilterPropertyInfos[];
106 static const __FilterPropertyInfoEntry __categoryFilterPropertyInfos[];
107 static const __FilterPropertyInfoEntry __phoneContactFilterPropertyInfos[];
108 static const __FilterPropertyInfoEntry __emailContactFilterPropertyInfos[];
109 static const __FilterInfoEntry __filterInfos[];
113 static contacts_match_str_flag_e GetMatchStrFlag(FilterStringOperator stringOperstor);
114 static contacts_match_int_flag_e GetMatchIntFlag(FilterComparisonOperator comparisonOperator);
116 contacts_filter_h __filterHandle;
117 AddressbookFilterType __filterType;
119 }; // _AddressbookFilterImpl
123 #endif // _FSCL_ADDRESSBOOK_FILTER_IMPL_H_