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 FSclAddressbookFilter.cpp
18 * @brief This is the implementation for AddressbookFilter class.
20 * This file contains definitions of @e AddressbookFilter class.
23 #include <FSclAddressbookFilter.h>
24 #include <FBaseSysLog.h>
25 #include "FScl_AddressbookFilterImpl.h"
27 using namespace Tizen::App;
28 using namespace Tizen::Base;
30 namespace Tizen { namespace Social
32 AddressbookFilter::AddressbookFilter(AddressbookFilterType type)
34 _AddressbookFilterImpl* pAddressbookFilterImpl = new (std::nothrow) _AddressbookFilterImpl(type);
35 SysTryReturnVoidResult(NID_SCL, pAddressbookFilterImpl, E_OUT_OF_MEMORY, "[%s ] Memory allocation failed.", GetErrorMessage(GetLastResult()));
37 __pAddressbookFilterImpl = pAddressbookFilterImpl;
40 AddressbookFilter::~AddressbookFilter(void)
42 delete __pAddressbookFilterImpl;
46 AddressbookFilter::Equals(const Tizen::Base::Object& rhs) const
48 const AddressbookFilter* pAddressbookFilter = dynamic_cast<const AddressbookFilter*>(&rhs);
49 if (pAddressbookFilter == null)
54 return __pAddressbookFilterImpl->Equals(*pAddressbookFilter->__pAddressbookFilterImpl);
58 AddressbookFilter::GetHashCode(void) const
60 return __pAddressbookFilterImpl->GetHashCode();
64 AddressbookFilter::AppendInt(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, int value)
66 return __pAddressbookFilterImpl->AppendInt(conjunctiveOperator, filterProperty, comparisonOperator, value);
70 AddressbookFilter::AppendBool(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, bool value)
72 return __pAddressbookFilterImpl->AppendBool(conjunctiveOperator, filterProperty, comparisonOperator, value);
76 AddressbookFilter::AppendString(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterStringOperator comparisonOperator, const Tizen::Base::String& value)
78 return __pAddressbookFilterImpl->AppendString(conjunctiveOperator, filterProperty, comparisonOperator, value);
82 AddressbookFilter::AppendFilter(FilterConjunctiveOperator conjunctiveOperator, const AddressbookFilter& filter)
84 return __pAddressbookFilterImpl->AppendFilter(conjunctiveOperator, *filter.__pAddressbookFilterImpl);;