File indexing completed on 2024-04-21 03:51:47
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 #include <memory> 0015 0016 namespace Baloo { 0017 0018 /** 0019 * @class File file.h <Baloo/File> 0020 * 0021 * @short Provides access to all File Metadata 0022 * 0023 * The File class acts as a temporary container for all the file metadata. 0024 */ 0025 class BALOO_CORE_EXPORT File 0026 { 0027 public: 0028 File(); 0029 File(const File& f); 0030 0031 /** 0032 * Constructor 0033 * 0034 * \p url the local url of the file 0035 */ 0036 File(const QString& url); 0037 ~File(); 0038 0039 const File& operator =(const File& f); 0040 0041 /** 0042 * The local url of the file 0043 */ 0044 QString path() const; 0045 0046 /** 0047 * Gives a variant map of the properties that have been extracted 0048 * from the file by the indexer 0049 */ 0050 KFileMetaData::PropertyMultiMap properties() const; 0051 QVariant property(KFileMetaData::Property::Property property) const; 0052 0053 // FIXME: More descriptive error? 0054 bool load(); 0055 bool load(const QString& url); 0056 0057 private: 0058 class Private; 0059 std::unique_ptr<Private> const d; 0060 }; 0061 0062 } 0063 0064 #endif // BALOO_FILE_H