| 1 | /* |
| 2 | This file is part of the KDE Baloo Project |
| 3 | SPDX-FileCopyrightText: 2013 Vishesh Handa <me@vhanda.in> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 6 | */ |
| 7 | |
| 8 | #ifndef BALOO_FILE_H |
| 9 | #define BALOO_FILE_H |
| 10 | |
| 11 | #include "core_export.h" |
| 12 | #include <KFileMetaData/Properties> |
| 13 | |
| 14 | #include <memory> |
| 15 | |
| 16 | namespace Baloo { |
| 17 | |
| 18 | /*! |
| 19 | * \class Baloo::File |
| 20 | * \inheaderfile Baloo/File |
| 21 | * \inmodule Baloo |
| 22 | * |
| 23 | * \brief Provides access to all File Metadata. |
| 24 | * |
| 25 | * The File class acts as a temporary container for all the file metadata. |
| 26 | */ |
| 27 | class BALOO_CORE_EXPORT File |
| 28 | { |
| 29 | public: |
| 30 | /*! |
| 31 | * |
| 32 | */ |
| 33 | File(); |
| 34 | File(const File& f); |
| 35 | |
| 36 | /*! |
| 37 | * Constructor |
| 38 | * |
| 39 | * \a url the local url of the file |
| 40 | */ |
| 41 | File(const QString& url); |
| 42 | ~File(); |
| 43 | |
| 44 | const File& operator =(const File& f); |
| 45 | |
| 46 | /*! |
| 47 | * The local url of the file |
| 48 | */ |
| 49 | QString path() const; |
| 50 | |
| 51 | /*! |
| 52 | * Gives a variant map of the properties that have been extracted |
| 53 | * from the file by the indexer |
| 54 | */ |
| 55 | KFileMetaData::PropertyMultiMap properties() const; |
| 56 | |
| 57 | /*! |
| 58 | * |
| 59 | */ |
| 60 | QVariant property(KFileMetaData::Property::Property property) const; |
| 61 | |
| 62 | // FIXME: More descriptive error? |
| 63 | /*! |
| 64 | * |
| 65 | */ |
| 66 | bool load(); |
| 67 | |
| 68 | /*! |
| 69 | * |
| 70 | */ |
| 71 | bool load(const QString& url); |
| 72 | |
| 73 | private: |
| 74 | class Private; |
| 75 | std::unique_ptr<Private> const d; |
| 76 | }; |
| 77 | |
| 78 | } |
| 79 | |
| 80 | #endif // BALOO_FILE_H |
| 81 | |