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.
22 #include <FTelCallInfo.h>
23 #include <FBaseSysLog.h>
24 #include "FTel_CallInfoImpl.h"
27 using namespace Tizen::Base;
29 namespace Tizen { namespace Telephony
31 CallInfo::CallInfo(void)
32 : __pCallInfoImpl(null)
34 __pCallInfoImpl = new (std::nothrow) _CallInfoImpl();
35 SysTryReturnVoidResult(NID_TEL, __pCallInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
38 CallInfo::CallInfo(const CallInfo& callInfo)
39 : __pCallInfoImpl(null)
41 __pCallInfoImpl = new (std::nothrow) _CallInfoImpl(*callInfo.__pCallInfoImpl);
42 SysTryReturnVoidResult(NID_TEL, __pCallInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
45 CallInfo::~CallInfo(void)
47 delete __pCallInfoImpl;
51 CallInfo::operator=(const CallInfo& rhs)
55 *__pCallInfoImpl = *(rhs.__pCallInfoImpl);
62 CallInfo::GetCallType(void) const
64 return __pCallInfoImpl->GetCallType();
68 CallInfo::GetNumber(void) const
70 return __pCallInfoImpl->GetNumber();
74 CallInfo::Equals(const Object& obj) const
76 const CallInfo* pOther = dynamic_cast<const CallInfo*>(&obj);
88 return __pCallInfoImpl->Equals(*pOther->__pCallInfoImpl);
92 CallInfo::GetHashCode(void) const
94 return __pCallInfoImpl->GetHashCode();
97 CallInfo::CallInfo(CallType type, const String& number)
99 SysLog(NID_TEL,"The CallType is %d and the number is %ls", type, number.GetPointer());
101 __pCallInfoImpl = new (std::nothrow) _CallInfoImpl(type, number);
102 SysTryReturnVoidResult(NID_TEL, __pCallInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
105 }} // Tizen::Telephony