Modified doxygen @code for pushmanager.
[platform/framework/native/messaging.git] / inc / FMsgPushMessage.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                FMsgPushMessage.h
19  * @brief               This is the header file for the %PushMessage class.
20  *
21  * This header file contains the declarations of the %PushMessage class.
22  */
23
24 #ifndef _FMSG_PUSH_MESSAGE_H_
25 #define _FMSG_PUSH_MESSAGE_H_
26
27 #include <FBase.h>
28 #include <FShellNotificationRequest.h>
29 #include <FMsgTypes.h>
30
31 namespace Tizen { namespace Messaging
32 {
33 class _PushMessageImpl;
34
35 /**
36 * @class        PushMessage
37 * @brief        This class provides methods for handling a push message.
38 *
39 * @since        2.0
40 *
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.
43 *
44 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/messaging/messaging.htm">Messaging Guide</a>.
45 */
46 class _OSP_EXPORT_ PushMessage
47         : public Tizen::Base::Object
48 {
49 public:
50         /**
51         * This is the default constructor for this class.
52         *
53         * @since                2.0
54         */
55         PushMessage(void);
56
57         /**
58          * This destructor overrides Tizen::Base::Object::~Object().
59          *
60          * @since               2.0
61          */
62         virtual ~PushMessage(void);
63
64 public:
65         /**
66         * Gets the date and time (UTC time) of the message when it is received.
67         *
68         * @since                2.0
69         *
70         * @return               The date and time (UTC time) when the message is received
71         */
72         Tizen::Base::DateTime GetReceivedTime(void) const;
73
74         /**
75         * @if OSPDEPREC
76         * Gets the body of the message.
77         * 
78         * @brief <i> [Deprecated]  </i>
79         * @deprecated   This method is deprecated. Instead of using this method, use Tizen::Shell::NotificationRequest::GetAppMessage() method.
80         *
81         * @since                2.0
82         *
83         * @return               The body of the message
84         * @endif
85         */
86         Tizen::Base::String GetText(void) const;
87
88         /**
89         * Sets an action of the push message.
90         *
91         * @since                2.0
92         *
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.
97         */
98         result SetAction(PushAction action);
99
100         /**
101         * Gets an action of the push message.
102         *
103         * @since                2.0
104         *
105         * @return       An action of the push message
106         */
107         PushAction GetAction(void) const;
108
109         /**
110         * Sets the notification of the push message.
111         *
112         * @since                2.0
113         *
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
121         */
122         result SetNotification(const Tizen::Shell::NotificationRequest& notificationRequest);
123
124         /**
125         * Gets the notification of the push message.
126         *
127         * @since                2.0
128         *
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
132         */
133         Tizen::Shell::NotificationRequest GetNotification(void) const;
134
135         /**
136         * Copying of objects using this copy constructor is allowed.
137         *
138         * @since                2.0
139         *
140         * @param[in]    rhs                             An instance of %PushMessage
141         */
142         PushMessage(const PushMessage& rhs);
143
144         /**
145         * Copying of objects using this copy assignment operator is allowed.
146         *
147         * @since                2.0
148         *
149         * @return               A reference to this instance
150         * @param[in]    rhs                             An instance of %PushMessage
151         */
152         PushMessage& operator =(const PushMessage& rhs);
153
154         /**
155         * Compares the specified instance of %PushMessage with the calling instance.
156         *
157         * @since                2.0
158         *
159         * @return               @c true if the values match, @n
160         *                               else @c false
161         * @param[in]    obj     The other Tizen::Base::Object to compare
162         * @see                  Tizen::Base::Object::Equals()
163         */
164         virtual bool Equals(const Tizen::Base::Object& obj) const;
165
166         /**
167         * Gets the hash value of the current instance.
168         *
169         * @since                2.0
170         *
171         * @return               The current instance's hash value
172         */
173         virtual int GetHashCode(void) const;
174
175 private:
176         /**
177          * This constructor is intentionally declared as private so that only the platform can create an instance.
178          *
179          * @param[in]   dateTime        The date and time (UTC time) when the message is received
180          * @param[in]   text            The message body text
181          */
182         PushMessage(const Tizen::Base::DateTime& dateTime, const Tizen::Base::String& text);
183
184 private:
185         _PushMessageImpl* __pPushMessageImpl;
186
187         friend class _PushMessageImpl;
188 }; // PushMessage
189
190 } } // Tizen::Messaging
191 #endif // _FMSG_PUSH_MESSAGE_H_