ALPreferenceManager API

NAOqi Core - Overview | API


Namespace : AL


           
            #include <alproxies/alpreferencemanagerproxy.h>

           
          

ALPreferenceManager allows managing the robot preferences. A preference is defined by the tuple:

  • Domain of the preference (for instance ‘com.aldebaran.modules.tts’, ‘com.aldebaran.apps.chess’, ...)
  • Name of the preference (for instance ‘/voice/pitch’, ‘/game/level/default’, ...)
  • Value of the preference (only string data type is currently supported)

These preferences are stored on the robot as well as in the Cloud, where they can also be accessed and modified.

Methods

AL::ALValue ALPreferenceManagerProxy:: getValue ( const std::string& domain , const std::string& name )

Retrieves the value of a preference from its domain and name.

Parameters:
  • domain – Domain of the preference.
  • name – Name of the preference.
Returns:

The value of the preference.

std::list<std::list<ALValue>> ALPreferenceManagerProxy:: getValueList ( const std::string& domain )

Retrieves all the preferences associated to a domain.

Parameters:
  • domain – Domain of the preference.
Returns:

A list containing couples (list of size 2) of preference names and values (example: [ [“/voice/pitch”, “60”], [“/voice/speed”, “20”] ]).

std::list<string> ALPreferenceManagerProxy:: getDomainList ( )

Retrieves the list of defined preference domains.

Returns: An array of domain names.
void ALPreferenceManagerProxy:: importPrefFile ( const std::string& domain , const std::string& applicationName , const std::string& filename , bool override )

Imports an XML Preference files into the preference system.

Parameters:
  • domain – Preferences found in the file will be imported using this domain.
  • applicationName – Will be used to search for the preference file on disk (in location of type <configurationdirectory>/applicationName/filename).
  • filename – Name of the preference XML file.
Override:

In case the preferences found in XML file already exist, if override is true, they will be overridden.

void ALPreferenceManagerProxy:: removeValue ( const std::string& domain , const std::string& name )

Removes a preference.

Parameters:
  • domain – Domain of the preference.
  • name – Name of the preference.
void ALPreferenceManagerProxy:: removeDomainValues ( const std::string& domain )

Remove all the preferences associated to a domain.

Parameters:
  • domain – Domain of the preferences.
void ALPreferenceManagerProxy:: setValue ( const std::string& domain , const std::string& name , const AL::ALValue& value )

Stores a preference.

Parameters:
  • domain – Domain of the preference.
  • name – Name of the preference.
  • value – Value of the preference.
void ALPreferenceManagerProxy:: update ( )

Synchronizes local preferences with preferences stored on a server.

Signals

preferenceAdded ( const AL::ALValue& id )

Raised when a new preference is added to the system.

Parameters:
  • id – An array of two values identifying the preference:
  • id[0] – The preference domain.
  • id[1] – The preference name.
preferenceUpdated ( const AL::ALValue& id )

Raised when the value of a preference has been updated.

Parameters:
  • id – An array of two values identifying the preference:
  • id[0] – The preference domain.
  • id[1] – The preference name.
preferenceRemoved ( const AL::ALValue& id )

Raised when a preference has been removed.

Parameters:
  • id – An array of two values identifying the preference:
  • id[0] – The preference domain.
  • id[1] – The preference name.
preferenceDomainRemoved ( const AL::ALValue& id )

Raised when an entire preference domain has been removed.

Parameters:
  • id – The removed domain.
preferencesSynchronized ( )

Raised when all preferences have been synchronized from the cloud.

Events

Event: "preferenceAdded"
callback ( std::string eventName , const AL::ALValue & id , std::string subscriberIdentifier )

Raised when a new preference is added to the system.

Parameters:
  • eventName ( std::string ) – “preferenceAdded”
  • id – An array of two values identifying the preference:
  • id[0] – The preference domain.
  • id[1] – The preference name.
  • subscriberIdentifier ( std::string ) –
Event: "preferenceChanged"
callback ( std::string eventName , const AL::ALValue & id , std::string subscriberIdentifier )

Raised when the value of a preference has been updated.

Parameters:
  • eventName ( std::string ) – “preferenceChanged”
  • id – An array of two values identifying the preference:
  • id[0] – The preference domain.
  • id[1] – The preference name.
  • subscriberIdentifier ( std::string ) –
Event: "preferenceRemoved"
callback ( std::string eventName , const AL::ALValue & id , std::string subscriberIdentifier )

Raised when a preference has been removed.

Parameters:
  • eventName ( std::string ) – “preferenceRemoved”
  • id – An array of two values identifying the preference:
  • id[0] – The preference domain.
  • id[1] – The preference name.
  • subscriberIdentifier ( std::string ) –
Event: "preferenceDomainRemoved"
callback ( std::string eventName , const AL::ALValue & id , std::string subscriberIdentifier )

Raised when an entire preference domain has been removed.

Parameters:
  • eventName ( std::string ) – “preferenceDomainRemoved”
  • id – The removed domain.
  • subscriberIdentifier ( std::string ) –
Event: "preferenceSynchronized"
callback ( std::string eventName , std::string subscriberIdentifier )

Raised when all preferences have been synchronized from the cloud.