2 // Open Service Platform
\r
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
\r
5 // Licensed under the Apache License, Version 2.0 (the License);
\r
6 // you may not use this file except in compliance with the License.
\r
7 // You may obtain a copy of the License at
\r
9 // http://www.apache.org/licenses/LICENSE-2.0
\r
11 // Unless required by applicable law or agreed to in writing, software
\r
12 // distributed under the License is distributed on an "AS IS" BASIS,
\r
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
14 // See the License for the specific language governing permissions and
\r
15 // limitations under the License.
\r
18 * @file FMsgCbsMessage.cpp
\r
19 * @brief This is the implementation file for the %CbsMessage class.
\r
21 * This file contains the implementation of the %CbsMessage class.
\r
24 #include <FMsgCbsMessage.h>
\r
25 #include <FBaseSysLog.h>
\r
26 #include <FSec_AccessController.h>
\r
27 #include "FMsg_Types.h"
\r
28 #include "FMsg_CbsMessageImpl.h"
\r
30 using namespace Tizen::Base;
\r
31 using namespace Tizen::Messaging;
\r
32 using namespace Tizen::Security;
\r
34 namespace Tizen { namespace Messaging
\r
37 CbsMessage::CbsMessage(void)
\r
39 __pCbsMessageImpl = new (std::nothrow) _CbsMessageImpl();
\r
40 SysTryReturnVoidResult(NID_MSG, __pCbsMessageImpl != null, E_OUT_OF_MEMORY, "memory allocation failed.");
\r
43 CbsMessage::CbsMessage(const CbsMessage& value)
\r
45 __pCbsMessageImpl = new (std::nothrow) _CbsMessageImpl(*(value.__pCbsMessageImpl));
\r
46 SysTryReturnVoidResult(NID_MSG, __pCbsMessageImpl != null, E_OUT_OF_MEMORY, "memory allocation failed.");
\r
49 CbsMessage::~CbsMessage(void)
\r
51 if (__pCbsMessageImpl)
\r
53 delete __pCbsMessageImpl;
\r
55 __pCbsMessageImpl = null;
\r
59 CbsMessage::operator =(const CbsMessage& rhs)
\r
63 *__pCbsMessageImpl = *(rhs.__pCbsMessageImpl);
\r
70 CbsMessage::CloneN() const
\r
72 return __pCbsMessageImpl->CloneN();
\r
76 CbsMessage::Equals(const Tizen::Base::Object& obj) const
\r
78 const CbsMessage* pCbsMessage = dynamic_cast<const CbsMessage*>(&obj);
\r
81 SysLog(NID_MSG, "dynamic_cast is failed");
\r
85 return __pCbsMessageImpl->Equals(*(pCbsMessage->__pCbsMessageImpl));
\r
89 CbsMessage::GetHashCode(void) const
\r
91 return __pCbsMessageImpl->GetHashCode();
\r
94 Tizen::Base::ByteBuffer*
\r
95 CbsMessage::GetSerialNumberN(void) const
\r
97 result r = E_SUCCESS;
\r
98 Tizen::Base::ByteBuffer* pSerialnumber = null;
\r
101 SysAssertf(__pCbsMessageImpl != null, "The CbsChannel instance is not constructed yet.");
\r
103 pSerialnumber = __pCbsMessageImpl->GetSerialNumberN();
\r
105 r = GetLastResult();
\r
108 SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "failed to get cbs message SerialNumber .");
\r
110 return pSerialnumber;
\r
113 SetLastResult(GetLastResult());
\r
117 delete pSerialnumber;
\r
118 pSerialnumber = null;
\r
123 Tizen::Base::DateTime
\r
124 CbsMessage::GetReceivedTime(void) const
\r
126 SysAssertf(__pCbsMessageImpl != null, "The CbsChannel instance is not constructed yet.");
\r
128 return (__pCbsMessageImpl->GetReceivedTime());
\r
131 Tizen::Base::String
\r
132 CbsMessage::GetText(void) const
\r
134 SysAssertf(__pCbsMessageImpl != null, "The CbsChannel instance is not constructed yet.");
\r
136 return (__pCbsMessageImpl->GetText());
\r
140 CbsMessage::GetMessageId(void) const
\r
142 SysAssertf(__pCbsMessageImpl != null, "The CbsChannel instance is not constructed yet.");
\r
144 return (__pCbsMessageImpl->GetMessageId());
\r
148 CbsMessage::IsEtwsNotification(void) const
\r
150 SysAssertf(__pCbsMessageImpl != null, "The CbsChannel instance is not constructed yet.");
\r
152 return (__pCbsMessageImpl->IsEtwsNotification());
\r
156 CbsMessage::GetDataCodingScheme(void) const
\r
158 SysAssertf(__pCbsMessageImpl != null, "The CbsChannel instance is not constructed yet.");
\r
160 return (__pCbsMessageImpl->GetDataCodingScheme());
\r
163 Tizen::Base::String
\r
164 CbsMessage::GetLanguageType(void) const
\r
166 SysAssertf(__pCbsMessageImpl != null, "The CbsChannel instance is not constructed yet.");
\r
168 return (__pCbsMessageImpl->GetLanguageType());
\r
171 } } // Tizen::Messaging
\r