20 #ifndef TULIP_PLUGIN_H
21 #define TULIP_PLUGIN_H
25 #include <tulip/WithParameter.h>
26 #include <tulip/WithDependency.h>
27 #include <tulip/PluginContext.h>
28 #include <tulip/TulipRelease.h>
48 TLP_SCOPE std::string
getMajor(
const std::string &release);
59 TLP_SCOPE std::string
getMinor(
const std::string &release);
86 class TLP_SCOPE
Plugin :
public tlp::WithParameter,
public tlp::WithDependency {
94 virtual std::string
icon()
const;
108 virtual std::string
name()
const = 0;
116 virtual std::string
group()
const = 0;
129 virtual std::string
date()
const = 0;
138 virtual std::string
info()
const = 0;
187 virtual int id()
const;
205 return !oldName.empty() ? oldName : std::string();
234 #define PLUGININFORMATION(NAME, AUTHOR, DATE, INFO, RELEASE, GROUP) \
235 std::string name() const override { \
238 std::string author() const override { \
241 std::string date() const override { \
244 std::string info() const override { \
247 std::string release() const override { \
250 std::string tulipRelease() const override { \
251 return TULIP_VERSION; \
253 std::string group() const override { \
266 class TLP_SCOPE PluginFactory {
269 static void registerFactory(PluginFactory *);
270 virtual ~PluginFactory() {}
299 class C##Factory : public tlp::PluginFactory { \
302 registerFactory(this); \
305 tlp::Plugin *createPluginObject(tlp::PluginContext *context) { \
306 C *tmp = new C(context); \
312 C##Factory C##FactoryInitializer; \
Contains runtime parameters for a plugin.
Top-level interface for plug-ins.
virtual std::string major() const
Only the major of the plug-in version. A version should be X.Y, X being the major.
virtual std::string name() const =0
Returns the name of the plug-in, as registered in the Tulip plug-in system. This name must be unique,...
virtual std::string tulipRelease() const =0
The version of Tulip this plug-in was built with. Tulip versions are X.Y.Z, X being the major,...
virtual std::string tulipMajor() const
virtual int id() const
Returns the ID of the glyph this factory builds. @TODO this member should be removed once there is a ...
virtual std::string group() const =0
Returns the name of the group this plug-in belongs to. Groups and sub-groups are separated by two col...
virtual std::string release() const =0
The release version of the plug-in, including major and minor. The version should be X....
virtual std::string info() const =0
Information about the plug-in, from the plug-in author. This information can contains anything,...
virtual std::string icon() const
The icon (preferably a thumbnail) of the plugin.
void declareDeprecatedName(const std::string &oldName)
Allow to declare the previous name of a plugin as deprecated in order to keep an ascending compatibil...
virtual std::string date() const =0
The creation date of the plug-in. This date is in a free format, but most Tulip plug-ins use a DD/MM/...
virtual std::string minor() const
Only the minor of the plug-in version. A version should be X.Y, Y being the major.
virtual std::string programmingLanguage() const
virtual std::string tulipMinor() const
virtual std::string category() const =0
A string identifier for a plugin used for categorization purposes.
std::string deprecatedName()
virtual std::string author() const =0
The name of the author of this plug-in.
std::string getMajor(const std::string &release)
Splits the string and returns everything before the first dot ('.'). This is used to return major ver...
std::string getMinor(const std::string &release)
Splits the string and return the minor version. If the string does not contain any dot,...