summaryrefslogtreecommitdiff
path: root/src/plugins/pluginloader.h
blob: 319e985a2534126017d13f6adc26b50d57796175 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ============================================================
 *     The rekonq project
 * ============================================================
 * SPDX-License-Identifier: GPL-3.0-only
 * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
 * ============================================================
 * Description: rekonq plugin loader
 * ============================================================ */

#pragma once

#include "rplugininterface.hpp"
#include <QPluginLoader>

class PluginLoader : public QPluginLoader {

public:
  explicit PluginLoader(const QString &path, QObject *parent = nullptr);

  [[nodiscard]] auto schemes() const { return m_schemes; }
  [[nodiscard]] bool hasScheme(const QString &scheme) const { return m_schemes.contains(scheme); }

  [[nodiscard]] RekonqPluginInterface *interface() { return qobject_cast<RekonqPluginInterface *>(instance()); }

private:
  QStringList m_schemes;
};