|
Computer Assited Medical Intervention Tool Kit
version 5.0
|
|
Go to the documentation of this file.
27 #ifndef EXTENSIONS_MANAGER_H
28 #define EXTENSIONS_MANAGER_H
39 #include <QPluginLoader>
40 #include <QStringList>
58 class CAMITK_API ExtensionManager :
public QObject {
73 static void autoload();
87 static void autoload(ExtensionType type);
96 static bool loadExtension(ExtensionType type, QString file);
114 static QString getInstallationString(QString file,
const QString& globalInstallDir,
const QString& userInstallDir,
const QString& currentWorkingDir);
134 static const QList<ComponentExtension*> getComponentExtensionsList();
151 static const QList<ComponentExtension*> getDataDirectoryComponentsList();
154 static QStringList getFileExtensions();
157 static QStringList getDataDirectoryExtNames();
163 static void registerFileExtension(QString fileExtension);
168 static bool unloadComponentExtension(QString);
176 static void unloadAllActionExtensions();
188 static const QList<ActionExtension*> getActionExtensionsList();
203 static bool unloadActionExtension(QString);
210 static void unloadAllViewerExtensions();
222 static const QList<ViewerExtension*> getViewerExtensionsList();
237 static bool unloadViewerExtension(QString);
248 static QMap<QString, ComponentExtension*>& getComponentExtensionMap();
257 static QMap<QString, ComponentExtension*>& getDataDirectoryComponentExtensionMap();
266 static QMap<QString, ActionExtension*>& getActionExtensionMap();
275 static QMap<QString, ViewerExtension*>& getViewerExtensionMap();
278 static QStringList getExtensionFilter();
281 static QStringList getPluginFileNames(QDir);
291 static void initPrivateLibDirs();
298 static void addLibraryPath(QDir potentialPath, QString potentialLibDir);
343 #endif //EXTENSIONS_MANAGER_H
static QStringList getExtensionFilter()
return the extensions file filter
Definition: ExtensionManager.cpp:598
static const char * shortVersion
short version string (all in lower case, without the patch number)
Definition: Core.h:210
static const QString getGlobalInstallDir()
get the CAMITK_DIR (where camitk-config is installed)
Definition: Core.cpp:376
static bool unloadViewerExtension(QString)
Unload an viewer extension using its .dll/.so/.dylib filename.
Definition: ExtensionManager.cpp:549
static QMap< QString, ViewerExtension * > & getViewerExtensionMap()
get the singleton map of loaded viewer plugins (the key is the shared object/dll/dylib filename) This...
Definition: ExtensionManager.cpp:520
static void initPrivateLibDirs()
Add the private library directories (lib/camitk-version) in the current session PATH:
Definition: ExtensionManager.cpp:741
static bool actionExtensionLessThan(ActionExtension *left, ActionExtension *right)
Custom comparaison method between two ActionExtension* This method uses the QString::<() (less than o...
Definition: ExtensionManager.cpp:774
static QMap< QString, ActionExtension * > & getActionExtensionMap()
get the singleton map of loaded action plugins (the key is the shared object/dll/dylib filename) This...
Definition: ExtensionManager.cpp:491
static bool unloadComponentExtension(QString)
Unload a plugin corresponding to a given extension or component name.
Definition: ExtensionManager.cpp:661
static void addLibraryPath(QDir potentialPath, QString potentialLibDir)
check if the given directory contains an extension repository and if it does update PATH (on windows)...
Definition: ExtensionManager.cpp:714
static QSettings & getSettings()
Get the Core wide settings.
Definition: Application.cpp:309
static QStringList getFileExtensions()
get the list of all the suffixes managed by registered component extensions (all possible file suffix...
Definition: ExtensionManager.cpp:480
static void autoload()
Autoload component and action extensions.
Definition: ExtensionManager.cpp:68
This class describes what is a generic Component extension. To add a ComponentExtension to CamiTK cor...
Definition: ComponentExtension.h:83
static const char * libDir
library folder set depending on the compiler and environement choice (it could be lib/ or lib64/ on L...
Definition: Core.h:222
static void unloadAllViewerExtensions()
unload all viewer extensions and delete instantiated actions
Definition: ExtensionManager.cpp:527
static int registerAllViewers(ViewerExtension *)
register all viewers from the given ViewerExtension
Definition: Application.cpp:918
static int unregisterAllActions(ActionExtension *)
unregister all actions from the given ActionExtension
Definition: Application.cpp:766
#define CAMITK_TRACE_ALT(MSG)
Definition: Log.h:257
static bool loadExtension(ExtensionType type, QString file)
Load a specific extension from a file.
Definition: ExtensionManager.cpp:216
static bool unloadActionExtension(QString)
Unload an action extension using its .dll/.so/.dylib filename.
Definition: ExtensionManager.cpp:643
static const QStringList getViewerDirectories()
get all the viewers directories.
Definition: Core.cpp:356
static const char * soVersion
version used for so name
Definition: Core.h:212
static ComponentExtension * getComponentExtension(QString)
get the plugin corresponding to a given extension or name.
Definition: ExtensionManager.cpp:440
static const QString getCurrentWorkingDir()
get the current working directory (during dev, this should be the build directory,...
Definition: Core.cpp:423
static bool componentExtensionLessThan(const ComponentExtension *left, const ComponentExtension *right)
Custom comparaison method between two ComponentExtension* This method uses the QString::<() (less tha...
Definition: ExtensionManager.cpp:769
static ComponentExtension * getDataDirectoryComponentExtension(QString)
get the plugin corresponding to a given data directory component extension's name.
Definition: ExtensionManager.cpp:428
static QStringList getPluginFileNames(QDir)
return the list of shared objects in a directory considering debug/release on MSVC
Definition: ExtensionManager.cpp:615
static const QList< ViewerExtension * > getViewerExtensionsList()
Get the list of registered ViewerExtension.
Definition: ExtensionManager.cpp:536
ExtensionType
Definition: ExtensionManager.h:111
static const QString getUserInstallDir()
get the user config directory (this is the local installation directory)
Definition: Core.cpp:417
static const bool isDebugBuild()
Definition: Core.cpp:452
static const char * debugPostfix
debug postfix used on MSVC to distinguished between release and debug version
Definition: Core.h:214
static const QList< ComponentExtension * > getComponentExtensionsList()
Get the list of registered ComponentExtension.
Definition: ExtensionManager.cpp:464
static QStringList getDataDirectoryExtNames()
get the list of all the name of the registered Component data directory
Definition: ExtensionManager.cpp:485
@ COMPONENT
Component extensions: manages the data logic.
Definition: ExtensionManager.h:113
static const QStringList getComponentDirectories()
get all the component directories.
Definition: Core.cpp:351
static const QList< ComponentExtension * > getDataDirectoryComponentsList()
Get the list of registered ComponentExtension working on directory.
Definition: ExtensionManager.cpp:472
This class describes what is a generic Action extension. To add a ActionExtension to CamiTK core,...
Definition: ActionExtension.h:80
static ActionExtension * getActionExtension(QString)
Get the ActionExtension corresponding to the given shared library file.
Definition: ExtensionManager.cpp:506
static int registerAllActions(ActionExtension *)
register all actions from the given ActionExtension
Definition: Application.cpp:742
@ ACTION
Action extensions: manages the processing logic.
Definition: ExtensionManager.h:112
#define CAMITK_INFO_ALT(MSG)
Definition: Log.h:262
static QMap< QString, ComponentExtension * > & getDataDirectoryComponentExtensionMap()
get the singleton map of loaded component plugins for data directory (the key is the name) This is th...
Definition: ExtensionManager.cpp:433
#define CAMITK_ERROR_ALT(MSG)
Definition: Log.h:277
static ViewerExtension * getViewerExtension(QString)
Get the Viewer Extension corresponding to the given shared library file.
Definition: ExtensionManager.cpp:544
static bool viewerExtensionLessThan(ViewerExtension *left, ViewerExtension *right)
Custom comparaison method between two ViewerExtension* based on the same principle as actionExtension...
Definition: ExtensionManager.cpp:779
static QString getInstallationString(QString file, const QString &globalInstallDir, const QString &userInstallDir, const QString ¤tWorkingDir)
Returns a three char string that corresponds to the installation directory of a given shared library.
Definition: ExtensionManager.cpp:363
static void unloadAllActionExtensions()
unload all action extensions and delete instantiated actions
Definition: ExtensionManager.cpp:511
This class describes what is a generic Action extension. To add a ActionExtension to CamiTK core,...
Definition: ViewerExtension.h:108
static const QList< ActionExtension * > getActionExtensionsList()
Get the list of registered ActionExtension.
Definition: ExtensionManager.cpp:498
@ VIEWER
Viewer extensions: manages the presentation and user interaction logic.
Definition: ExtensionManager.h:115
static void registerFileExtension(QString fileExtension)
Register the file extension with the current application for opening This function is called by regis...
Definition: ExtensionManager.cpp:567
static const QStringList getActionDirectories()
get all the action directories.
Definition: Core.cpp:346
static int unregisterAllViewers(ViewerExtension *)
unregister all viewers from the given ViewerExtension
Definition: Application.cpp:985
static QMap< QString, ComponentExtension * > & getComponentExtensionMap()
get the singleton map of loaded component plugins for files (the key is the file extension) This is t...
Definition: ExtensionManager.cpp:421
#define CAMITK_API
Definition: CamiTKAPI.h:49
Definition: Action.cpp:35