Add '-D_SECURE_LOG'
[platform/framework/native/telephony.git] / src / FTel_CallInfoImpl.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17 /**
18  * @file        FTel_CallInfoImpl.cpp
19  * @brief       This is the implementation file for _CallInfoImpl class.
20  */
21
22 #include <FBaseString.h>
23 #include <FTelTypes.h>
24 #include <FTelCallInfo.h>
25 #include "FTel_CallInfoImpl.h"
26
27 using namespace Tizen::Base;
28
29 namespace Tizen { namespace Telephony
30 {
31
32
33 _CallInfoImpl::_CallInfoImpl(void)
34         : __callType(TYPE_UNDEFINED_CALL)
35 {
36 }
37
38 _CallInfoImpl::_CallInfoImpl(const _CallInfoImpl& callInfo)
39         : __callType(callInfo.__callType)
40         , __number(callInfo.__number)
41 {
42 }
43
44 _CallInfoImpl::_CallInfoImpl(CallType type, const String& number)
45         : __callType(type)
46         , __number(number)
47 {
48 }
49
50 _CallInfoImpl::~_CallInfoImpl(void)
51 {
52 }
53
54 _CallInfoImpl&
55 _CallInfoImpl::operator =(const _CallInfoImpl& rhs)
56 {
57         if (this != &rhs)
58         {
59                 __callType = rhs.__callType;
60                 __number = rhs.__number;
61         }
62
63         return *this;
64 }
65
66 CallType
67 _CallInfoImpl::GetCallType(void) const
68 {
69         return __callType;
70 }
71
72 String
73 _CallInfoImpl::GetNumber(void) const
74 {
75         return __number;
76 }
77
78 void
79 _CallInfoImpl::SetCallType(CallType callType)
80 {
81         __callType = callType;
82 }
83
84 void
85 _CallInfoImpl::SetNumber(const String& number)
86 {
87         __number = number;
88 }
89
90 bool
91 _CallInfoImpl::Equals(const Object& obj) const
92 {
93         const _CallInfoImpl* pOther = dynamic_cast<const _CallInfoImpl*>(&obj);
94
95         if (pOther == null
96                 ||__callType != pOther->__callType
97                 ||!__number.Equals(pOther->__number))
98         {
99                 return false;
100         }
101
102         return true;
103 }
104
105 int
106 _CallInfoImpl::GetHashCode(void) const
107 {
108         return __callType ^ __number.GetHashCode();
109 }
110
111 _CallInfoImpl*
112 _CallInfoImpl::GetInstance(CallInfo& callInfo)
113 {
114         return callInfo.__pCallInfoImpl;
115 }
116
117 const _CallInfoImpl*
118 _CallInfoImpl::GetInstance(const CallInfo& callInfo)
119 {
120         return callInfo.__pCallInfoImpl;
121 }
122
123 }} // Tizen::Telephony