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"
22 * @brief Allows accessing metadata of a file by providing KFileItemModel roles.
24 * Is a helper class for KFileItemModelRolesUpdater to retrieve roles that
25 * are only accessible with Baloo.
27 class DOLPHIN_EXPORT KBalooRolesProvider
30 static KBalooRolesProvider
& instance();
31 virtual ~KBalooRolesProvider();
34 * @return Roles that can be provided by KBalooRolesProvider.
36 QSet
<QByteArray
> roles() const;
39 * @return Values for the roles \a roles that can be determined from the file
40 * with the URL \a url.
42 QHash
<QByteArray
, QVariant
> roleValues(const Baloo::File
& file
,
43 const QSet
<QByteArray
>& roles
) const;
46 KBalooRolesProvider();
49 QSet
<QByteArray
> m_roles
;
51 friend struct KBalooRolesProviderSingleton
;