update the header for Doxygen
[platform/framework/native/bluetooth.git] / src / FNetBt_BluetoothSppAcceptorEventArg.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_BluetoothSppAcceptorEventArg.h
19  * @brief   This is the header file for the _BluetoothSppAcceptorEventArg class.
20  *
21  * This header file contains the declarations of the _BluetoothSppAcceptorEventArg class which includes information to be
22  * passed to the event listeners
23  */
24 #ifndef _FNET_BT_INTERNAL_BLUETOOTH_SPP_ACCEPTOR_EVENT_ARG_H_
25 #define _FNET_BT_INTERNAL_BLUETOOTH_SPP_ACCEPTOR_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    _BluetoothSppAcceptorEventType
45   * Type for specifying the type of _BluetoothSppAcceptorEvent
46   */
47 enum _BluetoothSppAcceptorEventType
48 {
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 */
52 };
53
54 /**
55  * @class   _BluetoothSppAcceptorEventArg
56  * @brief   This class is used as an argument for callback methods of the IBluetoothSppAcceptorEventListener class.
57  *
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
61  */
62 class _BluetoothSppAcceptorEventArg
63         : public Tizen::Base::Object
64         , public Tizen::Base::Runtime::IEventArg
65 {
66 public:
67         /**
68          * This is a class constructor for _BT_SPP_ACCEPTOR_EVENT_CONN_REQUESTED event.
69          *
70          * @param[in]   device               The SPP initiator device
71          */
72         _BluetoothSppAcceptorEventArg(const BluetoothDevice& device);
73
74         /**
75          * This is a class constructor for _BT_SPP_ACCEPTOR_EVENT_DISCONNECTED event.
76          *
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.
80          */
81         _BluetoothSppAcceptorEventArg(result r);
82
83         /**
84          * This is a class constructor for _BT_SPP_ACCEPTOR_EVENT_DATA_RECEIVED event.
85          *
86          * @param[in]   buffer               The received data
87          */
88         _BluetoothSppAcceptorEventArg(const Tizen::Base::ByteBuffer& buffer);
89
90         /**
91          * This is the class destructor.
92          */
93         ~_BluetoothSppAcceptorEventArg(void);
94
95         /**
96          * Gets the type of this event.
97          *
98          * @return      The type of the event
99          */
100         _BluetoothSppAcceptorEventType GetEventType(void) const;
101
102         /**
103          * Gets the SPP initiator device.
104          *
105          * @return      The pointer of the SPP initiator device which request to connect
106          */
107         const BluetoothDevice* GetRequester(void) const;
108
109         /**
110          * Gets the error result of this event.
111          *
112          * @return      The result of the event
113          */
114         result GetErrorResult(void) const;
115
116         /**
117          * Gets The received data.
118          *
119          * @return      The received data
120          */
121         Tizen::Base::ByteBuffer* GetReceivedData(void) const;
122
123 private:
124         _BluetoothSppAcceptorEventArg(void);
125         _BluetoothSppAcceptorEventArg(const _BluetoothSppAcceptorEventArg& eventArg);
126         _BluetoothSppAcceptorEventArg& operator =(const _BluetoothSppAcceptorEventArg& rValue);
127
128 private:
129         _BluetoothSppAcceptorEventType __evtType;
130         BluetoothDevice* __pRequester;
131         result __result;
132         Tizen::Base::ByteBuffer* __pData;
133
134 }; // _BluetoothSppAcceptorEventArg
135
136 } } }
137 #endif // _FNET_BT_INTERNAL_BLUETOOTH_SPP_ACCEPTOR_EVENT_ARG_H_