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.
19 * @file FNetBtBluetoothOppClient.h
20 * @brief This is the header file for the %BluetoothOppClient class.
22 * This header file contains the declarations of the %BluetoothOppClient class.
24 #ifndef _FNET_BT_BLUETOOTH_OPP_CLIENT_H_
25 #define _FNET_BT_BLUETOOTH_OPP_CLIENT_H_
27 #include <FBaseObject.h>
28 #include <FBaseResult.h>
30 namespace Tizen { namespace Base
35 namespace Tizen { namespace Net { namespace Bluetooth
38 // forward declarations
39 class BluetoothDevice;
40 class IBluetoothOppClientEventListener;
41 class _BluetoothOppClientImpl;
44 * @class BluetoothOppClient
45 * @brief This class provides methods to handle the %Bluetooth Object Push Profile (OPP) client, such as the
46 * outgoing connection requests.
50 * The %BluetoothOppClient class provides methods to handle the %Bluetooth Object Push Profile (OPP) client, such as the outgoing
51 * connection requests.
53 * For more information on the class features, see
54 * <a href="../org.tizen.native.appprogramming/html/guide/net/bluetooth_namespace.htm">Bluetooth Guide</a>.
56 class _OSP_EXPORT_ BluetoothOppClient
57 : public Tizen::Base::Object
61 * The object is not fully constructed after this constructor is called. For full construction, the Construct() method
62 * must be called right after calling this constructor.
66 BluetoothOppClient(void);
69 * This destructor overrides Tizen::Base::Object::~Object().
73 virtual ~BluetoothOppClient(void);
76 * Constructs and initializes this instance of %BluetoothOppClient with the specified listener.
79 * @feature %http://tizen.org/feature/network.bluetooth
81 * @return An error code
82 * @param[in] listener The event listener for the OPP client
83 * @exception E_SUCCESS The method is successful.
84 * @exception E_OUT_OF_MEMORY The memory is insufficient.
85 * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature.
86 * For more information, see
87 * <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">
88 * Application Filtering</a>.
89 * @exception E_SYSTEM A system error has occurred.
90 * @remarks Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue()
93 result Construct(IBluetoothOppClientEventListener& listener);
96 * Pushes a file to a remote OPP server. @n
97 * The file transfer starts when the OPP server accepts the request.
100 * @brief <i> [Compatibility] </i>
104 * @compatibility This method has compatibility issues. @n
105 * For more information, see @ref CompIoPathPage "here".
108 * @privilege %http://tizen.org/privilege/bluetooth.opp
110 * @return An error code
111 * @param[in] remoteDevice The remote OPP server
112 * @param[in] filePath The path of the source file
113 * @exception E_SUCCESS The method is successful.
114 * @exception E_INVALID_STATE This instance is in an invalid state. @n
115 * For example, %Bluetooth is not activated.
116 * @exception E_IN_PROGRESS The push process is in progress.
117 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
118 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
119 * @exception E_SERVICE_UNAVAILABLE The OPP service is unavailable.
120 * @exception E_INACCESSIBLE_PATH The specified @c filePath is inaccessible.
121 * @exception E_REMOTE_DEVICE_NOT_FOUND The input device is not found. @n
122 * This exception is currently not in use.
123 * @exception E_FAILURE The method has failed.
124 * @remarks If the local device is not paired with the specified target device, the pairing process starts
125 * internally before the push request is sent.
126 * @see IBluetoothOppServerEventListener::OnOppPushRequested()
128 result PushFile(const BluetoothDevice& remoteDevice, const Tizen::Base::String& filePath);
131 * Cancels the file push request in progress. @n
132 * If the %CancelPush() method is called before the OPP server accepts the push request, the
133 * IBluetoothOppClientEventListener::OnOppPushResponded() method is called and its result @c E_SYSTEM is thrown. @n
134 * If this method is called during the file transfer, the IBluetoothOppClientEventListener::OnOppTransferDone()
135 * method is called with @c isCompleted as @c false.
139 * @privilege %http://tizen.org/privilege/bluetooth.opp
141 * @return An error code
142 * @exception E_SUCCESS The method is successful.
143 * @exception E_INVALID_STATE This instance is in an invalid state. @n
144 * For example, %Bluetooth is not activated.
145 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified
147 * For example, the push request is not sent or accepted by a remote device.
148 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
149 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
150 * @exception E_FAILURE The method has failed.
152 result CancelPush(void);
155 * Sets the minimum interval of invocation of IBluetoothOppClientEventListener::OnOppTransferInProgress() in
157 * The default value is @c 5.
161 * @return An error code
162 * @param[in] percent The minimum period of progress interval as a percentage value
163 * @exception E_SUCCESS The method is successful.
164 * @exception E_OUT_OF_RANGE The value of an argument is outside the valid range defined by the method.
166 result SetMinProgressInterval(int percent);
170 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying
173 BluetoothOppClient(const BluetoothOppClient& value);
176 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit
177 // copying of objects.
179 BluetoothOppClient& operator =(const BluetoothOppClient& value);
182 _BluetoothOppClientImpl* __pImpl;
184 }; // BluetoothOppClient
187 #endif // _FNET_BT_BLUETOOTH_OPP_CLIENT_H_