Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
berryIContextService.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 BERRYICONTEXTSERVICE_H
14 #define BERRYICONTEXTSERVICE_H
15 
17 
18 namespace berry {
19 
20 struct IContextActivation;
21 struct IContextManagerListener;
22 
23 class Context;
24 class Expression;
25 class Shell;
26 
46 {
47 
51  static const QString CONTEXT_ID_WORKBENCH_MENU; // = "org.blueberry.ui.contexts.workbenchMenu";
52 
57  static const QString CONTEXT_ID_DIALOG; // = "org.blueberry.ui.contexts.dialog";
58 
63  static const QString CONTEXT_ID_DIALOG_AND_WINDOW; // = "org.blueberry.ui.contexts.dialogAndWindow";
64 
69  static const QString CONTEXT_ID_WINDOW; // = "org.blueberry.ui.contexts.window";
70 
71  enum ShellType {
78 
86  TYPE_NONE = 1,
87 
94  };
95 
118  virtual SmartPointer<IContextActivation> ActivateContext(const QString& contextId) = 0;
119 
148  virtual SmartPointer<IContextActivation> ActivateContext(const QString& contextId,
149  const SmartPointer<Expression>& expression) = 0;
150 
183  virtual SmartPointer<IContextActivation> ActivateContext(const QString& contextId,
184  const SmartPointer<Expression>& expression,
185  bool global) = 0;
186 
201  virtual void AddContextManagerListener(IContextManagerListener* listener) = 0;
202 
214  virtual void DeactivateContext(const SmartPointer<IContextActivation>& activation) = 0;
215 
230  virtual void DeactivateContexts(const QList<SmartPointer<IContextActivation> >& activations) = 0;
231 
240  virtual QList<QString> GetActiveContextIds() const = 0;
241 
250  virtual SmartPointer<Context> GetContext(const QString& contextId) const = 0;
251 
258  virtual QList<SmartPointer<Context> > GetDefinedContexts() const = 0;
259 
267  virtual QList<QString> GetDefinedContextIds() const = 0;
268 
280  virtual ShellType GetShellType(const SmartPointer<Shell>& shell) const = 0;
281 
282  virtual ShellType GetShellType(QWidget* widget) const = 0;
283 
293  virtual void ReadRegistry() = 0;
294 
327  virtual bool RegisterShell(const SmartPointer<Shell>& shell, ShellType type) = 0;
328 
335  virtual void RemoveContextManagerListener(IContextManagerListener* listener) = 0;
336 
356  virtual bool UnregisterShell(const SmartPointer<Shell>& shell) = 0;
357 
370  virtual void DeferUpdates(bool defer) = 0;
371 
372 };
373 
374 }
375 
376 Q_DECLARE_INTERFACE(berry::IContextService, "org.blueberry.ui.IContextService")
377 
378 #endif // BERRYICONTEXTSERVICE_H
berry::IContextService::DeactivateContext
virtual void DeactivateContext(const SmartPointer< IContextActivation > &activation)=0
berry::IContextService::CONTEXT_ID_WORKBENCH_MENU
static const QString CONTEXT_ID_WORKBENCH_MENU
Definition: berryIContextService.h:51
berry::IContextService::ShellType
ShellType
Definition: berryIContextService.h:71
berry::IContextService::AddContextManagerListener
virtual void AddContextManagerListener(IContextManagerListener *listener)=0
berry::IContextService::GetShellType
virtual ShellType GetShellType(const SmartPointer< Shell > &shell) const =0
berry::IServiceWithSources
Definition: berryIServiceWithSources.h:34
berry::IContextService::GetActiveContextIds
virtual QList< QString > GetActiveContextIds() const =0
berry::SmartPointer
Implements transparent reference counting.
Definition: berryICommandCategoryListener.h:21
berryIServiceWithSources.h
berry::IContextService::TYPE_NONE
@ TYPE_NONE
Definition: berryIContextService.h:86
berry::IContextService::CONTEXT_ID_DIALOG
static const QString CONTEXT_ID_DIALOG
Definition: berryIContextService.h:57
berry::IContextService::DeactivateContexts
virtual void DeactivateContexts(const QList< SmartPointer< IContextActivation > > &activations)=0
berry::IContextService::ReadRegistry
virtual void ReadRegistry()=0
berry::IContextService::TYPE_WINDOW
@ TYPE_WINDOW
Definition: berryIContextService.h:93
berry::IContextService::CONTEXT_ID_WINDOW
static const QString CONTEXT_ID_WINDOW
Definition: berryIContextService.h:69
berry::IContextService::RemoveContextManagerListener
virtual void RemoveContextManagerListener(IContextManagerListener *listener)=0
berry::IContextService::GetContext
virtual SmartPointer< Context > GetContext(const QString &contextId) const =0
berry::IContextService::ActivateContext
virtual SmartPointer< IContextActivation > ActivateContext(const QString &contextId)=0
berry::IContextService::TYPE_DIALOG
@ TYPE_DIALOG
Definition: berryIContextService.h:77
berry::IContextService::GetDefinedContextIds
virtual QList< QString > GetDefinedContextIds() const =0
berry::IContextService
Definition: berryIContextService.h:45
berry::IContextService::RegisterShell
virtual bool RegisterShell(const SmartPointer< Shell > &shell, ShellType type)=0
berry::IContextService::DeferUpdates
virtual void DeferUpdates(bool defer)=0
berry::IContextService::UnregisterShell
virtual bool UnregisterShell(const SmartPointer< Shell > &shell)=0
berry
Definition: QmitkPropertyItemModel.h:24
berry::IContextService::CONTEXT_ID_DIALOG_AND_WINDOW
static const QString CONTEXT_ID_DIALOG_AND_WINDOW
Definition: berryIContextService.h:63
berry::IContextService::GetDefinedContexts
virtual QList< SmartPointer< Context > > GetDefinedContexts() const =0