plugin.h 947 Bytes
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
#ifndef _PLUGIN_H_
#define _PLUGIN_H_

#include <QtPlugin>
#include <QAction>

#include <GL/glew.h>

#include "types.h"

namespace CGoGN
{

namespace SCHNApps
{

class Plugin : public QObject
{
	Q_OBJECT

	friend class SCHNApps;

public:
	Plugin() : m_schnapps(NULL)
	{
		glewInit();
	}

	virtual ~Plugin() {}

	const QString& getName() const { return m_name; }

public slots:
	QString getName() { return m_name; }
	const QString& getFilePath() { return m_filePath; }
	SCHNApps* getSCHNApps() { return m_schnapps; }

private:
	void setName(const QString& name) { m_name = name; }
	void setFilePath(const QString& f) { m_filePath = f; }
	void setSCHNApps(SCHNApps* s) { m_schnapps = s; }

	virtual bool enable() = 0;
	virtual void disable() = 0;

protected:
	QString m_name;
	QString m_filePath;
	SCHNApps* m_schnapps;
};

} // namespace SCHNApps

} // namespace CGoGN

Q_DECLARE_INTERFACE(CGoGN::SCHNApps::Plugin, "CGoGN.SCHNapps.Plugin")

#endif