You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
705 B
C++

#ifndef IPLUGIN_H
#define IPLUGIN_H
#include <QString>
#include <QWidget>
#include <QtPlugin>
#include <QJsonObject>
#include "service.h"
class IPlugin
{
public:
IPlugin() {
m_ui = NULL;
}
virtual ~IPlugin() { }
virtual QString pluginName() = 0;
virtual QString pluginId() = 0;
virtual void init(const QJsonObject &metaData) = 0;
virtual QWidget *ui() {
return m_ui;
}
template<class T>
Service<T> *service() {
return (Service<T>*)m_service;
}
protected:
QWidget *m_ui;
void *m_service;
};
#define PluginInterface_iid "cz.itsolved.prodejna.IPlugin"
Q_DECLARE_INTERFACE(IPlugin, PluginInterface_iid)
#endif // IPLUGIN_H