Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
berryHandlerUtil.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 BERRYHANDLERUTIL_H_
14 #define BERRYHANDLERUTIL_H_
15 
16 #include <berryExecutionEvent.h>
17 #include <berryObjectList.h>
18 #include <berryObjectString.h>
19 
21 #include "berryIWorkbenchPart.h"
23 #include "berryISelection.h"
24 #include "berryIWorkbenchWindow.h"
25 
26 #include "berryISources.h"
27 
28 namespace berry {
29 
41 
42 private:
43 
44  static void NoVariableFound(const ExecutionEvent::ConstPointer& event, const QString& name);
45 
46  static void IncorrectTypeFound(const ExecutionEvent::ConstPointer& event, const QString& name,
47  const QString& expectedType, const QString& wrongType);
48 
49 
50 public:
51 
53 
64  static Object::ConstPointer GetVariable(const ExecutionEvent::ConstPointer& event, const QString& name);
65 
78  static Object::ConstPointer GetVariableChecked(const ExecutionEvent::ConstPointer& event, const QString& name);
79 
90  static Object::ConstPointer GetVariable(Object::Pointer context, const QString& name);
91 
99  static StringVectorType::ConstPointer GetActiveContexts(const ExecutionEvent::ConstPointer& event);
100 
111  static StringVectorType::ConstPointer GetActiveContextsChecked(const ExecutionEvent::ConstPointer& event);
112 
120  static IWorkbenchWindow::Pointer GetActiveWorkbenchWindow(const ExecutionEvent::ConstPointer& event);
121 
131  static IWorkbenchWindow::Pointer GetActiveWorkbenchWindowChecked(
132  const ExecutionEvent::ConstPointer& event);
133 
141  static ObjectString::ConstPointer GetActiveEditorId(const ExecutionEvent::ConstPointer& event);
142 
153  static ObjectString::ConstPointer GetActiveEditorIdChecked(const ExecutionEvent::ConstPointer& event);
154 
162  static IWorkbenchPart::Pointer GetActivePart(const ExecutionEvent::ConstPointer& event);
163 
173  static IWorkbenchPart::Pointer GetActivePartChecked(const ExecutionEvent::ConstPointer& event);
174 
182  static ObjectString::ConstPointer GetActivePartId(const ExecutionEvent::ConstPointer& event);
183 
193  static ObjectString::ConstPointer GetActivePartIdChecked(const ExecutionEvent::ConstPointer& event);
194 
202  static IWorkbenchPartSite::Pointer GetActiveSite(const ExecutionEvent::ConstPointer& event);
203 
213  static IWorkbenchPartSite::Pointer GetActiveSiteChecked(const ExecutionEvent::ConstPointer& event);
214 
222  static ISelection::ConstPointer GetCurrentSelection(const ExecutionEvent::ConstPointer& event);
223 
233  static ISelection::ConstPointer GetCurrentSelectionChecked(const ExecutionEvent::ConstPointer& event);
234 
242  static StringVectorType::ConstPointer GetActiveMenus(const ExecutionEvent::ConstPointer& event);
243 
253  static StringVectorType::ConstPointer GetActiveMenusChecked(const ExecutionEvent::ConstPointer& event);
254 
263  static ISelection::ConstPointer GetActiveMenuSelection(const ExecutionEvent::ConstPointer& event);
264 
275  static ISelection::ConstPointer GetActiveMenuSelectionChecked(const ExecutionEvent::ConstPointer& event);
276 
285  static ISelection::ConstPointer GetActiveMenuEditorInput(const ExecutionEvent::ConstPointer& event);
286 
298  static ISelection::ConstPointer GetActiveMenuEditorInputChecked(
299  const ExecutionEvent::ConstPointer& event);
300 
308  static ISelection::ConstPointer GetShowInSelection(const ExecutionEvent::ConstPointer& event);
309 
319  static ISelection::ConstPointer GetShowInSelectionChecked(const ExecutionEvent::ConstPointer& event);
320 
328  static Object::ConstPointer GetShowInInput(const ExecutionEvent::ConstPointer& event);
329 
339  static Object::ConstPointer GetShowInInputChecked(const ExecutionEvent::ConstPointer& event);
340 
350  static bool ToggleCommandState(const SmartPointer<Command>& command);
351 
365  static bool MatchesRadioState(const SmartPointer<ExecutionEvent>& event);
366 
378  static void UpdateRadioState(const SmartPointer<Command>& command, const QString& newState);
379 };
380 
381 }
382 #endif /*BERRYHANDLERUTIL_H_*/
org_blueberry_ui_qt_Export.h
berry::ObjectList
Definition: berryObjectList.h:25
berryISources.h
berry::SmartPointer
Implements transparent reference counting.
Definition: berryICommandCategoryListener.h:21
berryObjectList.h
berryIWorkbenchWindow.h
berry::HandlerUtil
Definition: berryHandlerUtil.h:40
berryObjectString.h
berry::HandlerUtil::StringVectorType
ObjectList< ObjectString::Pointer > StringVectorType
Definition: berryHandlerUtil.h:52
berryExecutionEvent.h
berryIWorkbenchPartSite.h
BERRY_UI_QT
#define BERRY_UI_QT
Definition: org_blueberry_ui_qt_Export.h:26
berryIWorkbenchPart.h
berry
Definition: QmitkPropertyItemModel.h:24
berryISelection.h