2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FScl_AddressbookFilterImpl.h
19 * @brief This is the header file for the %_AddressbookFilterImpl class.
21 * This header file contains the declarations of the %_AddressbookFilterImpl class.
23 #ifndef _FSCL_ADDRESSBOOK_FILTER_IMPL_H_
24 #define _FSCL_ADDRESSBOOK_FILTER_IMPL_H_
27 #include <FBaseTypes.h>
28 #include <FSclTypes.h>
29 #include <FBaseObject.h>
31 namespace Tizen { namespace Base
36 namespace Tizen { namespace Social
39 class AddressbookFilter;
49 class _OSP_EXPORT_ _AddressbookFilterImpl
50 : public Tizen::Base::Object
53 _AddressbookFilterImpl(AddressbookFilterType type);
55 virtual ~_AddressbookFilterImpl(void);
57 virtual bool Equals(const Tizen::Base::Object& rhs) const;
59 virtual int GetHashCode(void) const;
61 contacts_filter_h GetFilterHandle(void) const;
63 AddressbookFilterType GetType(void) const;
65 bool IsEmpty(void) const;
67 result AppendInt(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, int value);
69 result AppendBool(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, bool value);
71 result AppendString(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterStringOperator comparisonOperator, const Tizen::Base::String& value);
73 result AppendFilter(FilterConjunctiveOperator conjunctiveOperator, const _AddressbookFilterImpl& filter);
75 static const char* GetUriFromType(AddressbookFilterType type);
77 static __DataType GetPropertyType(AddressbookFilterType type, unsigned long filterProperty);
79 static bool IsValidProperty(AddressbookFilterType type, unsigned long filterProperty);
81 static unsigned int GetViewPropertyId(AddressbookFilterType type, unsigned long filterProperty);
83 static const _AddressbookFilterImpl* GetInstance(const AddressbookFilter& filter);
85 static _AddressbookFilterImpl* GetInstance(AddressbookFilter& filter);
88 struct __FilterPropertyInfoEntry
90 unsigned long propertyId;
91 unsigned long viewPropertyId;
95 struct __FilterInfoEntry
97 unsigned long filterType;
99 unsigned long baseIndex;
100 unsigned long propertyInfoCount;
101 const __FilterPropertyInfoEntry* propertyInfos;
104 static const __FilterPropertyInfoEntry __addressbookFilterPropertyInfos[];
105 static const __FilterPropertyInfoEntry __personFilterPropertyInfos[];
106 static const __FilterPropertyInfoEntry __contactFilterPropertyInfos[];
107 static const __FilterPropertyInfoEntry __categoryFilterPropertyInfos[];
108 static const __FilterPropertyInfoEntry __phoneContactFilterPropertyInfos[];
109 static const __FilterPropertyInfoEntry __emailContactFilterPropertyInfos[];
110 static const __FilterInfoEntry __filterInfos[];
114 static contacts_match_str_flag_e GetMatchStrFlag(FilterStringOperator stringOperstor);
115 static contacts_match_int_flag_e GetMatchIntFlag(FilterComparisonOperator comparisonOperator);
117 contacts_filter_h __filterHandle;
118 AddressbookFilterType __filterType;
120 }; // _AddressbookFilterImpl
124 #endif // _FSCL_ADDRESSBOOK_FILTER_IMPL_H_