Medical Imaging Interaction Toolkit  2018.4.99-b20efe7f
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
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