Computer Assisted Medical Intervention Tool Kit  version 6.0
Loading...
Searching...
No Matches
ActionExtension.h
Go to the documentation of this file.
1/*****************************************************************************
2 * $CAMITK_LICENCE_BEGIN$
3 *
4 * CamiTK - Computer Assisted Medical Intervention ToolKit
5 * (c) 2001-2025 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
6 *
7 * Visit http://camitk.imag.fr for more information
8 *
9 * This file is part of CamiTK.
10 *
11 * CamiTK is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * CamiTK is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22 *
23 * $CAMITK_LICENCE_END$
24 ****************************************************************************/
25
26#ifndef ACTION_EXTENSION_H
27#define ACTION_EXTENSION_H
28
29#include "CamiTKAPI.h"
30
31// -- QT stuff
32#include <QObject>
33#include <QTranslator>
34
35namespace camitk {
36class Action;
37
38// a bit simplistic, but greatly simply syntax (and explanation)
39// to be used in an ActionExtension register method
40#define registerNewAction(X) registerAction(new X(this))
41
57class CAMITK_API ActionExtension : public QObject {
58
59protected :
62
63public :
65 ~ActionExtension() override;
66
68 virtual QString getName() const = 0;
69
71 virtual QString getDescription() const = 0;
72
74 virtual void init() = 0;
75
77 const ActionList& getActions();
78
80 void setLocation(const QString loc);
81
85 QString getLocation() const;
86
88 void initResources();
89
90protected:
93
96
97private:
100 QString dynamicLibraryFileName;
101
103 QTranslator* translator;
104};
105
106}
107// -------------------- declare the interface for QPluginLoader --------------------
108Q_DECLARE_INTERFACE(camitk::ActionExtension, "TIMC-IMAG. Action Extension/2.1")
109
110
111#endif //ACTION_EXTENSION_H
#define CAMITK_API
Definition CamiTKAPI.h:66
This class describes what is a generic Action extension.
Definition ActionExtension.h:57
ActionList actions
the list of actions
Definition ActionExtension.h:95
QString getLocation() const
get the file path (location of the .dll/.so/.dylib) of this plugin or the file path to the CamiTK ext...
Definition ActionExtension.cpp:65
void registerAction(Action *)
register an action instance
Definition ActionExtension.cpp:92
virtual void init()=0
this method should just call registerNewAction(MyAction) for any MyAction class you need to register ...
void initResources()
Load, for the selected langage (asked to the Application), the associated .qm file.
Definition ActionExtension.cpp:70
virtual QString getDescription() const =0
returns the action extension small description (to be overriden in your ActionExtension)
ActionExtension()
constructor
Definition ActionExtension.cpp:38
const ActionList & getActions()
get the list of actions registered y this extension
Definition ActionExtension.cpp:98
void setLocation(const QString loc)
set the file path (once loaded as a dynamic library)
Definition ActionExtension.cpp:60
virtual QString getName() const =0
returns the action extension name (to be overriden in your ActionExtension)
Action class is an abstract class that enables you to build a action (generally an algorithm that wor...
Definition Action.h:215
Definition Action.cpp:40
QList< Action * > ActionList
A list of Action.
Definition CamiTKAPI.h:170