File indexing completed on 2024-04-28 03:53:00
0001 /* 0002 SPDX-FileCopyrightText: 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> 0003 SPDX-FileCopyrightText: 2002-2003 Daniel Molkentin <molkentin@kde.org> 0004 SPDX-FileCopyrightText: 2006 Matthias Kretz <kretz@kde.org> 0005 SPDX-FileCopyrightText: 2021 Alexander Lohnau <alexander.lohnau@gmx.de> 0006 0007 SPDX-License-Identifier: LGPL-2.0-only 0008 */ 0009 0010 #ifndef KCMODULELOADER_H 0011 #define KCMODULELOADER_H 0012 0013 #include <KPluginMetaData> 0014 #include <kcmodule.h> 0015 0016 #include <memory> 0017 0018 class QWidget; 0019 class QQmlEngine; 0020 0021 /** 0022 * @short Loads a KCModule 0023 * In case the provided metadata points to a KQuickConfigModule, it is wrapped in a KCModule 0024 */ 0025 namespace KCModuleLoader 0026 { 0027 /** 0028 * Loads a @ref KCModule. If loading fails a KCM which displays an error message is returned. 0029 * 0030 * @param metaData KPluginMetaData for loading the plugin 0031 * @param engine QQmlEngine that will be used for KQuickConfigModule classes. 0032 * If none is set, a internal engine will be created and reused for further modules. 0033 * In case your app already has an engine, you should pass it in explicitly 0034 * 0035 * @return a pointer to the loaded @ref KCModule 0036 */ 0037 KCMUTILS_EXPORT KCModule * 0038 loadModule(const KPluginMetaData &metaData, QWidget *parent = nullptr, const QVariantList &args = {}, const std::shared_ptr<QQmlEngine> &engine = {}); 0039 } 0040 0041 #endif // KCMODULELOADER_H