AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter Class Reference

#include <TemplateRuntimePresentationAdapter.h>

Inheritance diagram for alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter:
Collaboration graph
[legend]

Public Member Functions

virtual ~TemplateRuntimePresentationAdapter ()=default
 
void setExecutor (std::shared_ptr< avsCommon::utils::threading::Executor > executor)
 
void addTemplateRuntimePresentationAdapterObserver (const std::weak_ptr< TemplateRuntimePresentationAdapterObserverInterface > &observer)
 
void removeTemplateRuntimePresentationAdapterObserver (const std::weak_ptr< TemplateRuntimePresentationAdapterObserverInterface > &observer)
 
void setRenderTemplateWindowId (const std::string &renderTemplateWindowId)
 
void setRenderPlayerInfoWindowId (const std::string &renderPlayerInfoWindowId)
 
void setPresentationOrchestrator (std::shared_ptr< presentationOrchestratorInterfaces::PresentationOrchestratorClientInterface > poClient)
 
PresentationObserverInterface functions
void onPresentationAvailable (presentationOrchestratorInterfaces::PresentationRequestToken id, std::shared_ptr< presentationOrchestratorInterfaces::PresentationInterface > presentation) override
 
void onPresentationStateChanged (presentationOrchestratorInterfaces::PresentationRequestToken id, presentationOrchestratorInterfaces::PresentationState newState) override
 
bool onNavigateBack (presentationOrchestratorInterfaces::PresentationRequestToken id) override
 
TemplateRuntimeObserverInterface functions
void renderTemplateCard (const std::string &jsonPayload) override
 
void renderPlayerInfoCard (const std::string &jsonPayload, templateRuntimeInterfaces::TemplateRuntimeObserverInterface::AudioPlayerInfo audioPlayerInfo) override
 
AudioPlayerObserverInterface Functions
void onPlayerActivityChanged (avsCommon::avs::PlayerActivity state, const acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface::Context &context) override
 
- Public Member Functions inherited from alexaClientSDK::presentationOrchestratorInterfaces::PresentationObserverInterface
virtual ~PresentationObserverInterface ()=default
 
virtual void onPresentationAvailable (PresentationRequestToken id, std::shared_ptr< PresentationInterface > presentation)=0
 
- Public Member Functions inherited from alexaClientSDK::templateRuntimeInterfaces::TemplateRuntimeObserverInterface
virtual ~TemplateRuntimeObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface
virtual ~AudioPlayerObserverInterface ()=default
 
virtual void onSeekActivity (const SeekStatus seekStatus, const Context &context)
 

Static Public Member Functions

static std::shared_ptr< TemplateRuntimePresentationAdaptercreate ()
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface
enum  SeekStatus { SeekStatus::SEEK_START, SeekStatus::SEEK_COMPLETE }
 Enum representing Seek activities. More...
 

Detailed Description

This class interprets the Template Runtime contract for user interface.

Constructor & Destructor Documentation

◆ ~TemplateRuntimePresentationAdapter()

virtual alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::~TemplateRuntimePresentationAdapter ( )
virtualdefault

Destructor

Member Function Documentation

◆ addTemplateRuntimePresentationAdapterObserver()

void alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::addTemplateRuntimePresentationAdapterObserver ( const std::weak_ptr< TemplateRuntimePresentationAdapterObserverInterface > &  observer)

Registers an observer to the adapter for presentation changes.

Parameters
observerInstance of an observer to be notified of any change.

◆ create()

static std::shared_ptr<TemplateRuntimePresentationAdapter> alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::create ( )
static

Create an instance of TemplateRuntimePresentationAdapter

Returns
Shared pointer to the TemplateRuntimePresentationAdapter

◆ onNavigateBack()

bool alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::onNavigateBack ( presentationOrchestratorInterfaces::PresentationRequestToken  id)
overridevirtual

Called by the presentation orchestrator to perform custom back navigation on a presentation if supported

Parameters
idThe identifier for the presentation, as provided when the window was initially requested
Returns
true if the observer handled back navigation, false if the presentation orchestrator should handle back

Implements alexaClientSDK::presentationOrchestratorInterfaces::PresentationObserverInterface.

◆ onPlayerActivityChanged()

void alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::onPlayerActivityChanged ( avsCommon::avs::PlayerActivity  state,
const acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface::Context context 
)
overridevirtual

Used to notify the observer when the AudioPlayer has a change in PlayerActivity.

Parameters
stateThe PlayerActivity of the AudioPlayer.
contextThe Context of the AudioPlayer.

Implements alexaClientSDK::acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface.

◆ onPresentationAvailable()

void alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::onPresentationAvailable ( presentationOrchestratorInterfaces::PresentationRequestToken  id,
std::shared_ptr< presentationOrchestratorInterfaces::PresentationInterface presentation 
)
override

◆ onPresentationStateChanged()

void alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::onPresentationStateChanged ( presentationOrchestratorInterfaces::PresentationRequestToken  id,
presentationOrchestratorInterfaces::PresentationState  newState 
)
overridevirtual

Called when the presentation state has changed

Parameters
idThe identifier for this presentation, as provided when the window was initially requested
newStateThe new presentation state

Implements alexaClientSDK::presentationOrchestratorInterfaces::PresentationObserverInterface.

◆ removeTemplateRuntimePresentationAdapterObserver()

void alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::removeTemplateRuntimePresentationAdapterObserver ( const std::weak_ptr< TemplateRuntimePresentationAdapterObserverInterface > &  observer)

De-registers an observer from the adapter for presentation changes.

Parameters
observerInstance of an observer to be removed.

◆ renderPlayerInfoCard()

void alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::renderPlayerInfoCard ( const std::string &  jsonPayload,
templateRuntimeInterfaces::TemplateRuntimeObserverInterface::AudioPlayerInfo  audioPlayerInfo 
)
overridevirtual

Used to notify the observer when a RenderPlayerInfo directive is received. Once called, the client should render the PlayerInfo display card based on the metadata provided in the payload in structured JSON format.

Parameters
jsonPayloadThe payload of the RenderPlayerInfo directive in structured JSON format.
audioPlayerInfoInformation on the AudioPlayer.

Implements alexaClientSDK::templateRuntimeInterfaces::TemplateRuntimeObserverInterface.

◆ renderTemplateCard()

void alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::renderTemplateCard ( const std::string &  jsonPayload)
overridevirtual

Used to notify the observer when a RenderTemplate directive is received. Once called, the client should render the Template display card based on the metadata provided in the payload in structured JSON format.

Note
The payload may contain customer sensitive information and should be used with utmost care. Failure to do so may result in exposing or mishandling of customer data.
Parameters
jsonPayloadThe payload of the RenderTemplate directive in structured JSON format.

Implements alexaClientSDK::templateRuntimeInterfaces::TemplateRuntimeObserverInterface.

◆ setExecutor()

void alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::setExecutor ( std::shared_ptr< avsCommon::utils::threading::Executor executor)

Set the executor used as the worker thread

Parameters
executorThe Executor to set
Note
This function should only be used for testing purposes. No call to any other method should be done prior to this call.

◆ setPresentationOrchestrator()

void alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::setPresentationOrchestrator ( std::shared_ptr< presentationOrchestratorInterfaces::PresentationOrchestratorClientInterface poClient)

Set the presentation orchestrator

Parameters
poClientpointer to the presentation orchestrator

◆ setRenderPlayerInfoWindowId()

void alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::setRenderPlayerInfoWindowId ( const std::string &  renderPlayerInfoWindowId)

Set the window id to use for render player info card presentations managed by the adapter

Parameters
renderPlayerInfoWindowIdid of the render player info window

◆ setRenderTemplateWindowId()

void alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapter::setRenderTemplateWindowId ( const std::string &  renderTemplateWindowId)

Set the window id to use for render template card presentations managed by the adapter

Parameters
renderTemplateWindowIdid of the render template window

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

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0