remove link in brief tag
[platform/framework/native/net.git] / inc / FNetSockISecureSocketEventListener.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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
19 /**
20 * @file         FNetSockISecureSocketEventListener.h
21 * @brief        This is the header file for the %ISecureSocketEventListener interface.
22 *
23 * This header file contains the declarations of the %ISecureSocketEventListener interface.
24 */
25
26 #ifndef _FNET_SOCK_ISECURE_SOCKET_EVENT_LISTENER_H_
27 #define _FNET_SOCK_ISECURE_SOCKET_EVENT_LISTENER_H_
28
29 #include <FBaseRtIEventListener.h>
30 #include <FNetSockSocketTypes.h>
31
32 namespace Tizen { namespace Net { namespace Sockets
33 {
34
35 class SecureSocket;
36
37 /**
38 * @interface    ISecureSocketEventListener
39 * @brief                This interface contains an event listener for the applications, which issues secure socket requests.
40 *
41 * @since        2.0
42 *
43 *                               The %ISecureSocketEventListener interface specifies the methods used for creating the notifications about the different kinds of socket
44 *                               events. These events are sent out when using a secure socket in a non-blocking mode. An event listener is added by calling the
45 *                               SecureSocket::AddSecureSocketListener() method. One of these methods is called when a socket event is generated.
46 *
47 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/sockets.htm">Sockets Guide</a>.
48 */
49 class _OSP_EXPORT_ ISecureSocketEventListener
50         : virtual public Tizen::Base::Runtime::IEventListener
51 {
52
53
54 public:
55         /**
56         * 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.
57         *
58         * @since        2.0
59         */
60         virtual ~ISecureSocketEventListener(void) {}
61
62
63 public:
64         /**
65         * Called to notify a connecting secure socket that its connection attempt has been completed successfully.
66         *
67         * @since                2.0
68         *
69         * @param[in]    socket          The SecureSocket instance
70         */
71         virtual void OnSecureSocketConnected(SecureSocket& socket) = 0;
72
73         /**
74         * Called to notify the registered secure socket that the peer secure socket has been closed due to normal or forced termination of network. @n
75         * It is also used to notify a connecting secure socket that its connection attempt has resulted in an error.
76         *
77         * @since        2.0
78         *
79         * @param[in]    socket          The SecureSocket instance
80         * @param[in]    reason          The reason of type NetSocketClosedReason for a closed secure socket
81         * @remarks              If the reason is @c NET_SOCKET_CLOSED_REASON_NO_CERTIFICATE, start the Application control (L"tizen.certificatemanager") for getting the selected client certificate. @n
82         *               For more information, see <a href="../org.tizen.native.appprogramming/html/guide/app/appcontrol_certmgr.htm">here</a>.
83         */
84         virtual void OnSecureSocketClosed(SecureSocket& socket, NetSocketClosedReason reason) = 0;
85
86         /**
87         * Called to notify a secure socket that the data is ready to be retrieved.
88         *
89         * @since        2.0
90         *
91         * @param[in]    socket          The SecureSocket instance
92         * @remarks              This data can be retrieved by calling Receive().
93         */
94         virtual void OnSecureSocketReadyToReceive(SecureSocket& socket) = 0;
95
96
97         /**
98         * Called to notify a secure socket that the data can be sent.
99         *
100         * @since        2.0
101         *
102         * @param[in]    socket          The SecureSocket instance
103         * @remarks              This data can be sent by calling Send().
104         */
105         virtual void OnSecureSocketReadyToSend(SecureSocket& socket) = 0;
106
107         /**
108         * Called to notify a secure socket that the verification of the server's certificate has failed. @n
109         * Either of the following decisions can be taken after the verification fails: @n
110         * - Continue with SSL handshaking without verification.
111         * - Close the secure socket.
112         *
113         * @since        2.0
114         *
115         * @param[in]    socket   The SecureSocket instance
116         */
117         virtual void OnSecureSocketServCertFailed(SecureSocket& socket) = 0;
118
119         /**
120          * Called to notify a secure socket that it has received a new connection from a peer.
121          *
122          * @since        2.0
123          *
124          * @param[in]   socket          The SecureSocket instance
125          */
126         virtual void OnSecureSocketAccept(SecureSocket& socket) {}
127
128 protected:
129         //
130         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
131         //
132         // This method is reserved and may change its name at any time without prior notice.
133         //
134         // @since       2.0
135         //
136         virtual void ISecureSocketEventListener_Reserved1(void) {}
137
138         //
139         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
140         //
141         // This method is reserved and may change its name at any time without prior notice.
142         //
143         // @since       2.0
144         //
145         virtual void ISecureSocketEventListener_Reserved2(void) {}
146
147 };
148
149 } } } // Tizen::Net::Sockets
150 #endif // _FNET_SOCK_ISECURE_SOCKET_EVENT_LISTENER_H_