Modified doxygen @code for pushmanager.
[platform/framework/native/messaging.git] / inc / FMsgIPushManagerListener.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                FMsgIPushManagerListener.h
19  * @brief               This is the header file for the %IPushManagerListener interface.
20  *
21  * This header file contains the declarations of the %IPushManagerListener interface.
22  */
23
24 #ifndef _FMSG_IPUSH_MANAGER_LISTENER_H_
25 #define _FMSG_IPUSH_MANAGER_LISTENER_H_
26
27 #include <FBaseRtIEventListener.h>
28
29 namespace Tizen { namespace Messaging
30 {
31 /**
32 * @interface    IPushManagerListener
33 * @brief                This listener interface receives the registration result.
34 *
35 * @since                2.0
36 *
37 * The %IPushManagerListener interface must be implemented to receive results of the push event registration. An application must register this interface using the PushManager::Construct() method.
38 */
39 class _OSP_EXPORT_ IPushManagerListener
40         : virtual public Tizen::Base::Runtime::IEventListener
41 {
42 public:
43         /**
44          * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
45          *
46          * @since               2.0
47          */
48         virtual ~IPushManagerListener(void) {}
49
50 public:
51         /**
52         * Called when the result is received from PushManager::RegisterPushService().
53         *
54         * @since                2.0
55         *
56         * @param[in]    reqId                           The request ID
57         * @param[in]    registrationId          The registration ID of the device @n
58         *                                   The application must deliver this ID to the application server.
59         * @param[in]    r                                       The result of the request
60         * @param[in]    errorCode                       The error code from the server
61         * @param[in]    errorMsg                        The error message from the server
62         * @exception    E_SUCCESS                       The method is successful.
63         * @exception    E_SYSTEM                        An unknown operating system error has occurred.
64         * @exception    E_CONNECTION_FAILED     The network connection has failed.
65         * @exception    E_SERVER                        An error has occurred on the server side.
66         * @exception    E_SERVICE_UNAVAILABLE   The service is unavailable. @n
67         * Check whether the push service registration is completed. For more information, see <a href="../org.tizen.native.appprogramming/html/guide/messaging/push_messaging.htm">Push Messaging Guide</a>.
68         * @see                  PushManager::RegisterPushService()
69         */
70         virtual void OnPushServiceRegistered(RequestId reqId, const Tizen::Base::String& registrationId, result r, const Tizen::Base::String& errorCode, const Tizen::Base::String& errorMsg) = 0;
71
72         /**
73         * Called when the result is received from PushManager::UnregisterPushService().
74         *
75         * @since                2.0
76         *
77         * @param[in]    reqId                           The request ID
78         * @param[in]    r                                       The result of the request
79         * @param[in]    errorCode                       The error code from the server
80         * @param[in]    errorMsg                        The error message from the server
81         * @exception    E_SUCCESS                       The method is successful.
82         * @exception    E_SYSTEM                        An unknown operating system error has occurred.
83         * @exception    E_CONNECTION_FAILED     The network connection has failed.
84         * @exception    E_SERVER                        An error has occurred on the server side.
85         * @see                  PushManager::UnregisterPushService()
86         */
87         virtual void OnPushServiceUnregistered(RequestId reqId, result r, const Tizen::Base::String& errorCode, const Tizen::Base::String& errorMsg) = 0;
88
89         /**
90         * Called when the result is received from PushManager::SendPushMessage().
91         *
92         * @since                2.0
93         *
94         * @param[in]    reqId                                           The request ID
95         * @param[in]    registrationId                          The registration ID of the recipient
96         * @param[in]    r                                                       The result of the request, @n
97         *                                                                                                                       Exception code may be given through this parameter.
98         * @param[in]    errorCode                                       The error code from the server
99         * @param[in]    errorMsg                                        The error message from the server
100         * @exception    E_SUCCESS                                       The method is successful.
101         * @exception    E_INVALID_DATA                          An invalid data is received from the server.
102         * @exception    E_CONNECTION_FAILED             The network connection has failed.
103         * @exception    E_REMOTE_DEVICE_NOT_FOUND       The registration ID is invalid, so the recipient is not found.
104         * @exception    E_AUTHENTICATION                        The appSecret is invalid, so application authentication has failed.
105         * @exception    E_SERVER                                        An error has occurred on the server side.
106         * @exception    E_SERVICE_UNAVAILABLE           The service is unavailable. @n
107         * Check whether the push service registration is completed. For more information, see <a href="../org.tizen.native.appprogramming/html/guide/messaging/push_messaging.htm">Push Messaging Guide</a>.
108         * @see                  PushManager::SendPushMessage()
109         */
110         virtual void OnPushMessageSent(RequestId reqId, const Tizen::Base::String& registrationId, result r, const Tizen::Base::String& errorCode, const Tizen::Base::String& errorMsg) {}
111
112 protected:
113         //
114         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
115         //
116         // This method is reserved and may change its name at any time without prior notice.
117         //
118         // @since               2.0
119         //
120         virtual void IPushManagerListener_Reserved2(void) {}
121
122         //
123         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
124         //
125         // This method is reserved and may change its name at any time without prior notice.
126         //
127         // @since               2.0
128         //
129         virtual void IPushManagerListener_Reserved3(void) {}
130 }; // IPushManagerListener
131
132 } } // Tizen::Messaging
133 #endif // _FMSG_IPUSH_MANAGER_LISTENER_H_