BluezQt

obexfiletransfer.h
1 /*
2  * BluezQt - Asynchronous BlueZ wrapper library
3  *
4  * SPDX-FileCopyrightText: 2014-2015 David Rosca <[email protected]>
5  *
6  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7  */
8 
9 #ifndef BLUEZQT_OBEXFILETRANSFER_H
10 #define BLUEZQT_OBEXFILETRANSFER_H
11 
12 #include <QObject>
13 
14 #include "bluezqt_export.h"
15 #include "obexfiletransferentry.h"
16 
17 class QDBusObjectPath;
18 
19 namespace BluezQt
20 {
21 class PendingCall;
22 
23 /**
24  * @class BluezQt::ObexFileTransfer obexfiletransfer.h <BluezQt/ObexFileTransfer>
25  *
26  * OBEX file transfer.
27  *
28  * This class represents an OBEX file transfer interface.
29  */
30 class BLUEZQT_EXPORT ObexFileTransfer : public QObject
31 {
32  Q_OBJECT
33 
34 public:
35  /**
36  * Creates a new ObexFileTransfer object.
37  *
38  * This class will be typically used with a @p path
39  * from result of ObexManager::createSession().
40  *
41  * @param path path of session
42  * @param parent
43  */
44  explicit ObexFileTransfer(const QDBusObjectPath &path, QObject *parent = nullptr);
45 
46  /**
47  * Destroys an ObexFileTransfer object.
48  */
49  ~ObexFileTransfer() override;
50 
51  /**
52  * D-Bus object path of the file transfer session.
53  *
54  * @return object path of session
55  */
56  QDBusObjectPath objectPath() const;
57 
58  /**
59  * Changes the current folder.
60  *
61  * Possible errors: PendingCall::InvalidArguments, PendingCall::Failed
62  *
63  * @param folder folder to be changed
64  * @return void pending call
65  */
66  PendingCall *changeFolder(const QString &folder);
67 
68  /**
69  * Creates a new folder.
70  *
71  * Possible errors: PendingCall::InvalidArguments, PendingCall::Failed
72  *
73  * @param folder name of new folder
74  * @return void pending call
75  */
76  PendingCall *createFolder(const QString &folder);
77 
78  /**
79  * Lists a current folder.
80  *
81  * Possible errors: PendingCall::Failed
82  *
83  * @return QList<ObexFileTransferEntry> pending call
84  */
85  PendingCall *listFolder();
86 
87  /**
88  * Gets the file from the remote device.
89  *
90  * If an empty @p targetFileName is given, a name will be
91  * automatically calculated for the temporary file.
92  *
93  * Possible errors: PendingCall::InvalidArguments, PendingCall::Failed
94  *
95  * @param targetFileName full local path where the file will be saved
96  * @param sourceFileName file within the remote device
97  * @return ObexTransferPtr pending call
98  */
99  PendingCall *getFile(const QString &targetFileName, const QString &sourceFileName);
100 
101  /**
102  * Puts the file to the remote device.
103  *
104  * If an empty @p targetFileName is given, a name will be
105  * automatically calculated for the temporary file.
106  *
107  * Possible errors: PendingCall::InvalidArguments, PendingCall::Failed
108  *
109  * @param sourceFileName full path of the local file
110  * @param targetFileName file to be saved within the remote device
111  * @return ObexTransferPtr pending call
112  */
113  PendingCall *putFile(const QString &sourceFileName, const QString &targetFileName);
114 
115  /**
116  * Copies a file within the remote device.
117  *
118  * Possible errors: PendingCall::InvalidArguments, PendingCall::Failed
119  *
120  * @param sourceFileName source within the remote device
121  * @param targetFileName target file within the remote device
122  * @return void pending call
123  */
124  PendingCall *copyFile(const QString &sourceFileName, const QString &targetFileName);
125 
126  /**
127  * Moves a file within the remote device.
128  *
129  * Possible errors: PendingCall::InvalidArguments, PendingCall::Failed
130  *
131  * @param sourceFileName source file within the remote device
132  * @param targetFileName target file within the remote device
133  * @return void pending call
134  */
135  PendingCall *moveFile(const QString &sourceFileName, const QString &targetFileName);
136 
137  /**
138  * Deletes a file/folder within the remote device.
139  *
140  * Possible errors: PendingCall::InvalidArguments, PendingCall::Failed
141  *
142  * @param fileName file within the remote device
143  * @return void pending call
144  */
145  PendingCall *deleteFile(const QString &fileName);
146 
147 private:
148  class ObexFileTransferPrivate *const d;
149 
150  friend class ObexFileTransferPrivate;
151 };
152 
153 } // namespace BluezQt
154 
155 #endif // BLUEZQT_OBEXFILETRANSFER_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Sep 25 2022 04:19:10 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.