26#ifndef VIEWER_EXTENSION_H
27#define VIEWER_EXTENSION_H
32#include <QRegularExpression>
43#define registerDefaultViewer(className) setManagedMetaObject(&className::staticMetaObject); \
44 registerViewer(new className(QString(#className).replace(QRegularExpression("([^A-Z\\s])([A-Z])"),"\\1 \\2").replace(QRegularExpression("([A-Z]+)([A-Z][a-z])"),"\\1 \\2")));
47#define registerNewViewer(className, instanceName) setManagedMetaObject(&className::staticMetaObject); \
48 registerViewer(new className(QString(instanceName)))
137 QString dynamicLibraryFileName;
140 QTranslator* translator;
143 const QMetaObject* managedMetaObject;
#define CAMITK_API
Definition CamiTKAPI.h:66
This class describes what is a generic Action extension.
Definition ViewerExtension.h:85
QString getViewerClassName() const
get the class name of the viewer managed by this extension
Definition ViewerExtension.cpp:89
QString getLocation() const
get the file path (location of the .dll/.so/.dylib) of this plugin
Definition ViewerExtension.cpp:84
virtual void init()=0
this method should just call registerNewViewer(MyViewer) for any MyViewer class you need to register ...
virtual QString getDescription() const =0
returns the viewer extension small description (to be overriden in the derived class)
const ViewerList & getViewers()
get the list of viewer instances registered by this extension
Definition ViewerExtension.cpp:167
void initResources()
Load, for the selected langage (asked to the Application), the associated .qm file.
Definition ViewerExtension.cpp:57
bool registerViewer(Viewer *)
register an viewer instance The first call will also register the managed viewer class name in viewer...
Definition ViewerExtension.cpp:107
virtual QString getName() const =0
returns the viewer extension name (to be overriden in the derived class)
ViewerExtension()
constructor
Definition ViewerExtension.cpp:38
void setManagedMetaObject(const QMetaObject *)
The first time this method is called, it sets the static meta object.
Definition ViewerExtension.cpp:99
Viewer * getNewInstance(QString name)
factory: create a new viewer instance and register it
Definition ViewerExtension.cpp:138
ViewerList viewers
the list of viewers
Definition ViewerExtension.h:130
void setLocation(const QString loc)
set the file path (once loaded as a dynamic library) = where this extension was loaded
Definition ViewerExtension.cpp:79
Viewer is an abstract class that is the base class for all viewers.
Definition Viewer.h:182
QList< Viewer * > ViewerList
A list of Viewer.
Definition CamiTKAPI.h:173