Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
Sonde::GuiIntegration Class Referenceabstract

Hooks that let a UI toolkit built on QtGui (Qt Widgets, Qt Quick or your own) tell the GUI tools how to grab, hit-test and locate its objects. More...

#include <guiintegration.h>

Inheritance diagram for Sonde::GuiIntegration:
Sonde::anonymous_namespace{quickintegration.cpp}::QuickIntegration Sonde::anonymous_namespace{widgetsintegration.cpp}::WidgetsIntegration anonymous_namespace{test_windows.cpp}::NullIntegration

Public Member Functions

virtual ~GuiIntegration ()
 Destroys the integration.
virtual QString name () const =0
 Unique name; registering another integration with the same name replaces this one.
virtual Expected< QImage > grabWindow (QWindow *window)
 Renders the window's contents.
virtual Expected< ScreenRect > objectGeometry (QObject *object)
 Where object is on screen.
virtual Expected< QObject * > objectForWindow (QWindow *window)
 The object that represents a top-level window in the object tree (e.g.
virtual Expected< QObjectList > children (QObject *object)
 Visual children of object if they differ from QObject::children(), or notHandled().
virtual Expected< QObject * > objectAt (QWindow *window, const QPointF &pos)
 The deepest object at pos (window coordinates), or notHandled().
virtual Expected< QAbstractItemModel * > model (QObject *object)
 The item model object shows (it is a view, combo box, ...), or notHandled().
virtual Expected< ScreenRect > cellGeometry (QObject *view, const QModelIndex &index, ScrollToCell scroll)
 Where cell index of view view is on screen.
virtual Expected< QJsonObject > layoutInfo (QObject *object)
 Layout facts about object for layout_explain (size hints, policies, margins, clipping, ...), or notHandled().
virtual Expected< OverflowFacts > overflowFacts (QObject *object)
 What this integration knows about how object may overflow, or notHandled().
virtual QList< OpenPopup > openPopups (QObject *root)
 The open popups that belong to root or an object below it.
virtual QObjectList movingViews (QWindow *window)
 The views in window still scrolling on their own: a flick, kinetic scrolling, or an animated wheel scroll.
virtual QJsonObject appInfo ()
 Fields this integration adds to app_info's answer, such as the state of a feature it provides.

Detailed Description

Hooks that let a UI toolkit built on QtGui (Qt Widgets, Qt Quick or your own) tell the GUI tools how to grab, hit-test and locate its objects.

Every method has a "not handled" default, so an integration only implements what it knows about. Integrations are consulted in registration order until one handles a request: a hook returns notHandled() for an object that isn't its own, so the next integration is asked, and a failure() for one that is but can't be answered for (it is hidden, say), which ends the search with that error (design 0031).

Member Function Documentation

◆ appInfo()

virtual QJsonObject Sonde::GuiIntegration::appInfo ( )
inlinevirtual

Fields this integration adds to app_info's answer, such as the state of a feature it provides.

Every integration is asked.

Reimplemented in Sonde::anonymous_namespace{quickintegration.cpp}::QuickIntegration.

◆ cellGeometry()

virtual Expected< ScreenRect > Sonde::GuiIntegration::cellGeometry ( QObject * view,
const QModelIndex & index,
ScrollToCell scroll )
inlinevirtual

Where cell index of view view is on screen.

Parameters
viewThe view showing the cell's model.
indexThe cell.
scrollWhether to scroll the view so the cell is visible first.
Returns
Its window and rectangle, notHandled(), or a failure that says why the cell isn't shown.

Reimplemented in Sonde::anonymous_namespace{quickintegration.cpp}::QuickIntegration, and Sonde::anonymous_namespace{widgetsintegration.cpp}::WidgetsIntegration.

◆ children()

virtual Expected< QObjectList > Sonde::GuiIntegration::children ( QObject * object)
inlinevirtual

Visual children of object if they differ from QObject::children(), or notHandled().

Reimplemented in Sonde::anonymous_namespace{quickintegration.cpp}::QuickIntegration.

◆ grabWindow()

virtual Expected< QImage > Sonde::GuiIntegration::grabWindow ( QWindow * window)
inlinevirtual

Renders the window's contents.

Returns
The image, notHandled(), or a failure; the platform's grab (QScreen::grabWindow()) is tried if no integration renders it.

Reimplemented in Sonde::anonymous_namespace{quickintegration.cpp}::QuickIntegration, and Sonde::anonymous_namespace{widgetsintegration.cpp}::WidgetsIntegration.

◆ layoutInfo()

virtual Expected< QJsonObject > Sonde::GuiIntegration::layoutInfo ( QObject * object)
inlinevirtual

Layout facts about object for layout_explain (size hints, policies, margins, clipping, ...), or notHandled().

Reimplemented in Sonde::anonymous_namespace{quickintegration.cpp}::QuickIntegration, and Sonde::anonymous_namespace{widgetsintegration.cpp}::WidgetsIntegration.

◆ model()

virtual Expected< QAbstractItemModel * > Sonde::GuiIntegration::model ( QObject * object)
inlinevirtual

◆ movingViews()

virtual QObjectList Sonde::GuiIntegration::movingViews ( QWindow * window)
inlinevirtual

The views in window still scrolling on their own: a flick, kinetic scrolling, or an animated wheel scroll.

Every integration is asked.

A press on a moving view stops it instead of reaching what is under it, so the input tools wait for these to stop before they reply.

Reimplemented in Sonde::anonymous_namespace{quickintegration.cpp}::QuickIntegration, and Sonde::anonymous_namespace{widgetsintegration.cpp}::WidgetsIntegration.

◆ name()

virtual QString Sonde::GuiIntegration::name ( ) const
pure virtual

◆ objectAt()

virtual Expected< QObject * > Sonde::GuiIntegration::objectAt ( QWindow * window,
const QPointF & pos )
inlinevirtual

◆ objectForWindow()

virtual Expected< QObject * > Sonde::GuiIntegration::objectForWindow ( QWindow * window)
inlinevirtual

The object that represents a top-level window in the object tree (e.g.

its QWidget), or notHandled() to use the QWindow itself.

Reimplemented in Sonde::anonymous_namespace{widgetsintegration.cpp}::WidgetsIntegration.

◆ objectGeometry()

virtual Expected< ScreenRect > Sonde::GuiIntegration::objectGeometry ( QObject * object)
inlinevirtual

Where object is on screen.

Returns
Its window and rectangle, notHandled(), or a failure that says why it isn't shown (hidden, say).

Reimplemented in Sonde::anonymous_namespace{quickintegration.cpp}::QuickIntegration, and Sonde::anonymous_namespace{widgetsintegration.cpp}::WidgetsIntegration.

◆ openPopups()

virtual QList< OpenPopup > Sonde::GuiIntegration::openPopups ( QObject * root)
inlinevirtual

The open popups that belong to root or an object below it.

Every integration is asked, and the lists are joined.

Reimplemented in Sonde::anonymous_namespace{quickintegration.cpp}::QuickIntegration, and Sonde::anonymous_namespace{widgetsintegration.cpp}::WidgetsIntegration.

◆ overflowFacts()

virtual Expected< OverflowFacts > Sonde::GuiIntegration::overflowFacts ( QObject * object)
inlinevirtual

The documentation for this class was generated from the following files: