Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryActionBarAdvisor.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef BERRYACTIONBARADVISOR_H_
18 #define BERRYACTIONBARADVISOR_H_
19 
20 #include <berryObject.h>
21 
23 
24 class QAction;
25 
26 namespace berry
27 {
28 
29 struct IMenuManager;
30 struct IToolBarManager;
31 struct IStatusLineManager;
32 struct IActionBarConfigurer;
33 struct IMemento;
34 struct IWorkbenchWindow;
35 
56 {
57 
58 public:
59 
61 
62  enum FillType {
68  FILL_PROXY = 0x01,
69 
75  FILL_MENU_BAR = 0x02,
76 
82  FILL_TOOL_BAR = 0x04,
83 
89  FILL_STATUS_LINE = 0x08
90  };
91  Q_DECLARE_FLAGS(FillFlags, FillType)
92 
93 public:
94 
96 
103  ActionBarAdvisor(const SmartPointer<IActionBarConfigurer>& configurer);
104 
142  virtual void FillActionBars(FillFlags flags);
143 
155  virtual bool SaveState(SmartPointer<IMemento> memento);
156 
168  public: virtual bool RestoreState(SmartPointer<IMemento> memento);
169 
170  using Object::Register;
171 
172 protected:
173 
179  virtual SmartPointer<IActionBarConfigurer> GetActionBarConfigurer() const;
180 
188  virtual void MakeActions(IWorkbenchWindow* window);
189 
196  virtual void Register(QAction* action, const QString& id);
197 
204  virtual QAction* GetAction(const QString& id) const;
205 
215  virtual void FillMenuBar(IMenuManager* menuBar);
216 
226  virtual void FillToolBar(IToolBarManager* toolBar);
227 
238  virtual void FillStatusLine(IStatusLineManager* statusLine);
239 
240 private:
241 
242  SmartPointer<IActionBarConfigurer> actionBarConfigurer;
243 
244  QHash<QString, QAction*> actions;
245 
246 };
247 
248 }
249 
250 Q_DECLARE_OPERATORS_FOR_FLAGS(berry::ActionBarAdvisor::FillFlags)
251 
252 #endif /*BERRYACTIONBARADVISOR_H_*/
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:78
Implements transparent reference counting.
berryObjectMacro(berry::ActionBarAdvisor) enum FillType
#define BERRY_UI_QT