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_BluetoothOppClientEventArg.h
19 * @brief This is the header file for the _BluetoothOppClientEventArg class.
21 * This header file contains the declarations of the _BluetoothOppClientEventArg class which includes information to be
22 * passed to the event listeners
24 #ifndef _FNET_BT_INTERNAL_BLUETOOTH_OPP_CLIENT_EVENT_ARG_H_
25 #define _FNET_BT_INTERNAL_BLUETOOTH_OPP_CLIENT_EVENT_ARG_H_
27 #include <FBaseObject.h>
28 #include <FBaseResult.h>
29 #include <FBaseString.h>
30 #include <FOspConfig.h>
31 #include <FBaseRtIEventArg.h>
33 namespace Tizen { namespace Net { namespace Bluetooth
36 // Forward declaration
37 class BluetoothDevice;
40 * @enum _BluetoothOppClientEventType
41 * Type for specifying the type of _BluetoothOppClientEvent
43 enum _BluetoothOppClientEventType
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 */
51 * @class _BluetoothOppClientEventArg
52 * @brief This class is used as an argument for callback methods of the _IBluetoothOppClientEventListener class.
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
58 class _BluetoothOppClientEventArg
59 : public Tizen::Base::Object
60 , public Tizen::Base::Runtime::IEventArg
64 * This is a class constructor for _BT_OPP_CLIENT_EVENT_PUSH_RESPONDED event.
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.
70 _BluetoothOppClientEventArg(result r);
73 * This is a class constructor for _BT_OPP_CLIENT_EVENT_TRANSFER_DONE event.
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
80 _BluetoothOppClientEventArg(const Tizen::Base::String& filePath, int fileSize, bool isCompleted);
83 * This is a class constructor for _BT_OPP_CLIENT_EVENT_TRANSFER_PROGRESS event.
85 * @param[in] percent The progress in percentage ranging from @c 1 to @c 100 percent
87 _BluetoothOppClientEventArg(int percent);
90 * This is the class destructor.
92 ~_BluetoothOppClientEventArg(void);
95 * Gets the type of this event.
97 * @return The type of the event
99 _BluetoothOppClientEventType GetEventType(void) const;
102 * Gets the error result of this event.
104 * @return The result of the event
106 result GetErrorResult(void) const;
109 * Gets the sent file path.
111 * @return The sent file path
113 Tizen::Base::String GetFilePath(void) const;
116 * Gets the sent file size.
118 * @return The sent file size
120 int GetFileSize(void) const;
123 * Is the file transfer completed.
125 * @return @c true if the transfer is successfully completed, @n
128 bool IsTransferCompleted(void) const;
131 * Gets the progress information as a type of percentage.
133 * @return The percentage that represents the progress of file transfer
135 int GetPercent(void) const;
138 _BluetoothOppClientEventArg(void);
139 _BluetoothOppClientEventArg(const _BluetoothOppClientEventArg& eventArg);
140 _BluetoothOppClientEventArg& operator =(const _BluetoothOppClientEventArg& rValue);
143 _BluetoothOppClientEventType __evtType;
145 Tizen::Base::String __filePath;
150 }; // _BluetoothOppClientEventArg
153 #endif // _FNET_BT_INTERNAL_BLUETOOTH_OPP_CLIENT_EVENT_ARG_H_