update header for Doxygen
[framework/osp/bluetooth.git] / inc / FNetBtBluetoothOppServer.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 /**
19  * @file        FNetBtBluetoothOppServer.h
20  * @brief       This is the header file for the %BluetoothOppServer class.
21  *
22  * This header file contains the declarations of the %BluetoothOppServer class.
23  */
24 #ifndef _FNET_BT_BLUETOOTH_OPP_SERVER_H_
25 #define _FNET_BT_BLUETOOTH_OPP_SERVER_H_
26
27 #include <FBaseObject.h>
28 #include <FBaseResult.h>
29
30 namespace Tizen { namespace Base
31 {
32 class String;
33 } }
34
35 namespace Tizen { namespace Net { namespace Bluetooth
36 {
37
38 // forward declarations
39 class IBluetoothOppServerEventListener;
40 class _BluetoothOppServerImpl;
41
42 /**
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.
46  *
47  * @since    2.0
48  *
49  * The %BluetoothOppServer class provides methods to handle the %Bluetooth Object Push Profile (OPP) server, such as the incoming
50  * connection requests.
51  *
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>.
54  */
55 class _OSP_EXPORT_ BluetoothOppServer
56         : public Tizen::Base::Object
57 {
58 public:
59         /**
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.
62          *
63          * @since       2.0
64          */
65         BluetoothOppServer(void);
66
67         /**
68          * This destructor overrides Tizen::Base::Object::~Object().
69          *
70          * @since       2.0
71          */
72         virtual ~BluetoothOppServer(void);
73
74         /**
75          * Constructs and initializes this instance of %BluetoothOppServer with the specified listener.
76          *
77          * @since       2.0
78          * @feature     %http://tizen.org/feature/network.bluetooth
79          *
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
90          *                      Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
91          */
92         result Construct(IBluetoothOppServerEventListener& listener);
93
94         /**
95          * Accepts a push request from a remote OPP client. @n
96          * The %AcceptPush() method starts the file transfer.
97          *
98          * @since       2.0
99          * @privlevel   public
100          * @privilege   %http://tizen.org/privilege/bluetooth.opp
101          *
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
106          *                                      not activated.
107          * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of the specified
108          *                                      operation. @n
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()
115          */
116         result AcceptPush(void);
117
118         /**
119          * Rejects a push request from a remote OPP client.
120          *
121          * @since       2.0
122          * @privlevel   public
123          * @privilege   %http://tizen.org/privilege/bluetooth.opp
124          *
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
129          *                                      not activated.
130          * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of the specified
131          *                                      operation. @n
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()
138          */
139         result RejectPush(void);
140
141         /**
142          * Sets the destination path of the file to be received.
143          *
144          * @if OSPCOMPAT
145          * @brief <i> [Compatibility] </i>
146          * @endif
147          * @since       2.0
148          * @if OSPCOMPAT
149          * @compatibility   This method has compatibility issues. @n
150          *                  For more information, see @ref CompIoPathPage "here".
151          *
152          * @endif
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
157          *                                      operation. @n
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.
161          */
162         result SetDestinationPath(const Tizen::Base::String& dstPath);
163
164         /**
165          * Starts the OPP service and associates a listener with it.
166          *
167          * @if OSPCOMPAT
168          * @brief <i> [Compatibility] </i>
169          * @endif
170          * @since       2.0
171          * @if OSPCOMPAT
172          * @compatibility   This method has compatibility issues. @n
173          *                  For more information, see @ref CompIoPathPage "here".
174          * @endif
175          * @privlevel   public
176          * @privilege   %http://tizen.org/privilege/bluetooth.opp
177          *
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
189          *                                      operation. @n
190          *                                      For example, The stop process is in progress.
191          * @exception   E_FAILURE               The method has failed.
192          */
193         result StartService(const Tizen::Base::String& dstPath);
194
195         /**
196          * Stops the OPP service. @n
197          * The %StopService() method cancels the file transfer before stopping the service.
198          *
199          * @since       2.0
200          * @privlevel   public
201          * @privilege   %http://tizen.org/privilege/bluetooth.opp
202          *
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
208          *                                      operation. @n
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.
214          */
215         result StopService(void);
216
217         /**
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.
221          *
222          * @since 2.0
223          * @privlevel   public
224          * @privilege   %http://tizen.org/privilege/bluetooth.opp
225          *
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
231          *                                      operation. @n
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.
236          */
237         result StopTransfer(void);
238
239         /**
240          * Sets the minimum interval of invocation of IBluetoothOppServerEventListener::OnOppTransferInProgress() in
241          * percentage. @n
242          * The default value is @c 5.
243          *
244          * @since       2.0
245          *
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()
251          */
252         result SetMinProgressInterval(int percent);
253
254 private:
255         //
256         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying
257         // of objects.
258         //
259         BluetoothOppServer(const BluetoothOppServer& value);
260
261         //
262         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit
263         // copying of objects.
264         //
265         BluetoothOppServer& operator =(const BluetoothOppServer& value);
266
267 private:
268         _BluetoothOppServerImpl* __pImpl;
269
270 }; // BluetoothOppServer
271
272 } } }
273 #endif // _FNET_BT_BLUETOOTH_OPP_SERVER_H_