AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::captions::CaptionPresenterInterface Class Referenceabstract

#include <CaptionPresenterInterface.h>

Inheritance diagram for alexaClientSDK::captions::CaptionPresenterInterface:
Inheritance graph
[legend]

Public Member Functions

virtual ~CaptionPresenterInterface ()=default
 
virtual void onCaptionActivity (const captions::CaptionFrame &captionFrame, avsCommon::avs::FocusState activityType)=0
 
virtual std::pair< bool, int > getWrapIndex (const captions::CaptionLine &captionLine)=0
 

Detailed Description

An interface to measure lines of styled text and handle requests to show or hide a CaptionFrame.

Constructor & Destructor Documentation

◆ ~CaptionPresenterInterface()

virtual alexaClientSDK::captions::CaptionPresenterInterface::~CaptionPresenterInterface ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getWrapIndex()

virtual std::pair<bool, int> alexaClientSDK::captions::CaptionPresenterInterface::getWrapIndex ( const captions::CaptionLine captionLine)
pure virtual

Determine the display width of the line of text as it would be displayed on a screen.

This function should apply the styles to the text present in the CaptionLine and measure the width as it would be displayed on the screen. If the text is too wide to fit on the display, then return true, along with the character index in captionLine of where the text becomes too wide to fit. This function should also return quickly, as it is potentially called many times to find the correct text wrap points.

Parameters
captionLineThe line of caption text with the styles that apply to that text. application's display and needs to wrap to a new line.
Returns
a pair, the first value is whether a line wrap should occur, the second value indicates zero-indexed character number of where in the captionLine's text the line wrap should occur, which takes effect only if the first value is true. Otherwise return false as the first value.

Implemented in alexaClientSDK::sampleApp::CaptionPresenter, and alexaClientSDK::sampleApplications::ipcServerSampleApp::SmartScreenCaptionPresenter.

◆ onCaptionActivity()

virtual void alexaClientSDK::captions::CaptionPresenterInterface::onCaptionActivity ( const captions::CaptionFrame captionFrame,
avsCommon::avs::FocusState  activityType 
)
pure virtual

Handles a request to show or hide a CaptionFrame.

Parameters
captionFrameThe CaptionFrame which is to be acted upon based on the action described by activityType.
activityTypeThe FocusState to indicate whether to bring the caption to the foreground (show), send them to the background (hide).

Implemented in alexaClientSDK::sampleApp::CaptionPresenter, and alexaClientSDK::sampleApplications::ipcServerSampleApp::SmartScreenCaptionPresenter.


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