Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
berryActionBarAdvisor.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef BERRYACTIONBARADVISOR_H_
14 #define BERRYACTIONBARADVISOR_H_
15 
16 #include <berryObject.h>
17 
19 
20 class QAction;
21 
22 namespace berry
23 {
24 
25 struct IMenuManager;
26 struct IToolBarManager;
27 struct IStatusLineManager;
28 struct IActionBarConfigurer;
29 struct IMemento;
30 struct IWorkbenchWindow;
31 
52 {
53 
54 public:
55 
57 
58  enum FillType {
64  FILL_PROXY = 0x01,
65 
71  FILL_MENU_BAR = 0x02,
72 
78  FILL_TOOL_BAR = 0x04,
79 
85  FILL_STATUS_LINE = 0x08
86  };
87  Q_DECLARE_FLAGS(FillFlags, FillType)
88 
89 public:
90 
91  ~ActionBarAdvisor() override;
92 
100 
138  virtual void FillActionBars(FillFlags flags);
139 
151  virtual bool SaveState(SmartPointer<IMemento> memento);
152 
164  public: virtual bool RestoreState(SmartPointer<IMemento> memento);
165 
166  using Object::Register;
167 
168 protected:
169 
175  virtual SmartPointer<IActionBarConfigurer> GetActionBarConfigurer() const;
176 
184  virtual void MakeActions(IWorkbenchWindow* window);
185 
192  virtual void Register(QAction* action, const QString& id);
193 
200  virtual QAction* GetAction(const QString& id) const;
201 
211  virtual void FillMenuBar(IMenuManager* menuBar);
212 
222  virtual void FillToolBar(IToolBarManager* toolBar);
223 
234  virtual void FillStatusLine(IStatusLineManager* statusLine);
235 
236 private:
237 
238  SmartPointer<IActionBarConfigurer> actionBarConfigurer;
239 
240  QHash<QString, QAction*> actions;
241 
242 };
243 
244 }
245 
246 Q_DECLARE_OPERATORS_FOR_FLAGS(berry::ActionBarAdvisor::FillFlags)
247 
248 #endif /*BERRYACTIONBARADVISOR_H_*/
org_blueberry_ui_qt_Export.h
berry::Object::Register
void Register() const
berry::IWorkbenchWindow
Definition: berryIWorkbenchWindow.h:62
berry::ActionBarAdvisor::FillType
FillType
Definition: berryActionBarAdvisor.h:58
berry::SmartPointer
Implements transparent reference counting.
Definition: berryICommandCategoryListener.h:21
berry::Object
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:72
BERRY_UI_QT
#define BERRY_UI_QT
Definition: org_blueberry_ui_qt_Export.h:26
berry::IMenuManager
Definition: berryIMenuManager.h:36
berry::ActionBarAdvisor
Definition: berryActionBarAdvisor.h:51
berryObjectMacro
#define berryObjectMacro(...)
Definition: berryMacros.h:33
berryObject.h
berry
Definition: QmitkPropertyItemModel.h:24