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 FSclAddressbookFilter.cpp
19 * @brief This is the implementation for AddressbookFilter class.
21 * This file contains definitions of @e AddressbookFilter class.
24 #include <FSclAddressbookFilter.h>
25 #include <FBaseSysLog.h>
26 #include "FScl_AddressbookFilterImpl.h"
28 using namespace Tizen::App;
29 using namespace Tizen::Base;
31 namespace Tizen { namespace Social
33 AddressbookFilter::AddressbookFilter(AddressbookFilterType type)
35 _AddressbookFilterImpl* pAddressbookFilterImpl = new (std::nothrow) _AddressbookFilterImpl(type);
36 SysTryReturnVoidResult(NID_SCL, pAddressbookFilterImpl, E_OUT_OF_MEMORY, "[%s ] Memory allocation failed.", GetErrorMessage(GetLastResult()));
38 __pAddressbookFilterImpl = pAddressbookFilterImpl;
41 AddressbookFilter::~AddressbookFilter(void)
43 delete __pAddressbookFilterImpl;
47 AddressbookFilter::Equals(const Tizen::Base::Object& rhs) const
49 const AddressbookFilter* pAddressbookFilter = dynamic_cast<const AddressbookFilter*>(&rhs);
50 if (pAddressbookFilter == null)
55 return __pAddressbookFilterImpl->Equals(*pAddressbookFilter->__pAddressbookFilterImpl);
59 AddressbookFilter::GetHashCode(void) const
61 return __pAddressbookFilterImpl->GetHashCode();
65 AddressbookFilter::AppendInt(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, int value)
67 return __pAddressbookFilterImpl->AppendInt(conjunctiveOperator, filterProperty, comparisonOperator, value);
71 AddressbookFilter::AppendBool(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, bool value)
73 return __pAddressbookFilterImpl->AppendBool(conjunctiveOperator, filterProperty, comparisonOperator, value);
77 AddressbookFilter::AppendString(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterStringOperator comparisonOperator, const Tizen::Base::String& value)
79 return __pAddressbookFilterImpl->AppendString(conjunctiveOperator, filterProperty, comparisonOperator, value);
83 AddressbookFilter::AppendFilter(FilterConjunctiveOperator conjunctiveOperator, const AddressbookFilter& filter)
85 return __pAddressbookFilterImpl->AppendFilter(conjunctiveOperator, *filter.__pAddressbookFilterImpl);;