1/*
2 * BluezQt - Asynchronous BlueZ wrapper library
3 *
4 * SPDX-FileCopyrightText: 2015 David Rosca <nowrep@gmail.com>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9#ifndef BLUEZQT_OBEXFILETRANSFERENTRY_H
10#define BLUEZQT_OBEXFILETRANSFERENTRY_H
11
12#include <QSharedPointer>
13#include <QString>
14
15#include "bluezqt_export.h"
16
17namespace BluezQt
18{
19/*!
20 * \inmodule BluezQt
21 * \class BluezQt::ObexFileTransferEntry
22 * \inheaderfile BluezQt/ObexFileTransferEntry
23 * \brief OBEX file transfer entry.
24 *
25 * This class represents an entry in the remote file system.
26 */
27class BLUEZQT_EXPORT ObexFileTransferEntry
28{
29public:
30 /*!
31 * \enum BluezQt::ObexFileTransferEntry::Type
32 * \brief Type of entry.
33 * \value File
34 * Indicates that the entry is a file.
35 * \value Folder
36 * Indicates that the entry is a folder.
37 * \value Invalid
38 * Indicates that the entry is invalid.
39 */
40 enum Type {
41 File,
42 Folder,
43 Invalid,
44 };
45
46 /*!
47 * Creates a new invalid ObexFileTransferEntry object.
48 */
49 explicit ObexFileTransferEntry();
50
51 virtual ~ObexFileTransferEntry();
52
53 /*!
54 * Constructs a new ObexFileTransferEntry object from \a other.
55 */
56 ObexFileTransferEntry(const ObexFileTransferEntry &other);
57
58 /*!
59 * Copies the ObexFileTransferEntry object from \a other.
60 */
61 ObexFileTransferEntry &operator=(const ObexFileTransferEntry &other);
62
63 /*!
64 * Returns whether the entry is valid.
65 *
66 * This only checks if type() != Invalid.
67 */
68 bool isValid() const;
69
70 /*!
71 * Returns the name of the entry.
72 */
73 QString name() const;
74
75 /*!
76 * Returns the label of the entry.
77 */
78 QString label() const;
79
80 /*!
81 * Returns the type of the entry.
82 *
83 * The entry can be either a file or folder.
84 */
85 Type type() const;
86
87 /*!
88 * Returns the size of the entry.
89 *
90 * The size is a number of items in the folder or file size in bytes.
91 */
92 quint64 size() const;
93
94 /*!
95 * Returns the permissions of the entry.
96 */
97 QString permissions() const;
98
99 /*!
100 * Returns memory type where the entry is stored.
101 */
102 QString memoryType() const;
103
104 /*!
105 * Returns the modification time of the entry.
106 */
107 QDateTime modificationTime() const;
108
109private:
110 BLUEZQT_NO_EXPORT explicit ObexFileTransferEntry(const QVariantMap &properties);
111
112 QSharedPointer<class ObexFileTransferEntryPrivate> d;
113
114 friend class PendingCallPrivate;
115};
116
117} // namespace BluezQt
118
119Q_DECLARE_METATYPE(BluezQt::ObexFileTransferEntry)
120
121#endif // BLUEZQT_OBEXFILETRANSFERENTRY_H
122

source code of bluez-qt/src/obexfiletransferentry.h