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.h
19 * @brief This is the header file for the %PushMessage class.
21 * This header file contains the declarations of the %PushMessage class.
24 #ifndef _FMSG_PUSH_MESSAGE_H_
25 #define _FMSG_PUSH_MESSAGE_H_
28 #include <FShellNotificationRequest.h>
29 #include <FMsgTypes.h>
31 namespace Tizen { namespace Messaging
33 class _PushMessageImpl;
37 * @brief This class provides methods for handling a push message.
41 * The %PushMessage class provides methods for handling a push message. It allows you to get the body text and
42 * the received time of a push message.
44 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/messaging/messaging.htm">Messaging Guide</a>.
46 class _OSP_EXPORT_ PushMessage
47 : public Tizen::Base::Object
51 * This is the default constructor for this class.
58 * This destructor overrides Tizen::Base::Object::~Object().
62 virtual ~PushMessage(void);
66 * Gets the date and time (UTC time) of the message when it is received.
70 * @return The date and time (UTC time) when the message is received
72 Tizen::Base::DateTime GetReceivedTime(void) const;
76 * Gets the body of the message.
78 * @brief <i> [Deprecated] </i>
79 * @deprecated This method is deprecated. Instead of using this method, use Tizen::Shell::NotificationRequest::GetAppMessage() method.
83 * @return The body of the message
86 Tizen::Base::String GetText(void) const;
89 * Sets an action of the push message.
93 * @return An error code
94 * @param[in] action An action of the push message
95 * @exception E_SUCCESS The method is successful.
96 * @exception E_INVALID_ARG The specified input parameter is invalid.
98 result SetAction(PushAction action);
101 * Gets an action of the push message.
105 * @return An action of the push message
107 PushAction GetAction(void) const;
110 * Sets the notification of the push message.
114 * @return An error code
115 * @param[in] notificationRequest The notification request
116 * @exception E_SUCCESS The method is successful.
117 * @exception E_INVALID_ARG The specified input parameter is invalid.
118 * @exception E_OUT_OF_MEMORY The memory is insufficient.
119 * @remarks PushMessage supports to set only alert text of NotificationRequest instance, and others are ignored.
120 * @see Tizen::Shell::NotificationRequest
122 result SetNotification(const Tizen::Shell::NotificationRequest& notificationRequest);
125 * Gets the notification of the push message.
129 * @return The notification request
130 * @remarks PushMessage supports to get only alert text of NotificationRequest instance, and others are ignored.
131 * @see Tizen::Shell::NotificationRequest
133 Tizen::Shell::NotificationRequest GetNotification(void) const;
136 * Copying of objects using this copy constructor is allowed.
140 * @param[in] rhs An instance of %PushMessage
142 PushMessage(const PushMessage& rhs);
145 * Copying of objects using this copy assignment operator is allowed.
149 * @return A reference to this instance
150 * @param[in] rhs An instance of %PushMessage
152 PushMessage& operator =(const PushMessage& rhs);
155 * Compares the specified instance of %PushMessage with the calling instance.
159 * @return @c true if the values match, @n
161 * @param[in] obj The other Tizen::Base::Object to compare
162 * @see Tizen::Base::Object::Equals()
164 virtual bool Equals(const Tizen::Base::Object& obj) const;
167 * Gets the hash value of the current instance.
171 * @return The current instance's hash value
173 virtual int GetHashCode(void) const;
177 * This constructor is intentionally declared as private so that only the platform can create an instance.
179 * @param[in] dateTime The date and time (UTC time) when the message is received
180 * @param[in] text The message body text
182 PushMessage(const Tizen::Base::DateTime& dateTime, const Tizen::Base::String& text);
185 _PushMessageImpl* __pPushMessageImpl;
187 friend class _PushMessageImpl;
190 } } // Tizen::Messaging
191 #endif // _FMSG_PUSH_MESSAGE_H_