Computer Assited Medical Intervention Tool Kit  version 3.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ImpMainWindow.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2014 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
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 IMP_MAINWINDOW_H
28 #define IMP_MAINWINDOW_H
29 
30 
31 // -- Core stuff
32 #include <MainWindow.h>
42  Q_OBJECT
43 
44 public:
45 
49  ImpMainWindow();
50 
52  void aboutToShow();
53 
55  virtual ~ImpMainWindow();
56 
59 
64  virtual void addDockViewer(Qt::DockWidgetArea, camitk::Viewer*);
65 
70  virtual void setCentralViewer(camitk::Viewer*);
71 
73  virtual void redirectToConsole(bool);
75 
76 public slots:
77 
81  void openDirectory(QAction *);
83 
87  virtual void refresh();
89 
93 
96  void showToolbar(bool);
97 
99  void showMenuBar(bool);
100 
102  void resetWindows();
103 
105  void showStatusBar(bool);
106 
108  void saveHistoryAsSCXML();
109 
111 
113  void editSettings();
116 
118 
119 protected:
121  void updateViewMenu();
122 
127 
131 
133  void updateActionStates();
137 
139  void initActions();
140 
142  QToolBar *mainToolbar;
143 
145  virtual void initSettings();
146 
147 private:
148 
150 
153  void initMenuBar();
154 
158  void initToolBar();
160 
162 
164  QMenu *fileMenu;
166  QAction *fileOpen;
167  QAction *fileClose;
168  QAction *fileCloseAll;
169  QAction *fileSave;
170  QAction *fileSaveAs;
171  QAction *fileSaveAll;
172  QAction *fileQuit;
173 
175 
177  QMenu *viewMenu;
178  QAction *viewMenuBar;
179  QAction *viewStatusBar;
182 
184  QAction *editApplicationSettings;
188  QAction *saveHistory;
190 
192 
198  QMenu *actionMenu;
199 
201  QAction *helpAboutApp;
204 
206  QAction *helpShowConsole;
208 
210  QAction *changeLanguage;
214 
219 
221  QList<QAction*> recentDocumentActions;
222 
225 
227 
228 
229 private slots:
230 
232  void openRecentDocuments();
233 
234 };
235 
236 #endif //IMP_MAINWINDOW_H
237 
QMenu * fileOpenDataDirectoryMenu
Definition: ImpMainWindow.h:165
virtual void refresh()
Definition: ImpMainWindow.cpp:111
QMenu * actionMenu
the actionMenu.
Definition: ImpMainWindow.h:198
QAction * fileSave
Definition: ImpMainWindow.h:169
void updateViewMenu()
update the viewer's menu
Definition: ImpMainWindow.cpp:473
QAction * changeLanguage
Definition: ImpMainWindow.h:212
void saveHistoryAsSCXML()
Save the history of action as a SCXML file.
Definition: ImpMainWindow.cpp:599
void aboutToShow()
overriden from MainWindow to automatically load last opened document if needed
Definition: ImpMainWindow.cpp:98
void initMenuBar()
initMenuBar creates the menu_bar and inserts the menuitems
Definition: ImpMainWindow.cpp:226
bool autoLoadLastOpened
Definition: ImpMainWindow.h:218
QAction * viewResetWindows
Definition: ImpMainWindow.h:180
QAction * saveHistory
Definition: ImpMainWindow.h:188
Viewer is an abstract viewer.
Definition: Viewer.h:55
QAction * editApplicationSettings
Definition: ImpMainWindow.h:186
void openRecentDocuments()
open a given recent document
Definition: ImpMainWindow.cpp:562
This Class is the base class for your application.
Definition: MainWindow.h:62
QAction * helpAboutApp
Definition: ImpMainWindow.h:203
QAction * fileSaveAs
Definition: ImpMainWindow.h:170
QMenu * fileMenu
file_menu contains all items of the menubar entry "File"
Definition: ImpMainWindow.h:164
void updateOpenDirectoryMenu()
Definition: ImpMainWindow.cpp:418
void updateRecentDocumentsMenu()
update the recent document menu
Definition: ImpMainWindow.cpp:578
virtual void initSettings()
init ImpMainWindow specific settings (e.g. autoLoadLastOpened)
Definition: ImpMainWindow.cpp:541
QAction * recentDocumentSeparator
the separator between the last file menu action and the recent document actions
Definition: ImpMainWindow.h:224
void resetWindows()
reset all windows in their initial state
Definition: ImpMainWindow.cpp:380
void openDirectory(QAction *)
Definition: ImpMainWindow.cpp:441
QAction * viewStatusBar
Definition: ImpMainWindow.h:179
QAction * viewMenuBar
Definition: ImpMainWindow.h:178
void showStatusBar(bool)
show or hide the status bar
Definition: ImpMainWindow.cpp:375
virtual void redirectToConsole(bool)
use or not the application console (overriden to add an action to show the console window) ...
Definition: ImpMainWindow.cpp:555
void showToolbar(bool)
show or hide the toolbar
Definition: ImpMainWindow.cpp:351
QToolBar * mainToolbar
the main toolbar
Definition: ImpMainWindow.h:142
QAction * fileSaveAll
Definition: ImpMainWindow.h:171
QAction * fileOpen
Definition: ImpMainWindow.h:166
virtual ~ImpMainWindow()
destructor
Definition: ImpMainWindow.cpp:94
QAction * helpShowConsole
action for the show console
Definition: ImpMainWindow.h:206
void initActions()
initializes all QActions of the application
Definition: ImpMainWindow.cpp:137
void showMenuBar(bool)
show or hide the menu bar
Definition: ImpMainWindow.cpp:356
QMenu * viewMenu
view_menu contains all items of the menubar entry "View"
Definition: ImpMainWindow.h:177
void updateActionStates()
Definition: ImpMainWindow.cpp:303
ImpMainWindow()
Definition: ImpMainWindow.cpp:60
void initToolBar()
this creates the toolbars.
Definition: ImpMainWindow.cpp:293
QAction * fileQuit
Definition: ImpMainWindow.h:172
This Class describes the "historical" imp application.
Definition: ImpMainWindow.h:41
QAction * fileClose
Definition: ImpMainWindow.h:167
virtual void setCentralViewer(camitk::Viewer *)
set the central Viewer of the application.
Definition: ImpMainWindow.cpp:130
QList< QAction * > recentDocumentActions
list of all the possible recent documents actions
Definition: ImpMainWindow.h:221
void editSettings()
Definition: ImpMainWindow.cpp:499
QAction * editClearSelection
Definition: ImpMainWindow.h:187
QAction * fileCloseAll
Definition: ImpMainWindow.h:168
virtual void addDockViewer(Qt::DockWidgetArea, camitk::Viewer *)
add a Viewer to the application as a docking widget and specify where it has to be docked MainWindow ...
Definition: ImpMainWindow.cpp:123