2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
20 * @file FNetSockISecureSocketEventListener.h
21 * @brief This is the header file for the %ISecureSocketEventListener interface.
23 * This header file contains the declarations of the %ISecureSocketEventListener interface.
26 #ifndef _FNET_SOCK_ISECURE_SOCKET_EVENT_LISTENER_H_
27 #define _FNET_SOCK_ISECURE_SOCKET_EVENT_LISTENER_H_
29 #include <FBaseRtIEventListener.h>
30 #include <FNetSockSocketTypes.h>
32 namespace Tizen { namespace Net { namespace Sockets
38 * @interface ISecureSocketEventListener
39 * @brief This interface contains an event listener for the applications, which issues secure socket requests.
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.
47 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/sockets.htm">Sockets Guide</a>.
49 class _OSP_EXPORT_ ISecureSocketEventListener
50 : virtual public Tizen::Base::Runtime::IEventListener
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.
60 virtual ~ISecureSocketEventListener(void) {}
65 * Called to notify a connecting secure socket that its connection attempt has been completed successfully.
69 * @param[in] socket The SecureSocket instance
71 virtual void OnSecureSocketConnected(SecureSocket& socket) = 0;
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.
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>.
84 virtual void OnSecureSocketClosed(SecureSocket& socket, NetSocketClosedReason reason) = 0;
87 * Called to notify a secure socket that the data is ready to be retrieved.
91 * @param[in] socket The SecureSocket instance
92 * @remarks This data can be retrieved by calling Receive().
94 virtual void OnSecureSocketReadyToReceive(SecureSocket& socket) = 0;
98 * Called to notify a secure socket that the data can be sent.
102 * @param[in] socket The SecureSocket instance
103 * @remarks This data can be sent by calling Send().
105 virtual void OnSecureSocketReadyToSend(SecureSocket& socket) = 0;
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.
115 * @param[in] socket The SecureSocket instance
117 virtual void OnSecureSocketServCertFailed(SecureSocket& socket) = 0;
120 * Called to notify a secure socket that it has received a new connection from a peer.
124 * @param[in] socket The SecureSocket instance
126 virtual void OnSecureSocketAccept(SecureSocket& socket) {}
130 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
132 // This method is reserved and may change its name at any time without prior notice.
136 virtual void ISecureSocketEventListener_Reserved1(void) {}
139 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
141 // This method is reserved and may change its name at any time without prior notice.
145 virtual void ISecureSocketEventListener_Reserved2(void) {}
149 } } } // Tizen::Net::Sockets
150 #endif // _FNET_SOCK_ISECURE_SOCKET_EVENT_LISTENER_H_