File indexing completed on 2024-04-28 15:17:40

0001 /*
0002     This file is part of the KDE Baloo Project
0003     SPDX-FileCopyrightText: 2013 Vishesh Handa <me@vhanda.in>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef BALOO_FILE_H
0009 #define BALOO_FILE_H
0010 
0011 #include "core_export.h"
0012 #include <KFileMetaData/Properties>
0013 
0014 namespace Baloo {
0015 
0016 /**
0017  * @class File file.h <Baloo/File>
0018  *
0019  * @short Provides access to all File Metadata
0020  *
0021  * The File class acts as a temporary container for all the file metadata.
0022  */
0023 class BALOO_CORE_EXPORT File
0024 {
0025 public:
0026     File();
0027     File(const File& f);
0028 
0029     /**
0030      * Constructor
0031      *
0032      * \p url the local url of the file
0033      */
0034     File(const QString& url);
0035     ~File();
0036 
0037     const File& operator =(const File& f);
0038 
0039     /**
0040      * The local url of the file
0041      */
0042     QString path() const;
0043 
0044     /**
0045      * Gives a variant map of the properties that have been extracted
0046      * from the file by the indexer
0047      */
0048 #if BALOO_CORE_BUILD_DEPRECATED_SINCE(5, 91)
0049     KFileMetaData::PropertyMap properties() const;
0050 #else
0051     KFileMetaData::PropertyMultiMap properties() const;
0052 #endif
0053     QVariant property(KFileMetaData::Property::Property property) const;
0054 
0055     // FIXME: More descriptive error?
0056     bool load();
0057     bool load(const QString& url);
0058 
0059 private:
0060     class Private;
0061     Private* d;
0062 };
0063 
0064 }
0065 
0066 #endif // BALOO_FILE_H