Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
CamiTKExtensionModelPresenter.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
27#ifndef __CAMITK_EXTENSION_MODEL_PRESENTER__
28#define __CAMITK_EXTENSION_MODEL_PRESENTER__
29
31
32// Qt
33#include <QTabWidget>
34#include <QtVariantProperty>
35#include <QHBoxLayout>
36#include <QTextEdit>
37
47class CamiTKExtensionModelPresenter : public QWidget {
48 Q_OBJECT
49
50public:
57 CamiTKExtensionModelPresenter(const QString& camitkFilePath, const QString& newExtensionName, const QString& language = QString(), const QString& cppGenerationType = QString(), QWidget* parent = nullptr);
58
61
63 bool isModified();
64
66 bool isHotPlug();
67
69 bool isPython();
70
72 void saveExtensionFile(const QFile& file);
73
75 QString getExtensionName();
76
78 void emitShowMessage(const QString& message, int durationMilliseconds = 2000, bool warning = false);
79
80signals:
82 void showMessage(const QString& message, int durationMilliseconds = 2000, bool warning = false);
83
86
87public slots:
89 void tabCloseRequest(int index);
90
92 void plusButtonClicked();
93
95 void modelUpdated();
96
97private:
99 CamiTKExtensionModel camitkExtensionModel;
100
102 QTabWidget* tabWidget;
103
105 QTextEdit* jsonTextEdit;
106};
107
108#endif // __CAMITK_EXTENSION_MODEL_PRESENTER__
Presenter for a CamiTK extension file model.
Definition CamiTKExtensionModelPresenter.h:47
bool isHotPlug()
is the current model a hot plug extension
Definition CamiTKExtensionModelPresenter.cpp:230
void plusButtonClicked()
called when the user clicks on the "+" button to add an action tab
Definition CamiTKExtensionModelPresenter.cpp:180
void saveExtensionFile(const QFile &file)
save the data model
Definition CamiTKExtensionModelPresenter.cpp:247
~CamiTKExtensionModelPresenter()
destructor
Definition CamiTKExtensionModelPresenter.cpp:140
void tabCloseRequest(int index)
called when a tab is closed (only action tabs are closable)
Definition CamiTKExtensionModelPresenter.cpp:150
bool isPython()
is the current model a python extension
Definition CamiTKExtensionModelPresenter.cpp:235
bool isModified()
is the current model modified (unsaved)
Definition CamiTKExtensionModelPresenter.cpp:225
void dataModelUpdated()
emitted when the data model was updated by the user
void modelUpdated()
called when the model has changed, the GUI/JSON is to be updated
Definition CamiTKExtensionModelPresenter.cpp:218
void emitShowMessage(const QString &message, int durationMilliseconds=2000, bool warning=false)
make the presenter emit the show message signal
Definition CamiTKExtensionModelPresenter.cpp:145
QString getExtensionName()
get current extension name
Definition CamiTKExtensionModelPresenter.cpp:252
void showMessage(const QString &message, int durationMilliseconds=2000, bool warning=false)
emitted when a message has to be displayed to the user
This class manages a CamiTK Extension model (stored as a VariantDataModel).
Definition CamiTKExtensionModel.h:67