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 FMsgPushMessage.cpp
19 * @brief This is the implementation file for the %PushMessage class.
21 * This file contains the implementation of the %PushMessage class.
24 #include <FMsgPushMessage.h>
25 #include <FBaseSysLog.h>
26 #include "FMsg_PushMessageImpl.h"
28 using namespace Tizen::Base;
29 using namespace Tizen::Shell;
31 namespace Tizen { namespace Messaging
34 PushMessage::PushMessage(void)
36 __pPushMessageImpl = new (std::nothrow) _PushMessageImpl();
37 SysTryReturnVoidResult(NID_MSG, __pPushMessageImpl, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
40 PushMessage::PushMessage(const DateTime& dateTime, const String& text)
42 __pPushMessageImpl = new (std::nothrow) _PushMessageImpl(dateTime, text);
43 SysTryReturnVoidResult(NID_MSG, __pPushMessageImpl, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
46 PushMessage::~PushMessage(void)
48 delete __pPushMessageImpl;
49 __pPushMessageImpl = null;
52 PushMessage::PushMessage(const PushMessage& rhs)
54 __pPushMessageImpl = new (std::nothrow) _PushMessageImpl(*(rhs.__pPushMessageImpl));
55 SysTryReturnVoidResult(NID_MSG, __pPushMessageImpl, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
59 PushMessage::operator =(const PushMessage& rhs)
66 *__pPushMessageImpl = *rhs.__pPushMessageImpl;
72 PushMessage::Equals(const Object& obj) const
74 const PushMessage* pRhs = dynamic_cast<const PushMessage*>(&obj);
80 const _PushMessageImpl* pRhsImpl = _PushMessageImpl::GetInstance(*pRhs);
86 return __pPushMessageImpl->Equals(*pRhsImpl);
90 PushMessage::GetHashCode(void) const
92 return __pPushMessageImpl->GetHashCode();
96 PushMessage::GetReceivedTime(void) const
98 return __pPushMessageImpl->GetReceivedTime();
102 PushMessage::GetText(void) const
104 return __pPushMessageImpl->GetText();
108 PushMessage::SetAction(PushAction action)
110 return __pPushMessageImpl->SetAction(action);
114 PushMessage::GetAction(void) const
116 return __pPushMessageImpl->GetAction();
120 PushMessage::SetNotification(const NotificationRequest& notificationRequest)
122 return __pPushMessageImpl->SetNotification(notificationRequest);
126 PushMessage::GetNotification(void) const
128 return __pPushMessageImpl->GetNotification();
131 } } // Tizen::Messaging