update the header for Doxygen
[platform/framework/native/bluetooth.git] / src / FNetBt_BluetoothSppInitiatorEventArg.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    FNetBt_BluetoothSppInitiatorEventArg.h
19  * @brief   This is the header file for the _BluetoothSppInitiatorEventArg class.
20  *
21  * This header file contains the declarations of the _BluetoothSppInitiatorEventArg class which includes information to be
22  * passed to the event listeners
23  */
24 #ifndef _FNET_BT_INTERNAL_BLUETOOTH_SPP_INITIATOR_EVENT_ARG_H_
25 #define _FNET_BT_INTERNAL_BLUETOOTH_SPP_INITIATOR_EVENT_ARG_H_
26
27 #include <FBaseObject.h>
28 #include <FBaseResult.h>
29 #include <FOspConfig.h>
30 #include <FBaseRtIEventArg.h>
31
32 // Forward declaration
33 namespace Tizen { namespace Base {
34 class ByteBuffer;
35 } }
36
37 namespace Tizen { namespace Net { namespace Bluetooth
38 {
39
40 // Forward declaration
41 class BluetoothDevice;
42
43 /**
44   * @enum    _BluetoothSppInitiatorEventType
45   * Type for specifying the type of _BluetoothSppInitiatorEvent
46   */
47 enum _BluetoothSppInitiatorEventType
48 {
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 */
52 };
53
54 /**
55  * @class   _BluetoothSppInitiatorEventArg
56  * @brief   This class is used as an argument for callback methods of the _IBluetoothSppInitiatorEventListener class.
57  *
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
61  */
62 class _BluetoothSppInitiatorEventArg
63         : public Tizen::Base::Object
64         , public Tizen::Base::Runtime::IEventArg
65 {
66 public:
67         /**
68          * This is a class constructor for _BT_SPP_INITIATOR_EVENT_CONN_RESPONDED and _BT_SPP_INITIATOR_EVENT_DISCONNECTED event.
69          *
70          * @param[in]   isResponse           @c true if the event is a connection response,
71          *                                   else @c false
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.
75          */
76         _BluetoothSppInitiatorEventArg(bool isResponse, result r);
77
78         /**
79          * This is a class constructor for _BT_SPP_INITIATOR_EVENT_DATA_RECEIVED event.
80          *
81          * @param[in]   buffer               The received data
82          */
83         _BluetoothSppInitiatorEventArg(const Tizen::Base::ByteBuffer& buffer);
84
85         /**
86          * This is the class destructor.
87          */
88         ~_BluetoothSppInitiatorEventArg(void);
89
90         /**
91          * Gets the type of this event.
92          *
93          * @return      The type of the event
94          */
95         _BluetoothSppInitiatorEventType GetEventType(void) const;
96
97         /**
98          * Gets the error result of this event.
99          *
100          * @return      The result of the event
101          */
102         result GetErrorResult(void) const;
103
104         /**
105          * Gets The received data.
106          *
107          * @return      The received data
108          */
109         Tizen::Base::ByteBuffer* GetReceivedData(void) const;
110
111 private:
112         _BluetoothSppInitiatorEventArg(void);
113         _BluetoothSppInitiatorEventArg(const _BluetoothSppInitiatorEventArg& eventArg);
114         _BluetoothSppInitiatorEventArg& operator =(const _BluetoothSppInitiatorEventArg& rValue);
115
116 private:
117         _BluetoothSppInitiatorEventType __evtType;
118         result __result;
119         Tizen::Base::ByteBuffer* __pData;
120
121 }; // _BluetoothSppInitiatorEventArg
122
123 } } }
124 #endif // _FNET_BT_INTERNAL_BLUETOOTH_SPP_INITIATOR_EVENT_ARG_H_