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

Abstract interface encapsulating the UI Delegate state that may change over time. More...

#include <UIDelegateStateInterface.hpp>

Public Types

using Ptr = UIDelegateStateInterfacePtr
 
using ConstPtr = UIDelegateStateInterfaceConstPtr
 
using UpdateRequestCallback = std::function< void(std::optional< UIDelegateRequestPtr >)>
 Callback type for the host to notify the UI delegate of changes to the initial request. More...
 

Public Member Functions

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

Detailed Description

Abstract interface encapsulating the UI Delegate state that may change over time.

The UI Delegate is expected to subclass this class and implement its methods. Instances are then be provided to a host upon initiating a request for UI delegation, and when notifying the host of UI state changes.

This class also holds a callback, which the host can use to update the parameters of the ongoing request.

Member Typedef Documentation

using UpdateRequestCallback = std::function<void(std::optional<UIDelegateRequestPtr>)>

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

Constructor & Destructor Documentation

virtual ~UIDelegateStateInterface ( )
virtualdefault

Defaulted destructor.

Member Function Documentation

virtual EntityReferences entityReferences ( )
virtual

List of entity references considered relevant to the host by the UI delegate.

For example, this could be the entities chosen by the user in a browser.

virtual trait::TraitsDatas entityTraitsDatas ( )
virtual

List of traits and their properties considered relevant to the host by the UI delegate.

For example, this could include additional data to be published, which the host may or may not wish to further process.

virtual std::any nativeData ( )
virtual

Arbitrary data object included with the state.

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

For example, it could be the top-level widget created by the UI delegate, ready to be inserted into the UI hierarchy by the host.

Note that for Python hosts, this must return a CPython PyObject*.

virtual std::optional<UpdateRequestCallback> updateRequestCallback ( )
virtual

Callback to be called by the host to notify the UI delegate that the request has changed.

For example, if the current selection has changed.

If the host calls the callback with an empty optional (None in Python), this notifies the UI delegate that the request is finished (e.g. the UI element is about to be destroyed) and any dangling state should be cleaned up. See also UIDelegateInterface::close.

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

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