update the header for Doxygen
[platform/framework/native/bluetooth.git] / src / FNetBt_BluetoothHealthEventArg.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_BluetoothHealthEventArg.h
19  * @brief   This is the header file for the _BluetoothHealthEventArg class.
20  *
21  * This header file contains the declarations of the _BluetoothHealthEventArg class which includes information to be
22  * passed to the event listeners
23  */
24 #ifndef _FNET_BT_INTERNAL_BLUETOOTH_HEALTH_EVENT_ARG_H_
25 #define _FNET_BT_INTERNAL_BLUETOOTH_HEALTH_EVENT_ARG_H_
26
27 #include <FBaseObject.h>
28 #include <FBaseResult.h>
29 #include <FBaseRtIEventArg.h>
30 #include <FNetBtBluetoothTypes.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    _BluetoothHealthEventType
45   * Type for specifying the type of _BluetoothHealthEvent
46   */
47 enum _BluetoothHealthEventType
48 {
49         _BT_HEALTH_EVENT_CONNECTED,         /**< For notifying that the connection is established */
50         _BT_HEALTH_EVENT_DISCONNECTED,      /**< For notifying that the connection is disconnected */
51         _BT_HEALTH_EVENT_DATA_RECEIVED,     /**< For notifying that the data has been received */
52 };
53
54 /**
55  * @class   _BluetoothHealthEventArg
56  * @brief   This class is used as an argument for callback methods of the IBluetoothHealthEventListener class.
57  *
58  * When a _BluetoothHealthEvent occurs, the _BluetoothHealthEvent finds a IBluetoothHealthEventListener instance
59  * which is registered for the _BluetoothHealthEvent and calls an appropriate method of the listener.
60  * @see     IBluetoothHealthEventListener
61  */
62 class _BluetoothHealthEventArg
63         : public Tizen::Base::Object
64         , public Tizen::Base::Runtime::IEventArg
65 {
66 public:
67         /**
68          * This is a class constructor for _BT_HEALTH_EVENT_CONNECTED event.
69          *
70          * @param[in]   channelId           The channel ID of the established connection, @n
71          *                                  else an invalid ID (-1) if the method is not successful
72          * @param[in]   dataType                        dataType represents the type of health device (eg thermometer, BP device)
73          *                                                                      and is defined in ISO/IEEE 11073-20601 standard
74          * @param[in]   channelType         The data channel type of the established connection
75          * @param[in]   pRemoteDevice       The remote health device which the local device connects with, @n
76          *                                  else @c null if the method is not successful
77          * @param[in]   r                   The result of the connection request
78          * @exception   E_SUCCESS           The connection request is accepted by the target health device.
79          * @exception   E_REJECTED          The connection request is rejected by the target health device.
80          * @exception   E_TIMEOUT           The connection request has timed out.
81          * @exception   E_OPERATION_FAILED  The connection request has failed.
82          */
83         _BluetoothHealthEventArg(int channelId, int dataType, BluetoothHealthDataChannelType channelType,
84                                 const BluetoothDevice* pDevice, result r);
85
86         /**
87          * This is a class constructor for _BT_HEALTH_EVENT_DISCONNECTED event.
88          *
89          * @param[in]   channelId           The channel ID of the terminated connection
90          * @param[in]   r                   The disconnection status
91          * @exception   E_SUCCESS           The specified connection (channel) is terminated successfully.
92          * @exception   E_OPERATION_FAILED  The method has failed to disconnect.
93          */
94         _BluetoothHealthEventArg(int channelId, result r);
95
96         /**
97          * This is a class constructor for _BT_HEALTH_EVENT_DATA_RECEIVED event.
98          *
99          * @param[in]   channelId           The channel ID of the conneciton which data is received on
100          * @param[in]   buffer              The received data
101          */
102         _BluetoothHealthEventArg(int channelId, const Tizen::Base::ByteBuffer& buffer);
103
104         /**
105          * This is the class destructor.
106          */
107         ~_BluetoothHealthEventArg(void);
108
109         /**
110          * Gets the type of this event.
111          *
112          * @return      The type of the event
113          */
114         _BluetoothHealthEventType GetEventType(void) const;
115
116         /**
117          * Gets the socket client device.
118          *
119          * @return      The pointer of the source device which is connect with
120          */
121         const BluetoothDevice* GetSourceDevice(void) const;
122
123         /**
124          * Gets the channel ID.
125          *
126          * @return      The channel ID
127          */
128         int GetChannelId(void) const;
129
130         /**
131          * Gets the Data Type.
132          *
133          * @return      The Data Type
134          */
135         int GetDataType(void) const;
136
137         /**
138          * Gets the data channel type.
139          *
140          * @return      The data channel type
141          */
142         BluetoothHealthDataChannelType GetChannelType(void) const;
143
144         /**
145          * Gets the error result of this event.
146          *
147          * @return      The result of the event
148          */
149         result GetErrorResult(void) const;
150
151         /**
152          * Gets The received data.
153          *
154          * @return      The received data
155          */
156         Tizen::Base::ByteBuffer* GetReceivedData(void) const;
157
158 private:
159         _BluetoothHealthEventArg(void);
160         _BluetoothHealthEventArg(const _BluetoothHealthEventArg& eventArg);
161         _BluetoothHealthEventArg& operator =(const _BluetoothHealthEventArg& rValue);
162
163 private:
164         _BluetoothHealthEventType __evtType;
165         BluetoothDevice* __pTargetDevice;
166         int __channelId;
167         int __dataType;
168         BluetoothHealthDataChannelType __channelType;
169         result __result;
170         Tizen::Base::ByteBuffer* __pData;
171
172 }; // _BluetoothHealthEventArg
173
174 } } }
175 #endif // _FNET_BT_INTERNAL_BLUETOOTH_HEALTH_EVENT_ARG_H_