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 FNetBtBluetoothOppServer.h
20 * @brief This is the header file for the %BluetoothOppServer class.
22 * This header file contains the declarations of the %BluetoothOppServer class.
24 #ifndef _FNET_BT_BLUETOOTH_OPP_SERVER_H_
25 #define _FNET_BT_BLUETOOTH_OPP_SERVER_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 IBluetoothOppServerEventListener;
40 class _BluetoothOppServerImpl;
43 * @class BluetoothOppServer
44 * @brief This class provides methods to handle the %Bluetooth Object Push Profile (OPP) server, such as the
45 * incoming connection requests.
49 * The %BluetoothOppServer class provides methods to handle the %Bluetooth Object Push Profile (OPP) server, such as the incoming
50 * connection requests.
52 * For more information on the class features, see
53 * <a href="../org.tizen.native.appprogramming/html/guide/net/bluetooth_namespace.htm">Bluetooth Guide</a>.
55 class _OSP_EXPORT_ BluetoothOppServer
56 : public Tizen::Base::Object
60 * The object is not fully constructed after this constructor is called. For full construction, the Construct()
61 * method must be called right after calling this constructor.
65 BluetoothOppServer(void);
68 * This destructor overrides Tizen::Base::Object::~Object().
72 virtual ~BluetoothOppServer(void);
75 * Constructs and initializes this instance of %BluetoothOppServer with the specified listener.
78 * @feature %http://tizen.org/feature/network.bluetooth
80 * @return An error code
81 * @param[in] listener The event listener for the OPP server
82 * @exception E_SUCCESS The method is successful.
83 * @exception E_OUT_OF_MEMORY The memory is insufficient.
84 * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature.
85 * For more information, see
86 * <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">
87 * Application Filtering</a>.
88 * @exception E_SYSTEM A system error has occurred.
89 * @remarks Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue()
92 result Construct(IBluetoothOppServerEventListener& listener);
95 * Accepts a push request from a remote OPP client. @n
96 * The %AcceptPush() method starts the file transfer.
100 * @privilege %http://tizen.org/privilege/bluetooth.opp
102 * @return An error code
103 * @exception E_SUCCESS The method is successful.
104 * @exception E_INVALID_STATE This instance is in an invalid state. @n
105 * For example, this instance has not been constructed as yet or %Bluetooth is
107 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified
109 * For example, the service is not started yet or a push request is not
110 * received from a remote device.
111 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
112 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
113 * @exception E_FAILURE The method has failed.
114 * @see IBluetoothOppClientEventListener::OnOppPushResponded()
116 result AcceptPush(void);
119 * Rejects a push request from a remote OPP client.
123 * @privilege %http://tizen.org/privilege/bluetooth.opp
125 * @return An error code
126 * @exception E_SUCCESS The method is successful.
127 * @exception E_INVALID_STATE This instance is in an invalid state. @n
128 * For example, this instance has not been constructed as yet or %Bluetooth is
130 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified
132 * For example, the service is not started yet or a push request is not
133 * received from a remote device.
134 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
135 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
136 * @exception E_FAILURE The method has failed.
137 * @see IBluetoothOppClientEventListener::OnOppPushResponded()
139 result RejectPush(void);
142 * Sets the destination path of the file to be received.
145 * @brief <i> [Compatibility] </i>
149 * @compatibility This method has compatibility issues. @n
150 * For more information, see @ref CompIoPathPage "here".
153 * @return An error code
154 * @param[in] dstPath The new destination file path
155 * @exception E_SUCCESS The method is successful.
156 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified
158 * For example, trying to change the path on Push transition is prohibited.
159 * @exception E_INACCESSIBLE_PATH The specified @c dstPath is inaccessible.
160 * @exception E_FAILURE The method has failed.
162 result SetDestinationPath(const Tizen::Base::String& dstPath);
165 * Starts the OPP service and associates a listener with it.
168 * @brief <i> [Compatibility] </i>
172 * @compatibility This method has compatibility issues. @n
173 * For more information, see @ref CompIoPathPage "here".
176 * @privilege %http://tizen.org/privilege/bluetooth.opp
178 * @return An error code
179 * @param[in] dstPath The new destination file path
180 * @exception E_SUCCESS The method is successful.
181 * @exception E_INVALID_STATE This instance is in an invalid state. @n
182 * For example, %Bluetooth is not activated.
183 * @exception E_IN_PROGRESS The service has already started.
184 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
185 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
186 * @exception E_SERVICE_UNAVAILABLE The OPP service is unavailable.
187 * @exception E_INACCESSIBLE_PATH The specified @c dstPath is inaccessible.
188 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified
190 * For example, The stop process is in progress.
191 * @exception E_FAILURE The method has failed.
193 result StartService(const Tizen::Base::String& dstPath);
196 * Stops the OPP service. @n
197 * The %StopService() method cancels the file transfer before stopping the service.
201 * @privilege %http://tizen.org/privilege/bluetooth.opp
203 * @return An error code
204 * @exception E_SUCCESS The method is successful.
205 * @exception E_INVALID_STATE This instance is in an invalid state. @n
206 * For example, %Bluetooth is not activated.
207 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified
209 * For example, the service is not started as yet.
210 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
211 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
212 * @exception E_IN_PROGRESS The stop process is in progress.
213 * @exception E_FAILURE The method has failed.
215 result StopService(void);
218 * Stops the file transfer in progress which was started by the client. @n
219 * If the %StopTransfer() method is called during the file transfer, the IBluetoothOppServerEventListener::OnOppTransferDone()
220 * method is called with @c isCompleted as @c false.
224 * @privilege %http://tizen.org/privilege/bluetooth.opp
226 * @return An error code
227 * @exception E_SUCCESS The method is successful.
228 * @exception E_INVALID_STATE This instance is in an invalid state. @n
229 * For example, %Bluetooth is not activated.
230 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified
232 * For example, the file transfer is not in progress.
233 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
234 * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
235 * @exception E_OPERATION_FAILED The operation has failed.
237 result StopTransfer(void);
240 * Sets the minimum interval of invocation of IBluetoothOppServerEventListener::OnOppTransferInProgress() in
242 * The default value is @c 5.
246 * @return An error code
247 * @param[in] percent The minimum period of progress interval as a percentage value
248 * @exception E_SUCCESS The method is successful.
249 * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method.
250 * @see IBluetoothOppServerEventListener::OnOppTransferInProgress()
252 result SetMinProgressInterval(int percent);
256 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying
259 BluetoothOppServer(const BluetoothOppServer& value);
262 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit
263 // copying of objects.
265 BluetoothOppServer& operator =(const BluetoothOppServer& value);
268 _BluetoothOppServerImpl* __pImpl;
270 }; // BluetoothOppServer
273 #endif // _FNET_BT_BLUETOOTH_OPP_SERVER_H_