Modify the spec file for secure log
[framework/osp/social.git] / src / FSclAddressbookFilter.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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 * @file         FSclAddressbookFilter.cpp
18 * @brief        This is the implementation for AddressbookFilter class.
19 *
20 * This file contains definitions of @e AddressbookFilter class.
21 */
22
23 #include <FSclAddressbookFilter.h>
24 #include <FBaseSysLog.h>
25 #include "FScl_AddressbookFilterImpl.h"
26
27 using namespace Tizen::App;
28 using namespace Tizen::Base;
29
30 namespace Tizen { namespace Social
31 {
32 AddressbookFilter::AddressbookFilter(AddressbookFilterType type)
33 {
34         _AddressbookFilterImpl* pAddressbookFilterImpl = new (std::nothrow) _AddressbookFilterImpl(type);
35         SysTryReturnVoidResult(NID_SCL, pAddressbookFilterImpl, E_OUT_OF_MEMORY, "[%s ] Memory allocation failed.", GetErrorMessage(GetLastResult()));
36
37         __pAddressbookFilterImpl = pAddressbookFilterImpl;
38 }
39
40 AddressbookFilter::~AddressbookFilter(void)
41 {
42         delete __pAddressbookFilterImpl;
43 }
44
45 bool
46 AddressbookFilter::Equals(const Tizen::Base::Object& rhs) const
47 {
48         const AddressbookFilter* pAddressbookFilter = dynamic_cast<const AddressbookFilter*>(&rhs);
49         if (pAddressbookFilter == null)
50         {
51                 return false;
52         }
53
54         return __pAddressbookFilterImpl->Equals(*pAddressbookFilter->__pAddressbookFilterImpl);
55 }
56
57 int
58 AddressbookFilter::GetHashCode(void) const
59 {
60         return __pAddressbookFilterImpl->GetHashCode();
61 }
62
63 result
64 AddressbookFilter::AppendInt(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, int value)
65 {
66         return __pAddressbookFilterImpl->AppendInt(conjunctiveOperator, filterProperty, comparisonOperator, value);
67 }
68
69 result
70 AddressbookFilter::AppendBool(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterComparisonOperator comparisonOperator, bool value)
71 {
72         return __pAddressbookFilterImpl->AppendBool(conjunctiveOperator, filterProperty, comparisonOperator, value);
73 }
74
75 result
76 AddressbookFilter::AppendString(FilterConjunctiveOperator conjunctiveOperator, unsigned long filterProperty, FilterStringOperator comparisonOperator, const Tizen::Base::String& value)
77 {
78         return __pAddressbookFilterImpl->AppendString(conjunctiveOperator, filterProperty, comparisonOperator, value);
79 }
80
81 result
82 AddressbookFilter::AppendFilter(FilterConjunctiveOperator conjunctiveOperator, const AddressbookFilter& filter)
83 {
84         return __pAddressbookFilterImpl->AppendFilter(conjunctiveOperator, *filter.__pAddressbookFilterImpl);;
85 }
86
87 }} // Tizen::Social