CustusX  18.04
An IGT application
cxLayoutInteractor.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXLAYOUTINTERACTOR_H
13 #define CXLAYOUTINTERACTOR_H
14 
15 #include "cxGuiExport.h"
16 
17 #include <QObject>
18 #include <QAction>
19 #include <QActionGroup>
20 #include <cxForwardDeclarations.h>
21 #include "cxLayoutData.h"
22 
23 
24 namespace cx
25 {
33 class cxGui_EXPORT LayoutInteractor : public QObject
34 {
35  Q_OBJECT
36 public:
37  LayoutInteractor(ViewServicePtr viewService, QObject* parent = NULL);
38 
39  void connectToMenu(QMenu* menu);
40 
41 private slots:
42  // layout menu
43  void layoutChangedSlot();
44  void newCustomLayoutSlot();
45  void editCustomLayoutSlot();
46  void deleteCustomLayoutSlot();
47 
48 private:
49  void createActions();
50  LayoutData executeLayoutEditorDialog(QString title, bool createNew);
51  QActionGroup* createLayoutActionGroup(int widgetIndex);
52  QAction* addLayoutAction(QString layout, QActionGroup* group, int widgetIndex);
53  void setActiveLayout(QString layout, int widgetIndex);
54  void deepDeleteActionGroup(QActionGroup* actionGroup);
55  LayoutRepositoryPtr getRepo();
56 
57  QActionGroup* mLayoutActionGroup;
58  QAction* mNewLayoutAction;
59  QAction* mEditLayoutAction;
60  QAction* mDeleteLayoutAction;
61  QPointer<QMenu> mMenu;
62  QPointer<QMenu> mSecondaryLayoutMenu;
63  QActionGroup* mSecondaryLayoutActionGroup;
64  ViewServicePtr mViewService;
65 
66 
67 };
68 
69 typedef boost::shared_ptr<class LayoutInteractor> LayoutInteractorPtr;
70 
71 
72 } // namespace cx
73 
74 #endif // CXLAYOUTINTERACTOR_H
boost::shared_ptr< class LayoutRepository > LayoutRepositoryPtr
boost::shared_ptr< class ViewService > ViewServicePtr
boost::shared_ptr< class LayoutInteractor > LayoutInteractorPtr
Namespace for all CustusX production code.