NUGU SDK Linux  1.7.6
FocusManagerInterface

Focus Manager Interface. More...

+ Collaboration diagram for FocusManagerInterface:

Classes

struct  NuguClientKit::_FocusConfiguration
 FocusConfiguration. More...
 
class  NuguClientKit::IFocusManager
 IFocusManager. More...
 
class  NuguClientKit::IFocusManagerObserver
 IFocusManagerObserver. More...
 
class  NuguClientKit::IFocusResourceListener
 IFocusResourceListener. More...
 

Macros

#define ALERTS_FOCUS_RELEASE_PRIORITY   300 /** @def Default Alerts Focus Release Priority */
 
#define ALERTS_FOCUS_REQUEST_PRIORITY   200 /** @def Default Alerts Focus Request Priority */
 
#define ALERTS_FOCUS_TYPE   "Alerts" /** @def Default Alerts Focus Type */
 
#define ASR_BEEP_FOCUS_RELEASE_PRIORITY   400 /** @def Default ASR Beep Focus Release Priority */
 
#define ASR_BEEP_FOCUS_REQUEST_PRIORITY   500 /** @def Default ASR Beep Focus Request Priority */
 
#define ASR_BEEP_FOCUS_TYPE   "ASRBeep" /** @def Default ASR Beep Focus Type */
 
#define ASR_DM_FOCUS_RELEASE_PRIORITY   300 /** @def Default ASR DM Focus Release Priority */
 
#define ASR_DM_FOCUS_REQUEST_PRIORITY   400 /** @def Default ASR DM Focus Request Priority */
 
#define ASR_DM_FOCUS_TYPE   "ASRDM" /** @def Default ASR DM Focus Type */
 
#define ASR_USER_FOCUS_RELEASE_PRIORITY   200 /** @def Default ASR User Focus Release Priority */
 
#define ASR_USER_FOCUS_REQUEST_PRIORITY   100 /** @def Default ASR User Focus Request Priority */
 
#define ASR_USER_FOCUS_TYPE   "ASRUser" /** @def Default ASR User Focus Type */
 
#define CALL_FOCUS_RELEASE_PRIORITY   100 /** @def Default Call Focus Release Priority */
 
#define CALL_FOCUS_REQUEST_PRIORITY   100 /** @def Default Call Focus Request Priority */
 
#define CALL_FOCUS_TYPE   "Call" /** @def Default Call Focus Type */
 
#define DUMMY_FOCUS_RELEASE_PRIORITY   500 /** @def Default Dummy Focus Release Priority */
 
#define DUMMY_FOCUS_REQUEST_PRIORITY   600 /** @def Default Dummy Focus Request Priority */
 
#define DUMMY_FOCUS_TYPE   "Dummy" /** @def Default Dummy Focus Type */
 
#define INFO_FOCUS_RELEASE_PRIORITY   300 /** @def Default Information Focus Release Priority */
 
#define INFO_FOCUS_REQUEST_PRIORITY   200 /** @def Default Information Focus Request Priority */
 
#define INFO_FOCUS_TYPE   "Info" /** @def Default Information Focus Type */
 
#define MEDIA_FOCUS_RELEASE_PRIORITY   500 /** @def Default Media Focus Release Priority */
 
#define MEDIA_FOCUS_REQUEST_PRIORITY   300 /** @def Default Media Focus Request Priority */
 
#define MEDIA_FOCUS_TYPE   "Media" /** @def Default Media Focus Type */
 
#define SOUND_FOCUS_RELEASE_PRIORITY   500 /** @def Default Sound Focus Release Priority */
 
#define SOUND_FOCUS_REQUEST_PRIORITY   500 /** @def Default Sound Focus Request Priority */
 
#define SOUND_FOCUS_TYPE   "Sound" /** @def Default Sound Focus Type */
 

Typedefs

typedef struct NuguClientKit::_FocusConfiguration NuguClientKit::FocusConfiguration
 FocusConfiguration.
 

Enumerations

enum class  NuguClientKit::FocusState { FOREGROUND , BACKGROUND , NONE }
 FocusState. More...
 

Functions

virtual void NuguClientKit::IFocusManager::addObserver (IFocusManagerObserver *observer)=0
 Add the Observer object. More...
 
virtual FocusState NuguClientKit::IFocusManager::convertToFocusState (const std::string &state_text)=0
 Convert state text to matched FocusState enum. More...
 
virtual std::string NuguClientKit::IFocusManager::getStateString (FocusState state)=0
 Get state string. More...
 
virtual bool NuguClientKit::IFocusManager::holdFocus (const std::string &type)=0
 Hold focus. If requested to hold focus, the low priority focus is not preempted. More...
 
virtual void NuguClientKit::IFocusManagerObserver::onFocusChanged (const FocusConfiguration &configuration, FocusState state, const std::string &name)=0
 Support to monitor the change of focus state for all resources. More...
 
virtual void NuguClientKit::IFocusResourceListener::onFocusChanged (FocusState state)=0
 Notify the resource of focus state change. More...
 
virtual bool NuguClientKit::IFocusManager::releaseFocus (const std::string &type, const std::string &name)=0
 Release focus. More...
 
virtual void NuguClientKit::IFocusManager::removeObserver (IFocusManagerObserver *observer)=0
 Remove the Observer object. More...
 
virtual bool NuguClientKit::IFocusManager::requestFocus (const std::string &type, const std::string &name, IFocusResourceListener *listener)=0
 Request Focus. More...
 
virtual void NuguClientKit::IFocusManager::setConfigurations (std::vector< FocusConfiguration > &request, std::vector< FocusConfiguration > &release)=0
 Set focus configurations. More...
 
virtual void NuguClientKit::IFocusManager::stopAllFocus ()=0
 Stop all focus.
 
virtual void NuguClientKit::IFocusManager::stopForegroundFocus ()=0
 Stop highest priority of focus that is foreground state.
 
virtual bool NuguClientKit::IFocusManager::unholdFocus (const std::string &type)=0
 Unhold focus. More...
 

Variables

int NuguClientKit::_FocusConfiguration::priority
 
std::string NuguClientKit::_FocusConfiguration::type
 

Detailed Description

Focus Manager Interface.

FocusManager manage focus configuration and focus can be requested or released.

Enumeration Type Documentation

◆ FocusState

FocusState.

Enumerator
FOREGROUND 

The focus is activated

BACKGROUND 

The focus is pending and waiting for release the foreground resource.

NONE 

The focus is released

Function Documentation

◆ onFocusChanged() [1/2]

virtual void NuguClientKit::IFocusResourceListener::onFocusChanged ( FocusState  state)
pure virtual

Notify the resource of focus state change.

Parameters
[in]stateresource's new state

◆ onFocusChanged() [2/2]

virtual void NuguClientKit::IFocusManagerObserver::onFocusChanged ( const FocusConfiguration configuration,
FocusState  state,
const std::string &  name 
)
pure virtual

Support to monitor the change of focus state for all resources.

Parameters
[in]configurationfocus configuration
[in]stateresource's new state
[in]namefocus name

◆ requestFocus()

virtual bool NuguClientKit::IFocusManager::requestFocus ( const std::string &  type,
const std::string &  name,
IFocusResourceListener listener 
)
pure virtual

Request Focus.

Parameters
[in]typefocus type
[in]namefocus name
[in]listenerlistener object
Returns
if the request is success, then true otherwise false

◆ releaseFocus()

virtual bool NuguClientKit::IFocusManager::releaseFocus ( const std::string &  type,
const std::string &  name 
)
pure virtual

Release focus.

Parameters
[in]typefocus type
[in]namefocus name
Returns
if the release is success, then true otherwise false

◆ holdFocus()

virtual bool NuguClientKit::IFocusManager::holdFocus ( const std::string &  type)
pure virtual

Hold focus. If requested to hold focus, the low priority focus is not preempted.

Parameters
[in]typefocus type
Returns
if the hold is success, then true otherwise false

◆ unholdFocus()

virtual bool NuguClientKit::IFocusManager::unholdFocus ( const std::string &  type)
pure virtual

Unhold focus.

Parameters
[in]typefocus type
Returns
if the unhold is success, then true otherwise false

◆ setConfigurations()

virtual void NuguClientKit::IFocusManager::setConfigurations ( std::vector< FocusConfiguration > &  request,
std::vector< FocusConfiguration > &  release 
)
pure virtual

Set focus configurations.

Parameters
[in]requestconfigurations for focus request
[in]releaseconfigurations for focus release

◆ getStateString()

virtual std::string NuguClientKit::IFocusManager::getStateString ( FocusState  state)
pure virtual

Get state string.

Parameters
[in]statefocus state
Returns
state string

◆ convertToFocusState()

virtual FocusState NuguClientKit::IFocusManager::convertToFocusState ( const std::string &  state_text)
pure virtual

Convert state text to matched FocusState enum.

Parameters
[in]state_textstate text
Exceptions
std::out_of_rangeexception thrown if matched FocusState not exist
Returns
FocusState enum

◆ addObserver()

virtual void NuguClientKit::IFocusManager::addObserver ( IFocusManagerObserver observer)
pure virtual

Add the Observer object.

Parameters
[in]observerobserver object

◆ removeObserver()

virtual void NuguClientKit::IFocusManager::removeObserver ( IFocusManagerObserver observer)
pure virtual

Remove the Observer object.

Parameters
[in]observerobserver object

Variable Documentation

◆ type

std::string NuguClientKit::_FocusConfiguration::type

focus type

◆ priority

int NuguClientKit::_FocusConfiguration::priority

focus priority