OpenAssetIO
An abstract API for generalising interactions between a host application and an asset management system
UIDelegateRequestInterface Class Reference

Abstract interface encapsulating a UI Delegate request that may change over time. More...

#include <UIDelegateRequestInterface.hpp>

Public Types

using Ptr = UIDelegateRequestInterfacePtr
 
using ConstPtr = UIDelegateRequestInterfaceConstPtr
 
using StateChangedCallback = std::function< void(UIDelegateStatePtr)>
 Callback type for the UI delegate to notify the host of state changes. More...
 

Public Member Functions

virtual ~UIDelegateRequestInterface ()=default
 Defaulted destructor. More...
 
virtual std::any nativeData ()
 Arbitrary data object included with the request. More...
 
virtual EntityReferences entityReferences ()
 List of entity references associated with the request. More...
 
virtual trait::TraitsDatas entityTraitsDatas ()
 List of traits and their properties associated with the request. More...
 
virtual std::optional< StateChangedCallbackstateChangedCallback ()
 Callback to be called by the UI delegate to notify the host of state changes. More...
 

Detailed Description

Abstract interface encapsulating a UI Delegate request that may change over time.

The host is expected to subclass this class and implement its methods. Instances are then provided to a UI delegate when initiating a request for UI delegation, and when updating an ongoing request.

This class also holds a callback, which the UI delegate can use to notify the host of relevant updates to the delegated UI's internal state.

Member Typedef Documentation

using StateChangedCallback = std::function<void(UIDelegateStatePtr)>

Callback type for the UI delegate to notify the host of state changes.

Constructor & Destructor Documentation

virtual ~UIDelegateRequestInterface ( )
virtualdefault

Defaulted destructor.

Member Function Documentation

virtual EntityReferences entityReferences ( )
virtual

List of entity references associated with the request.

For example, this could be the "current selection", for which the UI delegate is expected to provide actions or additional information.

The default implementation returns an empty list.

virtual trait::TraitsDatas entityTraitsDatas ( )
virtual

List of traits and their properties associated with the request.

For example, this could be data that's intended to be published, allowing the UI delegate a chance to augment or finesse the published data.

The default implementation returns an empty list.

virtual std::any nativeData ( )
virtual

Arbitrary data object included with the request.

It is up to the host to document what will be placed in here, if anything.

For example, it could be a container widget to be populated by the UI delegate.

Note that for Python UI delegates, this must contain a CPython PyObject*.

The default implementation returns an empty std::any.

virtual std::optional<StateChangedCallback> stateChangedCallback ( )
virtual

Callback to be called by the UI delegate to notify the host of state changes.

For example, when the user selects an entity in a browser.

Note
The state provided to the callback is a reference type, i.e. it may be the same underlying instance as a previous state, so checking equality of successive states is insufficient when computing changes. Instead, extract the relevant elements of a state early (e.g. UIDelegateState::entityReferences()) to use for subsequent comparisons.

The default implementation returns an empty std::optional.


The documentation for this class was generated from the following file:
  • /src/src/openassetio-ui/include/openassetio/ui/hostApi/UIDelegateRequestInterface.hpp