Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryIContextService.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef BERRYICONTEXTSERVICE_H
18 #define BERRYICONTEXTSERVICE_H
19 
21 
22 namespace berry {
23 
24 struct IContextActivation;
25 struct IContextManagerListener;
26 
27 class Context;
28 class Expression;
29 class Shell;
30 
50 {
51 
55  static const QString CONTEXT_ID_WORKBENCH_MENU; // = "org.blueberry.ui.contexts.workbenchMenu";
56 
61  static const QString CONTEXT_ID_DIALOG; // = "org.blueberry.ui.contexts.dialog";
62 
67  static const QString CONTEXT_ID_DIALOG_AND_WINDOW; // = "org.blueberry.ui.contexts.dialogAndWindow";
68 
73  static const QString CONTEXT_ID_WINDOW; // = "org.blueberry.ui.contexts.window";
74 
75  enum ShellType {
82 
90  TYPE_NONE = 1,
91 
98  };
99 
122  virtual SmartPointer<IContextActivation> ActivateContext(const QString& contextId) = 0;
123 
152  virtual SmartPointer<IContextActivation> ActivateContext(const QString& contextId,
153  const SmartPointer<Expression>& expression) = 0;
154 
187  virtual SmartPointer<IContextActivation> ActivateContext(const QString& contextId,
188  const SmartPointer<Expression>& expression,
189  bool global) = 0;
190 
205  virtual void AddContextManagerListener(IContextManagerListener* listener) = 0;
206 
218  virtual void DeactivateContext(const SmartPointer<IContextActivation>& activation) = 0;
219 
234  virtual void DeactivateContexts(const QList<SmartPointer<IContextActivation> >& activations) = 0;
235 
244  virtual QList<QString> GetActiveContextIds() const = 0;
245 
254  virtual SmartPointer<Context> GetContext(const QString& contextId) const = 0;
255 
262  virtual QList<SmartPointer<Context> > GetDefinedContexts() const = 0;
263 
271  virtual QList<QString> GetDefinedContextIds() const = 0;
272 
284  virtual ShellType GetShellType(const SmartPointer<Shell>& shell) const = 0;
285 
286  virtual ShellType GetShellType(QWidget* widget) const = 0;
287 
297  virtual void ReadRegistry() = 0;
298 
331  virtual bool RegisterShell(const SmartPointer<Shell>& shell, ShellType type) = 0;
332 
339  virtual void RemoveContextManagerListener(IContextManagerListener* listener) = 0;
340 
360  virtual bool UnregisterShell(const SmartPointer<Shell>& shell) = 0;
361 
374  virtual void DeferUpdates(bool defer) = 0;
375 
376 };
377 
378 }
379 
380 Q_DECLARE_INTERFACE(berry::IContextService, "org.blueberry.ui.IContextService")
381 
382 #endif // BERRYICONTEXTSERVICE_H
virtual void RemoveContextManagerListener(IContextManagerListener *listener)=0
virtual void DeactivateContext(const SmartPointer< IContextActivation > &activation)=0
virtual void ReadRegistry()=0
virtual QList< SmartPointer< Context > > GetDefinedContexts() const =0
Implements transparent reference counting.
virtual void AddContextManagerListener(IContextManagerListener *listener)=0
virtual void DeferUpdates(bool defer)=0
virtual QList< QString > GetActiveContextIds() const =0
virtual ShellType GetShellType(const SmartPointer< Shell > &shell) const =0
virtual bool RegisterShell(const SmartPointer< Shell > &shell, ShellType type)=0
static const QString CONTEXT_ID_WINDOW
virtual void DeactivateContexts(const QList< SmartPointer< IContextActivation > > &activations)=0
virtual SmartPointer< Context > GetContext(const QString &contextId) const =0
static const QString CONTEXT_ID_DIALOG
virtual SmartPointer< IContextActivation > ActivateContext(const QString &contextId)=0
virtual bool UnregisterShell(const SmartPointer< Shell > &shell)=0
static const QString CONTEXT_ID_DIALOG_AND_WINDOW
virtual QList< QString > GetDefinedContextIds() const =0
static const QString CONTEXT_ID_WORKBENCH_MENU