initial commit Base app, core lib, plugin system

This commit is contained in:
Zdenek Jonak
2015-10-28 19:21:55 +01:00
commit 53d56f2e13
30 changed files with 1004 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
#ifndef IPLUGIN_H
#define IPLUGIN_H
#include <QString>
#include <QWidget>
#include <QtPlugin>
#include "service.h"
class IPlugin
{
public:
IPlugin() {
m_ui = NULL;
}
virtual ~IPlugin() { }
virtual QString pluginName() = 0;
virtual QString pluginId() = 0;
virtual void init() = 0;
virtual QWidget *ui() {
return m_ui;
}
template<class T>
Service<T> *service() {
(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