Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryGuiWidgetsTweaklet.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 
18 #ifndef BERRYGUIWIDGETSTWEAKLET_H_
19 #define BERRYGUIWIDGETSTWEAKLET_H_
20 
21 #include "internal/berryTweaklets.h"
24 #include "berryShell.h"
25 
26 //#include "commands/berryIMenu.h"
27 //#include "commands/berryIMenuItem.h"
28 
29 
30 namespace berry {
31 
33 {
34 
35  static Tweaklets::TweakKey<GuiWidgetsTweaklet> KEY;
36 
37  virtual void AddSelectionListener(QWidget* widget, GuiTk::ISelectionListener::Pointer listener) = 0;
38  virtual void RemoveSelectionListener(QWidget* widget, GuiTk::ISelectionListener::Pointer listener) = 0;
39 
51  virtual void AddControlListener(QWidget* widget, GuiTk::IControlListener::Pointer listener) = 0;
52 
62  virtual void RemoveControlListener(QWidget* widget, GuiTk::IControlListener::Pointer listener) = 0;
63 
64  virtual bool GetEnabled(QWidget* widget) = 0;
65  virtual void SetEnabled(QWidget* widget, bool enabled) = 0;
66 
67  virtual void SetBounds(QWidget* widget, const QRect& bounds) = 0;
68  virtual QRect GetBounds(QWidget* widget) = 0;
69 
70  virtual void SetVisible(QWidget* widget, bool visible) = 0;
71  virtual bool GetVisible(QWidget* widget) = 0;
72  virtual bool IsVisible(QWidget* widget) = 0;
73 
74  virtual QRect GetClientArea(QWidget* widget) = 0;
75 
76  virtual QWidget* GetParent(QWidget* widget) = 0;
77  virtual bool SetParent(QWidget* widget, QWidget* parent) = 0;
78 
79  virtual void SetData(QWidget* widget, const QString& id, Object::Pointer data) = 0;
80  virtual Object::Pointer GetData(QWidget* widget, const QString& id) = 0;
81 
82  virtual QPoint GetCursorLocation() = 0;
83  virtual QWidget* GetCursorControl() = 0;
84  virtual QWidget* FindControl(const QList<Shell::Pointer>& shells, const QPoint& location) = 0;
85 
94  virtual bool IsChild(QWidget* potentialParent, QWidget* childToTest) = 0;
95 
104  virtual QWidget* GetFocusControl() = 0;
105 
106  virtual bool IsReparentable(QWidget* widget) = 0;
107 
108  virtual void MoveAbove(QWidget* widgetToMove, QWidget* widget) = 0;
109  virtual void MoveBelow(QWidget* widgetToMove, QWidget* widget) = 0;
110 
111  virtual void Dispose(QWidget* widget) = 0;
112 
113  virtual Shell::Pointer CreateShell(Shell::Pointer parent, int style) = 0;
114  virtual void DisposeShell(Shell::Pointer shell) = 0;
115 
116  virtual QWidget* CreateComposite(QWidget* parent) = 0;
117 
118  virtual QList<Shell::Pointer> GetShells() = 0;
119  virtual Shell::Pointer GetShell(QWidget* widget) = 0;
120  virtual Shell::Pointer GetActiveShell() = 0;
121 
122  // command framework interface classes
123  //virtual IMenu::Pointer CreateMenu(QWidget*, IMenu::Style = IMenu::POP_UP) = 0;
124  //virtual IMenu::Pointer CreateMenu(IMenu::Pointer parent) = 0;
125  //virtual IMenuItem::Pointer CreateMenuItem(IMenu::Pointer, IMenuItem::Style, int index = -1) = 0;
126 
137  virtual QRect GetScreenSize(int i = -1) = 0;
138 
139  virtual QRect GetAvailableScreenSize(int i = -1) = 0;
140 
141  virtual int GetClosestScreenNumber(const QRect&) = 0;
142 
148  virtual unsigned int GetScreenNumber() = 0;
149 
155  virtual int GetPrimaryScreenNumber() = 0;
156 
166  virtual QRect ToControl(QWidget* coordinateSystem,
167  const QRect& toConvert) = 0;
168 
178  virtual QPoint ToControl(QWidget* coordinateSystem,
179  const QPoint& toConvert) = 0;
180 
190  virtual QRect ToDisplay(QWidget* coordinateSystem,
191  const QRect& toConvert) = 0;
192 
202  virtual QPoint ToDisplay(QWidget* coordinateSystem,
203  const QPoint& toConvert) = 0;
204 };
205 
206 }
207 
208 Q_DECLARE_INTERFACE(berry::GuiWidgetsTweaklet, "org.blueberry.GuiWidgetsTweaklet")
209 
210 #endif /* BERRYGUIWIDGETSTWEAKLET_H_ */
T::Pointer GetData(const std::string &name)
static Tweaklets::TweakKey< GuiWidgetsTweaklet > KEY
#define BERRY_UI_QT