Computer Assited Medical Intervention Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 {
49 class CAMITK_API ActionViewer : public Viewer {
50  Q_OBJECT
51 
52 public:
54  ActionViewer();
55 
57  virtual ~ActionViewer();
58 
60  static ActionViewer * getActionViewer();
61 
63  virtual unsigned int numberOfViewedComponent() {
64  return 0;
65  };
66 
68  virtual void refresh(Viewer *whoIsAsking = NULL);
69 
71  virtual QWidget * getWidget(QWidget * parent = NULL);
72 
74  void embedActionWidget(Action *);
75 
77  void setSearchPanelVisible(bool);
78 
79 protected slots :
81  void changeName();
82 
84  void changeFamily();
85 
87  void changeTag();
88 
89 protected :
92 
93 private:
95  enum UpdateReason {ActionFamilyChanged, ActionNameChanged, ActionTagChanged, ViewerRefresh};
96 
98  void updateActionViewer(UpdateReason);
99 
101  QWidget * myWidget;
102 
104  QComboBox * familyComboBox;
105 
107  QComboBox * nameComboBox;
108 
111 
113  QLineEdit *tagLineEdit;
114 
116  QStackedWidget *actionWidgetStack;
117 
120 
123 
125  QMap<ComponentList, Action*> widgetHistory;
126 };
127 }
128 
129 #endif // ACTIONVIEWER_H