Computer Assited Medical Intervention Tool Kit  version 3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ActionViewer.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2013 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 #ifndef ACTIONVIEWER_H
27 #define ACTIONVIEWER_H
28 
29 #include <QWidget>
30 #include <QComboBox>
31 #include <QLabel>
32 #include <QVBoxLayout>
33 #include <QPushButton>
34 #include <QStackedWidget>
35 #include <QCompleter>
36 #include <QLineEdit>
37 
38 #include "Viewer.h"
39 #include "Action.h"
40 #include "Component.h"
41 
42 namespace camitk {
54 class CAMITK_API ActionViewer : public Viewer {
55  Q_OBJECT
56 
57 public:
60  ActionViewer();
63 
65  virtual ~ActionViewer();
66 
68  static ActionViewer * getInstance();
70 
72 
73  virtual unsigned int numberOfViewedComponent() {
75  return 0;
76  };
77 
79  virtual void refresh(Viewer *whoIsAsking = NULL);
80 
82  virtual QWidget * getWidget(QWidget * parent = NULL);
84 
86 
87  void embedActionWidget(Action *);
89 
91  void setSearchPanelVisible(bool);
93 
95  // TODO CAMITK_OBSOLETE. This section list all the methods marked as obsolete. They are to be removed in CamiTK 4.0
99  static ActionViewer * getActionViewer();
101 
102 protected slots :
104  void changeName();
105 
107  void changeFamily();
108 
110  void changeTag();
111 
112 private:
114  enum UpdateReason {ActionFamilyChanged, ActionNameChanged, ActionTagChanged, ViewerRefresh};
115 
117  void updateActionViewer(UpdateReason);
118 
120  QWidget * myWidget;
121 
123  QComboBox * familyComboBox;
124 
126  QComboBox * nameComboBox;
127 
130 
132  QLineEdit *tagLineEdit;
133 
135  QStackedWidget *actionWidgetStack;
136 
139 
142 
144  QMap<ComponentList, Action*> widgetHistory;
145 };
146 }
147 
148 #endif // ACTIONVIEWER_H