8#include <sonde/sonde_gui_export.h>
10#include <QtCore/QJsonObject>
11#include <QtCore/QList>
12#include <QtCore/QMargins>
13#include <QtCore/QModelIndex>
14#include <QtCore/QObject>
15#include <QtCore/QRectF>
16#include <QtCore/QStringList>
17#include <QtGui/QImage>
23class QAbstractItemModel;
81 virtual QString
name()
const = 0;
198SONDE_GUI_EXPORT Expected<QWindow *>
findWindow(
const QString &spec);
206SONDE_GUI_EXPORT Expected<ScreenRect>
objectGeometry(QObject *
object);
213SONDE_GUI_EXPORT QObject *
objectAt(QWindow *window,
const QPointF &pos);
217SONDE_GUI_EXPORT Expected<QImage>
grabWindow(QWindow *window);
226SONDE_GUI_EXPORT QAbstractItemModel *
modelFor(QObject *
object);
230SONDE_GUI_EXPORT Expected<ScreenRect>
cellGeometry(QObject *view,
const QModelIndex &index,
235SONDE_GUI_EXPORT Expected<QJsonObject>
layoutInfo(QObject *
object);
239SONDE_GUI_EXPORT Expected<OverflowFacts>
overflowFacts(QObject *
object);
242SONDE_GUI_EXPORT QList<OpenPopup>
openPopups(QObject *root);
245SONDE_GUI_EXPORT QObjectList
movingViews(QWindow *window);
247SONDE_GUI_EXPORT QJsonObject
appInfo();
A value of type T, or an error of type E, as std::expected.
Definition expected.h:106
Hooks that let a UI toolkit built on QtGui (Qt Widgets, Qt Quick or your own) tell the GUI tools how ...
Definition guiintegration.h:75
virtual Expected< QObject * > objectForWindow(QWindow *window)
The object that represents a top-level window in the object tree (e.g.
Definition guiintegration.h:103
virtual QString name() const =0
Unique name; registering another integration with the same name replaces this one.
virtual QJsonObject appInfo()
Fields this integration adds to app_info's answer, such as the state of a feature it provides.
Definition guiintegration.h:181
virtual Expected< QObjectList > children(QObject *object)
Visual children of object if they differ from QObject::children(), or notHandled().
Definition guiintegration.h:111
virtual QList< OpenPopup > openPopups(QObject *root)
The open popups that belong to root or an object below it.
Definition guiintegration.h:164
virtual Expected< QObject * > objectAt(QWindow *window, const QPointF &pos)
The deepest object at pos (window coordinates), or notHandled().
Definition guiintegration.h:118
virtual Expected< ScreenRect > objectGeometry(QObject *object)
Where object is on screen.
Definition guiintegration.h:95
virtual Expected< ScreenRect > cellGeometry(QObject *view, const QModelIndex &index, ScrollToCell scroll)
Where cell index of view view is on screen.
Definition guiintegration.h:138
virtual QObjectList movingViews(QWindow *window)
The views in window still scrolling on their own: a flick, kinetic scrolling, or an animated wheel sc...
Definition guiintegration.h:174
virtual Expected< QAbstractItemModel * > model(QObject *object)
The item model object shows (it is a view, combo box, ...), or notHandled().
Definition guiintegration.h:126
virtual Expected< OverflowFacts > overflowFacts(QObject *object)
What this integration knows about how object may overflow, or notHandled().
Definition guiintegration.h:156
virtual Expected< QImage > grabWindow(QWindow *window)
Renders the window's contents.
Definition guiintegration.h:86
virtual ~GuiIntegration()
Destroys the integration.
virtual Expected< QJsonObject > layoutInfo(QObject *object)
Layout facts about object for layout_explain (size hints, policies, margins, clipping,...
Definition guiintegration.h:149
Sonde::Expected, Sonde::Unexpected and Sonde::Error: results that are a value or an error (design 003...
What every Sonde header includes: the version, and the deprecation macros (design 0031).
QObject * objectAt(QWindow *window, const QPointF &pos)
The deepest object at pos in window, or nullptr if there is none.
Definition guiintegration.cpp:129
Expected< ScreenRect > objectGeometry(QObject *object)
Where object is on screen (see GuiIntegration::objectGeometry()).
Definition guiintegration.cpp:117
QList< QWindow * > visibleWindows()
All visible top-level windows.
Definition guiintegration.cpp:98
QList< OpenPopup > openPopups(QObject *root)
The open popups below root, from every integration (see GuiIntegration::openPopups()).
Definition guiintegration.cpp:307
void registerIntegration(std::unique_ptr< GuiIntegration > integration)
Registers integration, replacing one with the same name().
Definition guiintegration.cpp:84
QJsonObject appInfo()
The fields every integration adds to app_info (see GuiIntegration::appInfo()).
Definition guiintegration.cpp:325
QAbstractItemModel * modelFor(QObject *object)
The item model object is or shows, or nullptr if none.
Definition guiintegration.cpp:263
QString describeWindow(QWindow *w)
One-line summary: @id Class "Title".
Definition guiintegration.cpp:160
Expected< QWindow * > findWindow(const QString &spec)
Finds a window.
Definition guiintegration.cpp:237
Expected< OverflowFacts > overflowFacts(QObject *object)
Overflow facts about object (see GuiIntegration::overflowFacts()), or a failure if no integration kno...
Definition guiintegration.cpp:297
Expected< QJsonObject > layoutInfo(QObject *object)
Layout facts about object (see GuiIntegration::layoutInfo()), or a failure if no integration knows it...
Definition guiintegration.cpp:287
Expected< ScreenRect > cellGeometry(QObject *view, const QModelIndex &index, ScrollToCell scroll)
Where cell index of view is (see GuiIntegration::cellGeometry()).
Definition guiintegration.cpp:275
Expected< QImage > grabWindow(QWindow *window)
Renders window (device pixels).
Definition guiintegration.cpp:136
QObjectList movingViews(QWindow *window)
The views in window still scrolling, from every integration (see GuiIntegration::movingViews()).
Definition guiintegration.cpp:316
QObject * objectForWindow(QWindow *window)
The object representing window in the object tree: what an integration reports (its QWidget,...
Definition guiintegration.cpp:110
Embeddable Model Context Protocol server for Qt applications.
Definition dispatch.cpp:10
ScrollToCell
Whether cellGeometry() may scroll the view to show the cell.
Definition guiintegration.h:37
@ Yes
Scroll the view first, if the cell is out of sight.
Definition guiintegration.h:39
@ No
Leave the view as it is; a cell scrolled out of sight isn't shown.
Definition guiintegration.h:38
Unexpected< Error > notHandled()
"Not handled, ask the next integration", for GuiIntegration hooks to return.
Definition expected.h:88
What an integration knows about how one object may overflow, for layout_overflow.
Definition guiintegration.h:44
bool clips
Its children are cut off at its bounds.
Definition guiintegration.h:45
QMarginsF allowed
How far it may extend past its parent by design, per side.
Definition guiintegration.h:47
bool decoration
Looks like a decoration: no children, text or input.
Definition guiintegration.h:49
QStringList causes
What placed it, e.g. "anchors.bottomMargin: -12".
Definition guiintegration.h:48
QObject * scrolledContent
The child it scrolls, if it is a scrolling view.
Definition guiintegration.h:46
Where something is on screen: the window that shows it, and its rectangle there.
Definition guiintegration.h:31
QWindow * window
The window that shows it.
Definition guiintegration.h:32
QRectF rect
Its rectangle, in the window's (logical) coordinates.
Definition guiintegration.h:33