Modified doxygen @code for pushmanager.
[platform/framework/native/messaging.git] / inc / FMsgWapPushMessage.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17 /**
18 * @file                 FMsgWapPushMessage.h
19 * @brief                This is the header file for the %WapPushMessage class.
20 *
21 * This header file contains the declarations of the %WapPushMessage class.
22 */
23
24 #ifndef _FMSG_WAP_PUSH_MESSAGE_H_
25 #define _FMSG_WAP_PUSH_MESSAGE_H_
26
27 namespace Tizen { namespace Base
28 {
29 class String;
30 class ByteBuffer;
31 } }
32
33 #include <FBaseObject.h>
34
35 namespace Tizen { namespace Messaging
36 {
37 class _WapPushMessageImpl;
38
39 /**
40 * @class                WapPushMessage
41 * @brief                This class provides methods for handling a WAP Push message.
42 *
43 * @since                2.0
44 *
45 * @final                This class is not intended for extension.
46 *
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.
49 */
50 class _OSP_EXPORT_ WapPushMessage
51         : public Tizen::Base::Object
52 {
53 public:
54         /**
55         * This destructor overrides Tizen::Base::Object::~Object().
56         *
57         * @since                2.0
58         */
59         virtual ~WapPushMessage(void);
60
61 public:
62
63         /**
64         * Gets the header of a message.
65         *
66         * @since                2.0
67         *
68         * @return               The header of a message
69         * @remarks              The header has X-Wap-Application-Id and Content-Type fields.
70         */
71         Tizen::Base::String GetHeader(void) const;
72
73         /**
74         * Gets the body of a message.
75         *
76         * @since                2.0
77         *
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.
82         */
83         Tizen::Base::ByteBuffer* GetBodyN(void) const;
84
85         /**
86         * Compares the calling instance with the specified instance.
87         *
88         * @since                2.0
89         *
90         * @return               @c true if the specified instance of Tizen::Base::Object is equal to the calling %WapPushMessage instance, @n
91         *                               else @c false
92         * @param[in]    obj     An instance of Tizen::Base::Object to compare 
93         * @see                  Tizen::Base::Object::Equals()
94         */
95         virtual bool Equals(const Tizen::Base::Object& obj) const;
96
97         /**
98         * Gets the hash value of the current instance.
99         *
100         * @since                2.0
101         *
102         * @return               The hash value of the current instance
103         */
104         virtual int GetHashCode(void) const;
105
106         /**
107         * Gets the copied instance of the class.
108         *
109         * @since                2.0
110         *
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.
115         *
116         * @remarks              The specific error code can be accessed using the GetLastResult() method.
117         */
118         WapPushMessage* CloneN(void) const;
119
120 private:
121         /**
122         * This default constructor is intentionally declared as private so that only the platform can create an instance.
123         *
124         * @since                2.0
125         */
126         WapPushMessage(void);
127
128         /**
129         * This is the copy constructor for the %WapPushMessage class. @n
130         * Copying of objects using this copy constructor is allowed.
131         *
132         * @since                2.0
133         *
134         * @param[in]    rhs                             An instance of %WapPushMessage
135         */
136         WapPushMessage(const WapPushMessage& rhs);
137
138         /**
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.
142         * 
143         * @return               A reference to this instance
144         *
145         * @param[in]    rhs                             An instance of %WapPushMessage
146         */
147         WapPushMessage& operator =(const WapPushMessage& rhs);
148
149         /**
150         * This constructor is intentionally declared as private so that only the platform can create an instance.
151         *
152         * @param[in]    header  The header of the received WAP Push message
153         * @param[in]    body    The body of the received WAP Push message
154         */
155         WapPushMessage(const Tizen::Base::String& header, const Tizen::Base::ByteBuffer& body);
156
157 private:
158         _WapPushMessageImpl* __pWapPushMessageImpl;
159
160         friend class _WapPushMessageImpl;
161 }; // WapPushMessage
162
163 } } // Tizen::Messaging
164 #endif // _FMSG_WAP_PUSH_MESSAGE_H_