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_BluetoothSppInitiatorEventArg.h
19 * @brief This is the header file for the _BluetoothSppInitiatorEventArg class.
21 * This header file contains the declarations of the _BluetoothSppInitiatorEventArg class which includes information to be
22 * passed to the event listeners
24 #ifndef _FNET_BT_INTERNAL_BLUETOOTH_SPP_INITIATOR_EVENT_ARG_H_
25 #define _FNET_BT_INTERNAL_BLUETOOTH_SPP_INITIATOR_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 _BluetoothSppInitiatorEventType
45 * Type for specifying the type of _BluetoothSppInitiatorEvent
47 enum _BluetoothSppInitiatorEventType
49 _BT_SPP_INITIATOR_EVENT_CONN_RESPONDED, /**< For notifying that the response of the connection request is received */
50 _BT_SPP_INITIATOR_EVENT_DISCONNECTED, /**< For notifying that the connection is disconnected */
51 _BT_SPP_INITIATOR_EVENT_DATA_RECEIVED, /**< For notifying that the data has been received */
55 * @class _BluetoothSppInitiatorEventArg
56 * @brief This class is used as an argument for callback methods of the _IBluetoothSppInitiatorEventListener class.
58 * When a _BluetoothSppInitiatorEvent occurs, the _BluetoothSppInitiatorEvent finds a _IBluetoothSppInitiatorEventListener instance
59 * which is registered for the _BluetoothSppInitiatorEvent and calls an appropriate method of the listener.
60 * @see _IBluetoothSppInitiatorEventListener
62 class _BluetoothSppInitiatorEventArg
63 : public Tizen::Base::Object
64 , public Tizen::Base::Runtime::IEventArg
68 * This is a class constructor for _BT_SPP_INITIATOR_EVENT_CONN_RESPONDED and _BT_SPP_INITIATOR_EVENT_DISCONNECTED event.
70 * @param[in] isResponse @c true if the event is a connection response,
72 * @param[in] r The result of the event
73 * @exception E_SUCCESS The connection is established successfully.
74 * @exception E_SYSTEM The connection fails.
76 _BluetoothSppInitiatorEventArg(bool isResponse, result r);
79 * This is a class constructor for _BT_SPP_INITIATOR_EVENT_DATA_RECEIVED event.
81 * @param[in] buffer The received data
83 _BluetoothSppInitiatorEventArg(const Tizen::Base::ByteBuffer& buffer);
86 * This is the class destructor.
88 ~_BluetoothSppInitiatorEventArg(void);
91 * Gets the type of this event.
93 * @return The type of the event
95 _BluetoothSppInitiatorEventType GetEventType(void) const;
98 * Gets the error result of this event.
100 * @return The result of the event
102 result GetErrorResult(void) const;
105 * Gets The received data.
107 * @return The received data
109 Tizen::Base::ByteBuffer* GetReceivedData(void) const;
112 _BluetoothSppInitiatorEventArg(void);
113 _BluetoothSppInitiatorEventArg(const _BluetoothSppInitiatorEventArg& eventArg);
114 _BluetoothSppInitiatorEventArg& operator =(const _BluetoothSppInitiatorEventArg& rValue);
117 _BluetoothSppInitiatorEventType __evtType;
119 Tizen::Base::ByteBuffer* __pData;
121 }; // _BluetoothSppInitiatorEventArg
124 #endif // _FNET_BT_INTERNAL_BLUETOOTH_SPP_INITIATOR_EVENT_ARG_H_