Kanzi  3.9.6
Kanzi Engine API
kanzi::ActivitySourceController Class Reference

Encapsulates the management of data provider for Data-Driven Exclusive Activity Host. More...

#include <kanzi/ui/node/concept/activity/activity_source_controller.hpp>

Public Member Functions

 ActivitySourceController (DataDrivenExclusiveActivityHostConcept &node)
 Constructor. More...
 
DataContextSharedPtr getActivityData (int index) const
 Gets Activity data for index. More...
 
size_t getCount () const
 Gets the number of objects known by the activity source controller in the given activity list source. More...
 
void onActivitySourceDisabled ()
 Disables the internal Activity source list. More...
 
 ~ActivitySourceController ()
 Destructor. More...
 

Detailed Description

Encapsulates the management of data provider for Data-Driven Exclusive Activity Host.

This is a helper class for Data-Driven Exclusive Activity Host classes.

Constructor & Destructor Documentation

◆ ActivitySourceController()

kanzi::ActivitySourceController::ActivitySourceController ( DataDrivenExclusiveActivityHostConcept node)
explicit

Constructor.

Parameters
nodeAn Activity node for which to create the data provider.

◆ ~ActivitySourceController()

kanzi::ActivitySourceController::~ActivitySourceController ( )

Destructor.

Member Function Documentation

◆ getActivityData()

DataContextSharedPtr kanzi::ActivitySourceController::getActivityData ( int  index) const

Gets Activity data for index.

Parameters
indexIndex of item for which data is requested.
Returns
The DataContext object at the given index in the DataObject. An Empty object if the DataObject does not exist for the given index.

◆ getCount()

size_t kanzi::ActivitySourceController::getCount ( ) const

Gets the number of objects known by the activity source controller in the given activity list source.

You can calculate the last index as ('count' - 1).

Returns
The number of objects in the activity list source.

◆ onActivitySourceDisabled()

void kanzi::ActivitySourceController::onActivitySourceDisabled ( )

Disables the internal Activity source list.

This method must be called when the ActivitySourceProperty is removed from the Data-Driven Exclusive Activity Host. ActivitySourceController observes the changes in the ActivitySourceProperty with an internal binding. This binding does not get a notification when the ActivitySourceProperty is removed from the Data-Driven Exclusive Activity Host, hence this method is needed to notify the Data-Driven Exclusive Activity Host. Setting or reattaching the ActivitySourceProperty notifies the ActivitySourceController, eventually updating the Activity source.


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