update the header for Doxygen
[platform/framework/native/bluetooth.git] / src / FNetBt_BluetoothOppClientEventArg.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_BluetoothOppClientEventArg.h
19  * @brief   This is the header file for the _BluetoothOppClientEventArg class.
20  *
21  * This header file contains the declarations of the _BluetoothOppClientEventArg class which includes information to be
22  * passed to the event listeners
23  */
24 #ifndef _FNET_BT_INTERNAL_BLUETOOTH_OPP_CLIENT_EVENT_ARG_H_
25 #define _FNET_BT_INTERNAL_BLUETOOTH_OPP_CLIENT_EVENT_ARG_H_
26
27 #include <FBaseObject.h>
28 #include <FBaseResult.h>
29 #include <FBaseString.h>
30 #include <FOspConfig.h>
31 #include <FBaseRtIEventArg.h>
32
33 namespace Tizen { namespace Net { namespace Bluetooth
34 {
35
36 // Forward declaration
37 class BluetoothDevice;
38
39 /**
40   * @enum    _BluetoothOppClientEventType
41   * Type for specifying the type of _BluetoothOppClientEvent
42   */
43 enum _BluetoothOppClientEventType
44 {
45         _BT_OPP_CLIENT_EVENT_PUSH_RESPONDED,      /**< For notifying the OPP server responded to the push request */
46         _BT_OPP_CLIENT_EVENT_TRANSFER_DONE,       /**< For notifying the file transfer has finished */
47         _BT_OPP_CLIENT_EVENT_TRANSFER_PROGRESS,       /**< For notifying the file is being transferred */
48 };
49
50 /**
51  * @class   _BluetoothOppClientEventArg
52  * @brief   This class is used as an argument for callback methods of the _IBluetoothOppClientEventListener class.
53  *
54  * When a _BluetoothOppClientEvent occurs, the _BluetoothOppClientEvent finds a _IBluetoothOppClientEventListener instance
55  * which is registered for the _BluetoothOppClientEvent and calls an appropriate method of the listener.
56  * @see     _IBluetoothOppClientEventListener
57  */
58 class _BluetoothOppClientEventArg
59         : public Tizen::Base::Object
60         , public Tizen::Base::Runtime::IEventArg
61 {
62 public:
63         /**
64          * This is a class constructor for _BT_OPP_CLIENT_EVENT_PUSH_RESPONDED event.
65          *
66          * @param[in]   r                    The result of the event
67          * @exception   E_SUCCESS            The connection is established successfully.
68          * @exception   E_SYSTEM             The connection fails.
69          */
70         _BluetoothOppClientEventArg(result r);
71
72         /**
73          * This is a class constructor for  _BT_OPP_CLIENT_EVENT_TRANSFER_DONE event.
74          *
75          * @param[in]   filePath            The path of the transferred file
76          * @param[in]   fileSize            The size of the transferred file
77          * @param[in]   isCompleted         Set to @c true if the transfer is successfully completed, @n
78          *                                  else @c false
79          */
80          _BluetoothOppClientEventArg(const Tizen::Base::String& filePath, int fileSize, bool isCompleted);
81
82         /**
83          * This is a class constructor for _BT_OPP_CLIENT_EVENT_TRANSFER_PROGRESS event.
84          *
85          * @param[in]   percent         The progress in percentage ranging from @c 1 to @c 100 percent
86          */
87          _BluetoothOppClientEventArg(int percent);
88
89         /**
90          * This is the class destructor.
91          */
92         ~_BluetoothOppClientEventArg(void);
93
94         /**
95          * Gets the type of this event.
96          *
97          * @return      The type of the event
98          */
99         _BluetoothOppClientEventType GetEventType(void) const;
100
101         /**
102          * Gets the error result of this event.
103          *
104          * @return      The result of the event
105          */
106         result GetErrorResult(void) const;
107
108         /**
109          * Gets the sent file path.
110          *
111          * @return      The sent file path
112          */
113         Tizen::Base::String GetFilePath(void) const;
114
115         /**
116          * Gets the sent file size.
117          *
118          * @return      The sent file size
119          */
120         int GetFileSize(void) const;
121
122         /**
123          * Is the file transfer completed.
124          *
125          * @return      @c true if the transfer is successfully completed, @n
126          *              else @c false
127          */
128         bool IsTransferCompleted(void) const;
129
130         /**
131          * Gets the progress information as a type of percentage.
132          *
133          * @return      The percentage that represents the progress of file transfer
134          */
135         int GetPercent(void) const;
136
137 private:
138         _BluetoothOppClientEventArg(void);
139         _BluetoothOppClientEventArg(const _BluetoothOppClientEventArg& eventArg);
140         _BluetoothOppClientEventArg& operator =(const _BluetoothOppClientEventArg& rValue);
141
142 private:
143         _BluetoothOppClientEventType __evtType;
144         result __result;
145         Tizen::Base::String __filePath;
146         int __fileSize;
147         bool __isCompleted;
148         int __percent;
149
150 }; // _BluetoothOppClientEventArg
151
152 } } }
153 #endif // _FNET_BT_INTERNAL_BLUETOOTH_OPP_CLIENT_EVENT_ARG_H_