Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
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 alredy 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 // MITKWORKBENCHUTIL_H
Interface for a MITK Workbench Part providing a render window.
DataCollection - Class to facilitate loading/accessing structured data.
Utility class for loading data, opening editors and other tasks in a MITK Workbench.
#define MITK_GUI_COMMON_PLUGIN