2 * SPDX-FileCopyrightText: 2012 Peter Penz <peter.penz19@gmail.com>
3 * SPDX-FileCopyrightText: 2013 Vishesh Handa <me@vhanda.in>
5 * SPDX-License-Identifier: GPL-2.0-or-later
8 #ifndef KBALOO_ROLESPROVIDER_H
9 #define KBALOO_ROLESPROVIDER_H
11 #include "dolphin_export.h"
23 * @brief Allows accessing metadata of a file by providing KFileItemModel roles.
25 * Is a helper class for KFileItemModelRolesUpdater to retrieve roles that
26 * are only accessible with Baloo.
28 class DOLPHIN_EXPORT KBalooRolesProvider
31 static KBalooRolesProvider
&instance();
32 virtual ~KBalooRolesProvider();
35 * @return Roles that can be provided by KBalooRolesProvider.
37 QSet
<QByteArray
> roles() const;
40 * @return Values for the roles \a roles that can be determined from the file
41 * with the URL \a url.
43 QHash
<QByteArray
, QVariant
> roleValues(const Baloo::File
&file
, const QSet
<QByteArray
> &roles
) const;
46 KBalooRolesProvider();
49 QSet
<QByteArray
> m_roles
;
51 friend struct KBalooRolesProviderSingleton
;