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

#include <EndpointAlexaLauncherHandler.h>

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

Public Types

using LaunchHandlerCallback = std::function< void(void)>
 Alias for a callback function for launching target. More...
 

Public Member Functions

bool registerLaunchTargetCallback (const std::string &targetName, LaunchHandlerCallback callback)
 
bool deregisterLaunchTargetCallback (const std::string &targetName)
 
AlexaLauncherInterface methods
acsdkAlexaLauncherInterfaces::AlexaLauncherInterface::Response launchTarget (const acsdkAlexaLauncherInterfaces::TargetState &targetState) override
 
acsdkAlexaLauncherInterfaces::TargetState getLauncherTargetState () override
 
bool addObserver (const std::weak_ptr< acsdkAlexaLauncherInterfaces::AlexaLauncherObserverInterface > &observer) override
 
void removeObserver (const std::weak_ptr< acsdkAlexaLauncherInterfaces::AlexaLauncherObserverInterface > &observer) override
 
- Public Member Functions inherited from alexaClientSDK::acsdkAlexaLauncherInterfaces::AlexaLauncherInterface
virtual ~AlexaLauncherInterface ()=default
 
virtual bool addObserver (const std::weak_ptr< AlexaLauncherObserverInterface > &observer)=0
 
virtual void removeObserver (const std::weak_ptr< AlexaLauncherObserverInterface > &observer)=0
 

Static Public Member Functions

static std::shared_ptr< EndpointAlexaLauncherHandlercreate (const std::string &endpointName)
 

Detailed Description

Sample implementation of an AlexaLauncherInterface.

Member Typedef Documentation

◆ LaunchHandlerCallback

Alias for a callback function for launching target.

Member Function Documentation

◆ addObserver()

bool alexaClientSDK::sampleApplications::common::EndpointAlexaLauncherHandler::addObserver ( const std::weak_ptr< acsdkAlexaLauncherInterfaces::AlexaLauncherObserverInterface > &  observer)
override

◆ create()

static std::shared_ptr<EndpointAlexaLauncherHandler> alexaClientSDK::sampleApplications::common::EndpointAlexaLauncherHandler::create ( const std::string &  endpointName)
static

Create a EndpointAlexaLauncherHandler object.

Parameters
endpointNameThe name of the endpoint.
Returns
A pointer to a new EndpointAlexaLauncherHandler object if it succeeds; otherwise, nullptr.

◆ deregisterLaunchTargetCallback()

bool alexaClientSDK::sampleApplications::common::EndpointAlexaLauncherHandler::deregisterLaunchTargetCallback ( const std::string &  targetName)

De-registers a callback for a given launch target.

Parameters
targetNameName of the target for this callback.
Returns
True if successfully de-registered.

◆ getLauncherTargetState()

acsdkAlexaLauncherInterfaces::TargetState alexaClientSDK::sampleApplications::common::EndpointAlexaLauncherHandler::getLauncherTargetState ( )
overridevirtual

Get the current launcher target on the device.

Note
If AlexaLauncherInterface implementation has configured its instance's property as retrievable, this method should return the current launch target state. Unlike AlexaLauncherObserverInterface observer methods, this returns the current target state at any given point when requested, without a change in target state.
Returns
Return the current TargetState

Implements alexaClientSDK::acsdkAlexaLauncherInterfaces::AlexaLauncherInterface.

◆ launchTarget()

acsdkAlexaLauncherInterfaces::AlexaLauncherInterface::Response alexaClientSDK::sampleApplications::common::EndpointAlexaLauncherHandler::launchTarget ( const acsdkAlexaLauncherInterfaces::TargetState targetState)
overridevirtual

Launch target on the device.

Parameters
targetStateThe target to launch, this can be an app or a GUI shortcut.
Returns
A AlexaLauncherResponse to indicate whether target was successfully launched or encountered an error while launching. AlexaLauncherResponse.responseType should return SUCCESS if there are no errors while launching the target. Otherwise, it should return the corresponding error code along with a log message AlexaLauncherResponse.errorMessage that would be logged in cloud for debugging purposes.

Implements alexaClientSDK::acsdkAlexaLauncherInterfaces::AlexaLauncherInterface.

◆ registerLaunchTargetCallback()

bool alexaClientSDK::sampleApplications::common::EndpointAlexaLauncherHandler::registerLaunchTargetCallback ( const std::string &  targetName,
LaunchHandlerCallback  callback 
)

Registers a callback for a given launch target.

Parameters
targetNameName of the target for this callback.
callbackMethod to call when this target is launched by user.
Returns
True if successfully registered.

◆ removeObserver()

void alexaClientSDK::sampleApplications::common::EndpointAlexaLauncherHandler::removeObserver ( const std::weak_ptr< acsdkAlexaLauncherInterfaces::AlexaLauncherObserverInterface > &  observer)
override

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