From ef69b64492c2fb751d457ca3d4741ee823a01205 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 26 Mar 2009 07:27:41 -0400 Subject: Add PluginBase class for all plugins --- sigencore/plugins/CMakeLists.txt | 2 ++ sigencore/plugins/PluginBase.cpp | 31 ++++++++++++++++++++++++++ sigencore/plugins/PluginBase.h | 48 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 sigencore/plugins/PluginBase.cpp create mode 100644 sigencore/plugins/PluginBase.h (limited to 'sigencore/plugins') diff --git a/sigencore/plugins/CMakeLists.txt b/sigencore/plugins/CMakeLists.txt index d062e31c..c945d964 100644 --- a/sigencore/plugins/CMakeLists.txt +++ b/sigencore/plugins/CMakeLists.txt @@ -3,11 +3,13 @@ project(plugins) set(sigencoreplugins_HEADERS ArenaPlugin.h CanvasPlugin.h + PluginBase.h Global.h ) set(sigencoreplugins_SRCS ArenaPlugin.cpp CanvasPlugin.cpp + PluginBase.cpp ) set(sigencoreplugins_SERVICETYPES sigen_arena.desktop diff --git a/sigencore/plugins/PluginBase.cpp b/sigencore/plugins/PluginBase.cpp new file mode 100644 index 00000000..f53ff2e2 --- /dev/null +++ b/sigencore/plugins/PluginBase.cpp @@ -0,0 +1,31 @@ +/* + * Copyright 2009 Ben Boeckel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +// Header include +#include "PluginBase.h" + +using namespace Sigencore::Plugins; + +PluginBase::PluginBase(QObject* parent, const QVariantList& args) : + QObject(parent) +{ + Q_UNUSED(args) +} + +PluginBase::~PluginBase() +{ +} diff --git a/sigencore/plugins/PluginBase.h b/sigencore/plugins/PluginBase.h new file mode 100644 index 00000000..e19815b7 --- /dev/null +++ b/sigencore/plugins/PluginBase.h @@ -0,0 +1,48 @@ +/* + * Copyright 2009 Ben Boeckel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef SIGENCOREPLUGINS_PLUGINBASE +#define SIGENCOREPLUGINS_PLUGINBASE + +// Sigencore plugin includes +#include "Global.h" + +// Qt includes +#include +#include +#include + +namespace Sigencore +{ +namespace Plugins +{ +class SIGENCOREPLUGINS_EXPORT PluginBase : public QObject +{ + Q_OBJECT + + public: + PluginBase(QObject* parent, const QVariantList& args); + virtual ~PluginBase(); + + virtual QStringList classList() const = 0; + virtual QString description(const QString& name) const = 0; + virtual QIcon icon(const QString& name) = 0; +}; +} +} + +#endif -- cgit