2016-06-16 16:56:21 +08:00
|
|
|
#ifndef DOCKPLUGINSCONTROLLER_H
|
|
|
|
#define DOCKPLUGINSCONTROLLER_H
|
|
|
|
|
2016-06-23 16:43:22 +08:00
|
|
|
#include "item/pluginsitem.h"
|
2016-06-24 11:32:25 +08:00
|
|
|
#include "pluginproxyinterface.h"
|
2016-06-23 16:43:22 +08:00
|
|
|
|
2016-06-16 16:56:21 +08:00
|
|
|
#include <QPluginLoader>
|
|
|
|
#include <QList>
|
2016-06-28 10:06:04 +08:00
|
|
|
#include <QMap>
|
2016-06-16 16:56:21 +08:00
|
|
|
|
2016-06-23 16:43:22 +08:00
|
|
|
class DockItemController;
|
2016-06-16 16:56:21 +08:00
|
|
|
class PluginsItemInterface;
|
2016-06-24 11:32:25 +08:00
|
|
|
class DockPluginsController : public QObject, PluginProxyInterface
|
2016-06-16 16:56:21 +08:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-06-23 16:43:22 +08:00
|
|
|
explicit DockPluginsController(DockItemController *itemControllerInter = 0);
|
2016-06-16 16:56:21 +08:00
|
|
|
~DockPluginsController();
|
|
|
|
|
2016-06-27 14:33:21 +08:00
|
|
|
// implements PluginProxyInterface
|
2016-06-24 11:32:25 +08:00
|
|
|
void itemAdded(PluginsItemInterface * const itemInter, const QString &itemKey);
|
2016-06-28 10:06:04 +08:00
|
|
|
void itemUpdate(PluginsItemInterface * const itemInter, const QString &itemKey);
|
2016-06-27 14:33:21 +08:00
|
|
|
|
2016-06-16 16:56:21 +08:00
|
|
|
signals:
|
2016-06-24 11:32:25 +08:00
|
|
|
void pluginItemInserted(PluginsItem *pluginsItem) const;
|
2016-06-16 16:56:21 +08:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void loadPlugins();
|
2016-06-28 10:06:04 +08:00
|
|
|
void displayModeChanged();
|
|
|
|
void positionChanged();
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool eventFilter(QObject *o, QEvent *e);
|
|
|
|
PluginsItem *pluginItemAt(PluginsItemInterface * const itemInter, const QString &itemKey) const;
|
2016-06-16 16:56:21 +08:00
|
|
|
|
|
|
|
private:
|
2016-06-24 11:32:25 +08:00
|
|
|
// QList<PluginsItemInterface *> m_pluginsInterfaceList;
|
|
|
|
// QList<QPluginLoader *> m_pluginLoaderList;
|
2016-06-28 10:06:04 +08:00
|
|
|
QMap<PluginsItemInterface *, QMap<QString, PluginsItem *>> m_pluginList;
|
2016-06-23 16:43:22 +08:00
|
|
|
DockItemController *m_itemControllerInter;
|
2016-06-16 16:56:21 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DOCKPLUGINSCONTROLLER_H
|