logplus/HPluginManage/HPluginManage.h
2025-10-29 17:23:30 +08:00

60 lines
1.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef HPLUGINMANAGE_H
#define HPLUGINMANAGE_H
#include <QObject>
#include <QMap>
#include <QPluginLoader>
#include <QList>
#include <QMetaObject>
#include "HPluginInterface.h"
#include "HPluginManageExport.h"
class QPluginLoader;
class HPLUGINMANAGE_EXPORT HPluginManage : public QObject
{
Q_OBJECT
private:
explicit HPluginManage();
~HPluginManage();
public:
static HPluginManage* getInstance();
/**
* @brief getPluginList: 获取插件信息列表
* @return 返回插件信息列表
*/
std::list<HPLUGIN_INFO *> getPluginList();
private:
/**
* @brief loadPlugin 加载工具功能插件接口
* @return true表示加载插件成功false表示加载插件失败
*/
bool loadPlugin(QString path);
/**
* @brief unloadPlugin : 卸载插件
* @return true表示卸载成功false表示卸载失败
*/
bool unloadPlugin();
QList<QString> scan(QString filePath);
private:
//存储所有控件插件的Hash表.
QMap<QString, HPluginInterface *> m_PluginMap;
//所有插件对象Hash链表.
QList<QPluginLoader *> m_pluHash;
std::list<HPLUGIN_INFO *> m_PluInfoList;
public:
Q_DISABLE_COPY(HPluginManage)
};
#endif // HPLUGINMANAGE_H