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 FMsgWapPushMessage.h
19 * @brief This is the header file for the %WapPushMessage class.
21 * This header file contains the declarations of the %WapPushMessage class.
24 #ifndef _FMSG_WAP_PUSH_MESSAGE_H_
25 #define _FMSG_WAP_PUSH_MESSAGE_H_
27 namespace Tizen { namespace Base
33 #include <FBaseObject.h>
35 namespace Tizen { namespace Messaging
37 class _WapPushMessageImpl;
40 * @class WapPushMessage
41 * @brief This class provides methods for handling a WAP Push message.
45 * @final This class is not intended for extension.
47 * The %WapPushMessage class provides methods for handling a WAP Push message. @n
48 * The methods of this class fetches the header and the body of a WAP Push message.
50 class _OSP_EXPORT_ WapPushMessage
51 : public Tizen::Base::Object
55 * This destructor overrides Tizen::Base::Object::~Object().
59 virtual ~WapPushMessage(void);
64 * Gets the header of a message.
68 * @return The header of a message
69 * @remarks The header has X-Wap-Application-Id and Content-Type fields.
71 Tizen::Base::String GetHeader(void) const;
74 * Gets the body of a message.
78 * @return The body of a message
79 * @remarks The message body can be any MIME content-type. @n
80 * In case of error, this method returns null. @n
81 * The specific error code can be accessed using the GetLastResult() method.
83 Tizen::Base::ByteBuffer* GetBodyN(void) const;
86 * Compares the calling instance with the specified instance.
90 * @return @c true if the specified instance of Tizen::Base::Object is equal to the calling %WapPushMessage instance, @n
92 * @param[in] obj An instance of Tizen::Base::Object to compare
93 * @see Tizen::Base::Object::Equals()
95 virtual bool Equals(const Tizen::Base::Object& obj) const;
98 * Gets the hash value of the current instance.
102 * @return The hash value of the current instance
104 virtual int GetHashCode(void) const;
107 * Gets the copied instance of the class.
111 * @return An instance of %WapPushMessage, @n
112 * else @c null in case of an error
113 * @exception E_SUCCESS The method is successful.
114 * @exception E_OUT_OF_MEMORY The memory is insufficient.
116 * @remarks The specific error code can be accessed using the GetLastResult() method.
118 WapPushMessage* CloneN(void) const;
122 * This default constructor is intentionally declared as private so that only the platform can create an instance.
126 WapPushMessage(void);
129 * This is the copy constructor for the %WapPushMessage class. @n
130 * Copying of objects using this copy constructor is allowed.
134 * @param[in] rhs An instance of %WapPushMessage
136 WapPushMessage(const WapPushMessage& rhs);
139 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. @n
140 * - Use CloneN() to get an exact copy of the instance.
141 * - Use Equals() to compare the contents of one instance with the other.
143 * @return A reference to this instance
145 * @param[in] rhs An instance of %WapPushMessage
147 WapPushMessage& operator =(const WapPushMessage& rhs);
150 * This constructor is intentionally declared as private so that only the platform can create an instance.
152 * @param[in] header The header of the received WAP Push message
153 * @param[in] body The body of the received WAP Push message
155 WapPushMessage(const Tizen::Base::String& header, const Tizen::Base::ByteBuffer& body);
158 _WapPushMessageImpl* __pWapPushMessageImpl;
160 friend class _WapPushMessageImpl;
163 } } // Tizen::Messaging
164 #endif // _FMSG_WAP_PUSH_MESSAGE_H_