2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FNetBt_BluetoothSppAcceptorEventArg.h
19 * @brief This is the header file for the _BluetoothSppAcceptorEventArg class.
21 * This header file contains the declarations of the _BluetoothSppAcceptorEventArg class which includes information to be
22 * passed to the event listeners
24 #ifndef _FNET_BT_INTERNAL_BLUETOOTH_SPP_ACCEPTOR_EVENT_ARG_H_
25 #define _FNET_BT_INTERNAL_BLUETOOTH_SPP_ACCEPTOR_EVENT_ARG_H_
27 #include <FBaseObject.h>
28 #include <FBaseResult.h>
29 #include <FOspConfig.h>
30 #include <FBaseRtIEventArg.h>
32 // Forward declaration
33 namespace Tizen { namespace Base {
37 namespace Tizen { namespace Net { namespace Bluetooth
40 // Forward declaration
41 class BluetoothDevice;
44 * @enum _BluetoothSppAcceptorEventType
45 * Type for specifying the type of _BluetoothSppAcceptorEvent
47 enum _BluetoothSppAcceptorEventType
49 _BT_SPP_ACCEPTOR_EVENT_CONN_REQUESTED, /**< For notifying that a new connection request is received */
50 _BT_SPP_ACCEPTOR_EVENT_DISCONNECTED, /**< For notifying that the connection is disconnected */
51 _BT_SPP_ACCEPTOR_EVENT_DATA_RECEIVED, /**< For notifying that the data has been received */
55 * @class _BluetoothSppAcceptorEventArg
56 * @brief This class is used as an argument for callback methods of the IBluetoothSppAcceptorEventListener class.
58 * When a _BluetoothSppAcceptorEvent occurs, the _BluetoothSppAcceptorEvent finds a IBluetoothSppAcceptorEventListener instance
59 * which is registered for the _BluetoothSppAcceptorEvent and calls an appropriate method of the listener.
60 * @see IBluetoothSppAcceptorEventListener
62 class _BluetoothSppAcceptorEventArg
63 : public Tizen::Base::Object
64 , public Tizen::Base::Runtime::IEventArg
68 * This is a class constructor for _BT_SPP_ACCEPTOR_EVENT_CONN_REQUESTED event.
70 * @param[in] device The SPP initiator device
72 _BluetoothSppAcceptorEventArg(const BluetoothDevice& device);
75 * This is a class constructor for _BT_SPP_ACCEPTOR_EVENT_DISCONNECTED event.
77 * @param[in] r The result of the event
78 * @exception E_SUCCESS The connection is terminated successfully.
79 * @exception E_SYSTEM The method has failed to disconnect.
81 _BluetoothSppAcceptorEventArg(result r);
84 * This is a class constructor for _BT_SPP_ACCEPTOR_EVENT_DATA_RECEIVED event.
86 * @param[in] buffer The received data
88 _BluetoothSppAcceptorEventArg(const Tizen::Base::ByteBuffer& buffer);
91 * This is the class destructor.
93 ~_BluetoothSppAcceptorEventArg(void);
96 * Gets the type of this event.
98 * @return The type of the event
100 _BluetoothSppAcceptorEventType GetEventType(void) const;
103 * Gets the SPP initiator device.
105 * @return The pointer of the SPP initiator device which request to connect
107 const BluetoothDevice* GetRequester(void) const;
110 * Gets the error result of this event.
112 * @return The result of the event
114 result GetErrorResult(void) const;
117 * Gets The received data.
119 * @return The received data
121 Tizen::Base::ByteBuffer* GetReceivedData(void) const;
124 _BluetoothSppAcceptorEventArg(void);
125 _BluetoothSppAcceptorEventArg(const _BluetoothSppAcceptorEventArg& eventArg);
126 _BluetoothSppAcceptorEventArg& operator =(const _BluetoothSppAcceptorEventArg& rValue);
129 _BluetoothSppAcceptorEventType __evtType;
130 BluetoothDevice* __pRequester;
132 Tizen::Base::ByteBuffer* __pData;
134 }; // _BluetoothSppAcceptorEventArg
137 #endif // _FNET_BT_INTERNAL_BLUETOOTH_SPP_ACCEPTOR_EVENT_ARG_H_