2 // Open Service Platform
3 // Copyright (c) 2012-2013 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 FTelCallInfo.cpp
19 * @brief This is the implementation file for CallInfo class.
23 #include <FTelCallInfo.h>
24 #include <FBaseSysLog.h>
25 #include "FTel_CallInfoImpl.h"
28 using namespace Tizen::Base;
30 namespace Tizen { namespace Telephony
32 CallInfo::CallInfo(void)
33 : __pCallInfoImpl(null)
35 __pCallInfoImpl = new (std::nothrow) _CallInfoImpl();
36 SysTryReturnVoidResult(NID_TEL, __pCallInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
39 CallInfo::CallInfo(const CallInfo& callInfo)
40 : __pCallInfoImpl(null)
42 __pCallInfoImpl = new (std::nothrow) _CallInfoImpl(*callInfo.__pCallInfoImpl);
43 SysTryReturnVoidResult(NID_TEL, __pCallInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
46 CallInfo::~CallInfo(void)
48 delete __pCallInfoImpl;
52 CallInfo::operator=(const CallInfo& rhs)
56 *__pCallInfoImpl = *(rhs.__pCallInfoImpl);
63 CallInfo::GetCallType(void) const
65 return __pCallInfoImpl->GetCallType();
69 CallInfo::GetNumber(void) const
71 return __pCallInfoImpl->GetNumber();
75 CallInfo::Equals(const Object& obj) const
77 const CallInfo* pOther = dynamic_cast<const CallInfo*>(&obj);
89 return __pCallInfoImpl->Equals(*pOther->__pCallInfoImpl);
93 CallInfo::GetHashCode(void) const
95 return __pCallInfoImpl->GetHashCode();
98 CallInfo::CallInfo(CallType type, const String& number)
100 SysLog(NID_TEL,"The CallType is %d and the number is %ls", type, number.GetPointer());
102 __pCallInfoImpl = new (std::nothrow) _CallInfoImpl(type, number);
103 SysTryReturnVoidResult(NID_TEL, __pCallInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
106 }} // Tizen::Telephony