Medical Imaging Interaction Toolkit  2023.12.99-63768887
Medical Imaging Interaction Toolkit
mitkWorkbenchUtil.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 
14 #ifndef mitkWorkbenchUtil_h
15 #define mitkWorkbenchUtil_h
16 
18 
20 
21 #include "mitkIRenderWindowPart.h"
22 
23 #include <berryIWorkbenchPage.h>
24 #include <berryIEditorDescriptor.h>
25 
26 class ctkPluginContext;
27 
28 namespace mitk {
38  {
43 
44  // Do nothing.
45  NONE = 0x00000000,
46  // Bring the most recently activated mitk::IRenderWindowPart instance to the front.
47  BRING_TO_FRONT = 0x00000001,
48  // Activate an mitk::IRenderWindowPart part (implies bringing it to the front).
49  ACTIVATE = 0x00000002,
50  // Create an mitk::IRenderWindowPart if none is already opened.
51  OPEN = 0x00000004
52  };
53 
54  Q_DECLARE_FLAGS(IRenderWindowPartStrategies, IRenderWindowPartStrategy)
55 
56 
71  static void LoadFiles(const QStringList& fileNames, berry::IWorkbenchWindow::Pointer wnd, bool openEditor = true);
94  static berry::IEditorPart::Pointer OpenEditor(berry::IWorkbenchPage::Pointer page, berry::IEditorInput::Pointer input, const QString& editorId, bool activate = false);
120  static berry::IEditorPart::Pointer OpenEditor(berry::IWorkbenchPage::Pointer page, DataStorageEditorInput::Pointer input, bool activate = false, bool determineContentType = false);
153  static berry::IEditorDescriptor::Pointer GetEditorDescriptor(const QString& name, bool inferContentType = true);
174  static berry::IEditorDescriptor::Pointer GetDefaultEditor(const QString& file, bool determineContentType);
183  static IRenderWindowPart* GetRenderWindowPart(berry::IWorkbenchPage::Pointer page, IRenderWindowPartStrategies strategies);
193  static IRenderWindowPart* OpenRenderWindowPart(berry::IWorkbenchPage::Pointer page, bool activatedEditor = true);
204  static bool SetDepartmentLogoPreference(const QString& logoResource, ctkPluginContext* context);
205  };
206 }
207 
208 Q_DECLARE_OPERATORS_FOR_FLAGS(mitk::WorkbenchUtil::IRenderWindowPartStrategies)
209 
210 #endif
berry::SmartPointer
Implements transparent reference counting.
Definition: berryICommandCategoryListener.h:21
org_mitk_gui_common_Export.h
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::IRenderWindowPart
Interface for a MITK Workbench Part providing a render window.
Definition: mitkIRenderWindowPart.h:54
mitkIRenderWindowPart.h
MITK_GUI_COMMON_PLUGIN
#define MITK_GUI_COMMON_PLUGIN
Definition: org_mitk_gui_common_Export.h:26
berryIWorkbenchPage.h
mitkDataStorageEditorInput.h
mitk::WorkbenchUtil::IRenderWindowPartStrategy
IRenderWindowPartStrategy
Definition: mitkWorkbenchUtil.h:42
berryIEditorDescriptor.h
mitk::WorkbenchUtil
Utility class for loading data, opening editors and other tasks in a MITK Workbench.
Definition: mitkWorkbenchUtil.h:37