File indexing completed on 2024-12-08 12:15:36

0001 /*
0002  * BluezQt - Asynchronous BlueZ wrapper library
0003  *
0004  * SPDX-FileCopyrightText: 2015 David Rosca <nowrep@gmail.com>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #ifndef BLUEZQT_OBEXFILETRANSFERENTRY_H
0010 #define BLUEZQT_OBEXFILETRANSFERENTRY_H
0011 
0012 #include <QSharedPointer>
0013 #include <QString>
0014 
0015 #include "bluezqt_export.h"
0016 
0017 namespace BluezQt
0018 {
0019 /**
0020  * @class BluezQt::ObexFileTransferEntry obexfiletransferentry.h <BluezQt/ObexFileTransferEntry>
0021  *
0022  * OBEX file transfer entry.
0023  *
0024  * This class represents an entry in remote file system.
0025  */
0026 class BLUEZQT_EXPORT ObexFileTransferEntry
0027 {
0028 public:
0029     /** Type of entry. */
0030     enum Type {
0031         /** Indicates that the entry is a file. */
0032         File,
0033         /** Indicates that the entry is a folder. */
0034         Folder,
0035         /** Indicates that the entry is invalid. */
0036         Invalid,
0037     };
0038 
0039     /**
0040      * Creates a new invalid ObexFileTransferEntry object.
0041      */
0042     explicit ObexFileTransferEntry();
0043 
0044     /**
0045      * Destroys an ObexFileTransferEntry object.
0046      */
0047     virtual ~ObexFileTransferEntry();
0048 
0049     /**
0050      * Copy constructor.
0051      *
0052      * @param other
0053      */
0054     ObexFileTransferEntry(const ObexFileTransferEntry &other);
0055 
0056     /**
0057      * Copy assignment operator.
0058      *
0059      * @param other
0060      */
0061     ObexFileTransferEntry &operator=(const ObexFileTransferEntry &other);
0062 
0063     /**
0064      * Returns whether the entry is valid.
0065      *
0066      * This only checks if type() != Invalid.
0067      *
0068      * @return true if entry is valid
0069      */
0070     bool isValid() const;
0071 
0072     /**
0073      * Returns a name of the entry.
0074      *
0075      * @return name of entry
0076      */
0077     QString name() const;
0078 
0079     /**
0080      * Returns a label of the entry.
0081      *
0082      * @return label of entry
0083      */
0084     QString label() const;
0085 
0086     /**
0087      * Returns a type of the entry.
0088      *
0089      * Entry can be either a file or folder.
0090      *
0091      * @return type of entry
0092      */
0093     Type type() const;
0094 
0095     /**
0096      * Returns a size of the entry.
0097      *
0098      * Size is a number of items in the folder or file size in bytes.
0099      *
0100      * @return size of entry
0101      */
0102     quint64 size() const;
0103 
0104     /**
0105      * Returns a permissions of the entry.
0106      *
0107      * @return permissions of entry
0108      */
0109     QString permissions() const;
0110 
0111     /**
0112      * Returns a memory type where the entry is stored.
0113      *
0114      * @return memory type
0115      */
0116     QString memoryType() const;
0117 
0118     /**
0119      * Returns a modification time of the entry.
0120      *
0121      * @return modification time of entry
0122      */
0123     QDateTime modificationTime() const;
0124 
0125 private:
0126     BLUEZQT_NO_EXPORT explicit ObexFileTransferEntry(const QVariantMap &properties);
0127 
0128     QSharedPointer<class ObexFileTransferEntryPrivate> d;
0129 
0130     friend class PendingCallPrivate;
0131 };
0132 
0133 } // namespace BluezQt
0134 
0135 Q_DECLARE_METATYPE(BluezQt::ObexFileTransferEntry)
0136 
0137 #endif // BLUEZQT_OBEXFILETRANSFERENTRY_H