Computer Assisted Medical Intervention Tool Kit  version 6.0
Loading...
Searching...
No Matches
HotPlugActionExtension.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 __HOTPLUG_ACTION_EXTENSION__
27#define __HOTPLUG_ACTION_EXTENSION__
28
29#include "ActionExtension.h"
30
32
33namespace camitk {
34
35class HotPlugAction;
36
45 Q_OBJECT
46
47protected:
49 HotPlugActionExtension(const QString& camitkFilePath);
50
51public:
52 static HotPlugActionExtension* newHotPlugActionExtension(const QString& camitkFilePath, bool forceVerifyOrRebuild);
53
55 ~HotPlugActionExtension() override;
56
58 virtual QString getName() const override;
59
61 virtual QString getDescription() const override;
62
64 virtual QString getProgrammingLanguage() const = 0;
65
68 virtual void init() override;
69
75 virtual bool initActions(int progressMinimum = 0, int progressMaximum = 100) = 0;
76
78 virtual int declaredActionCount() const;
79
81 // used to get the state of init at any time.
82 // For instance this is used to show a specific icon beside the registered extension name
83 // Dev menu in imp for instance uses it to show a QStyle::SP_DialogApplyButton (a tick mark)
84 // when all actions are correctly loaded, and QStyle::SP_DialogCancelButton (a noway sign)
85 // when some actions failed
87
88protected:
90 QString name;
91
93 QString description;
94
97};
98
99} // namespace camitk
100
101#endif // __HOTPLUG_ACTION_EXTENSION__
#define CAMITK_API
Definition CamiTKAPI.h:66
VariantDataModel encapsulates QVariant and can be used as a model for any type of QVariant supported ...
Definition VariantDataModel.h:122
ActionExtension()
constructor
Definition ActionExtension.cpp:38
static HotPlugActionExtension * newHotPlugActionExtension(const QString &camitkFilePath, bool forceVerifyOrRebuild)
Definition HotPlugActionExtension.cpp:45
bool successfullyLoaded
true if the extension as well ass all the actions libraries were loaded successfully
Definition HotPlugActionExtension.h:96
virtual QString getProgrammingLanguage() const =0
get the programming language of this extension (either C++ or Python)
virtual int declaredActionCount() const
Definition HotPlugActionExtension.cpp:113
HotPlugActionExtension(const QString &camitkFilePath)
constructor
Definition HotPlugActionExtension.cpp:76
QString description
description in few word/sentences
Definition HotPlugActionExtension.h:93
virtual QString getDescription() const override
returns the action extension small description (to be overriden in your ActionExtension)
Definition HotPlugActionExtension.cpp:98
virtual void init() override
This calls initActions, but ignores the return value.
Definition HotPlugActionExtension.cpp:108
bool isSuccessfullyLoaded()
Definition HotPlugActionExtension.cpp:103
virtual bool initActions(int progressMinimum=0, int progressMaximum=100)=0
instantiate all the actions (might generate some warnings)
virtual QString getName() const override
returns the action extension name (to be overriden in your ActionExtension)
Definition HotPlugActionExtension.cpp:93
QString name
short name of the extension (as it will displayed in the Dev Studio menu for instance)
Definition HotPlugActionExtension.h:90
An Action that can be created on the fly.
Definition HotPlugAction.h:40
Definition Action.cpp:40