Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
berryGuiWidgetsTweaklet.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 BERRYGUIWIDGETSTWEAKLET_H_
15 #define BERRYGUIWIDGETSTWEAKLET_H_
16 
17 #include "internal/berryTweaklets.h"
20 #include "berryShell.h"
21 
22 //#include "commands/berryIMenu.h"
23 //#include "commands/berryIMenuItem.h"
24 
25 
26 namespace berry {
27 
29 {
30 
31  static Tweaklets::TweakKey<GuiWidgetsTweaklet> KEY;
32 
33  virtual void AddSelectionListener(QWidget* widget, GuiTk::ISelectionListener::Pointer listener) = 0;
34  virtual void RemoveSelectionListener(QWidget* widget, GuiTk::ISelectionListener::Pointer listener) = 0;
35 
48  virtual void AddControlListener(QWidget* widget, GuiTk::IControlListener::Pointer listener) = 0;
49 
60  virtual void RemoveControlListener(QWidget* widget, GuiTk::IControlListener::Pointer listener) = 0;
61 
62  virtual bool GetEnabled(QWidget* widget) = 0;
63  virtual void SetEnabled(QWidget* widget, bool enabled) = 0;
64 
65  virtual void SetBounds(QWidget* widget, const QRect& bounds) = 0;
66  virtual QRect GetBounds(QWidget* widget) = 0;
67 
68  virtual void SetVisible(QWidget* widget, bool visible) = 0;
69  virtual bool GetVisible(QWidget* widget) = 0;
70  virtual bool IsVisible(QWidget* widget) = 0;
71 
72  virtual QRect GetClientArea(QWidget* widget) = 0;
73 
74  virtual QWidget* GetParent(QWidget* widget) = 0;
75  virtual bool SetParent(QWidget* widget, QWidget* parent) = 0;
76 
77  virtual void SetData(QWidget* widget, const QString& id, Object::Pointer data) = 0;
78  virtual Object::Pointer GetData(QWidget* widget, const QString& id) = 0;
79 
80  virtual QPoint GetCursorLocation() = 0;
81  virtual QWidget* GetCursorControl() = 0;
82  virtual QWidget* FindControl(const QList<Shell::Pointer>& shells, const QPoint& location) = 0;
83 
92  virtual bool IsChild(QWidget* potentialParent, QWidget* childToTest) = 0;
93 
102  virtual QWidget* GetFocusControl() = 0;
103 
104  virtual bool IsReparentable(QWidget* widget) = 0;
105 
106  virtual void MoveAbove(QWidget* widgetToMove, QWidget* widget) = 0;
107  virtual void MoveBelow(QWidget* widgetToMove, QWidget* widget) = 0;
108 
109  virtual void Dispose(QWidget* widget) = 0;
110 
111  virtual Shell::Pointer CreateShell(Shell::Pointer parent, int style) = 0;
112  virtual void DisposeShell(Shell::Pointer shell) = 0;
113 
114  virtual QWidget* CreateComposite(QWidget* parent) = 0;
115 
116  virtual QList<Shell::Pointer> GetShells() = 0;
117  virtual Shell::Pointer GetShell(QWidget* widget) = 0;
118  virtual Shell::Pointer GetActiveShell() = 0;
119 
120  // command framework interface classes
121  //virtual IMenu::Pointer CreateMenu(QWidget*, IMenu::Style = IMenu::POP_UP) = 0;
122  //virtual IMenu::Pointer CreateMenu(IMenu::Pointer parent) = 0;
123  //virtual IMenuItem::Pointer CreateMenuItem(IMenu::Pointer, IMenuItem::Style, int index = -1) = 0;
124 
135  virtual QRect GetScreenSize(int i = -1) = 0;
136 
137  virtual QRect GetAvailableScreenSize(int i = -1) = 0;
138 
139  virtual int GetClosestScreenNumber(const QRect&) = 0;
140 
146  virtual unsigned int GetScreenNumber() = 0;
147 
153  virtual int GetPrimaryScreenNumber() = 0;
154 
164  virtual QRect ToControl(QWidget* coordinateSystem,
165  const QRect& toConvert) = 0;
166 
176  virtual QPoint ToControl(QWidget* coordinateSystem,
177  const QPoint& toConvert) = 0;
178 
188  virtual QRect ToDisplay(QWidget* coordinateSystem,
189  const QRect& toConvert) = 0;
190 
200  virtual QPoint ToDisplay(QWidget* coordinateSystem,
201  const QPoint& toConvert) = 0;
202 };
203 
204 }
205 
206 Q_DECLARE_INTERFACE(berry::GuiWidgetsTweaklet, "org.blueberry.GuiWidgetsTweaklet")
207 
208 #endif /* BERRYGUIWIDGETSTWEAKLET_H_ */
berry::GuiWidgetsTweaklet::KEY
static Tweaklets::TweakKey< GuiWidgetsTweaklet > KEY
Definition: berryGuiWidgetsTweaklet.h:31
berry::SmartPointer< Self >
berryGuiTkISelectionListener.h
berryGuiTkIControlListener.h
BERRY_UI_QT
#define BERRY_UI_QT
Definition: org_blueberry_ui_qt_Export.h:26
berry::GuiWidgetsTweaklet
Definition: berryGuiWidgetsTweaklet.h:28
berryShell.h
berry
Definition: QmitkPropertyItemModel.h:24