|
SWILIB API (NSG)
|
Functions for working with phone settings.
Usage: #include <swilib.h> or #include <swilib/settings.h>
Data Structures | |
| struct | REG_CLIENT |
| Structure describing a registry client. More... | |
Typedefs | |
| typedef void(* | SettingsAE_ListenerProc) (int set, const char *entry, const char *keyword) |
| typedef struct REG_CLIENT | REG_CLIENT |
Enumerations | |
| enum | SettingsID { SETTINGS_ID_FAK , SETTINGS_ID_MYMENU , SETTINGS_ID_VIBRALIGHT , SETTINGS_ID_USERPROFILES , SETTINGS_ID_SETUP , SETTINGS_ID_DEVELOPER_MENU , SETTINGS_ID_APIDC_SETUP , SETTINGS_ID_MEDIAPLAYER , SETTINGS_ID_SOUNDRECORDER , SETTINGS_ID_FRDB , SETTINGS_ID_AVATAR , SETTINGS_ID_RADIO , SETTINGS_ID_ORANGEHOMESCREEN } |
| IDs of the settings files. More... | |
| enum | ProfileVolumeTypeID { PROFILE_VOLUME_TYPE_MAIN = 0x12 , PROFILE_VOLUME_TYPE_ALARMCLOCK = 0xD , PROFILE_VOLUME_TYPE_INCALL = 2 } |
| Types of the profile volume. More... | |
Date | |
| void | SetDateTime (const TDate *date, const TTime *time) |
| Update phone date and time. | |
Backlight | |
| void | SaveMaxIllumination (int level) |
| Change maximum backlight level. | |
| void | SetIlluminationoffTimeout (int timeout) |
| Change the backlight timeout (time to OFF). | |
SettingsAE | |
Functions for working with settings in The ".pd" file format is a plain analog of the.ini files:
For example, keyword=value
[entry]
keyword=value
As a ".pd" file, it will look like this: 000022:T:keyword=value1
000028:T:entry.keyword=value2
These values can be accessed like this: int SettingsAE_Read_ws(WSHDR *value, int set_id, char *entry, char *keyword) Get the setting value (WSHDR). | |
| int | SettingsAE_GetFlag (int *value, int set_id, char *entry, char *keyword) |
| Get the setting value (flag 1 or 0). | |
| int | SettingsAE_Read (int *value, int set_id, char *entry, char *keyword) |
| Get the setting value (int). | |
| char ** | SettingsAE_GetEntryList (int set_id) |
| Get a list of record IDs in a settings file. | |
| int | SettingsAE_Read_ws (WSHDR *value, int set_id, char *entry, char *keyword) |
| Get the setting value (WSHDR). | |
| int | SettingsAE_Update (int value, int set_id, char *entry, char *keyword) |
| Set the setting value (int). | |
| int | SettingsAE_Update_ws (WSHDR *value, int set_id, char *entry, char *keyword) |
| Set the setting value (WSHDR). | |
| int | SettingsAE_SetFlag (int value, int set_id, char *entry, char *keyword) |
| Set the setting value (flag 1 or 0). | |
| int | SettingsAE_RemoveEntry (int set_id, char *entry, int flag) |
| Delete an entry and all its values. | |
| void | SettingsAE_RegisterListener (SettingsAE_ListenerProc proc, int set_id, const char *entry, const char *keyword) |
| Register SettingsAE changes listener. | |
| void | SettingsAE_DeregisterListener (SettingsAE_ListenerProc proc, int set_id, const char *entry, const char *keyword) |
| Unregister SettingsAE changes listener. | |
Registry | |
| int | Registry_GetHMIKeyID (char *key) |
| Converting string key to the HMI key ID. | |
| int | Registry_GetResourcePathFromLevel (int hmi_key_id, int start_prio, int *prio, WSHDR *path) |
| Get resource path from the registry. | |
| int | Registry_SetResourcePath (int hmi_key_id, int prio, const WSHDR *path) |
| Set a path to the resource with priority. | |
| int | Registry_DeleteResourcePath (int hmi_key_id, int prio) |
| Remove the path with given priority from the registry. | |
| int | Registry_RegClient (const REG_CLIENT *client) |
| Register a client in the Registry system. | |
| void | Registry_UnregClient (int client_id) |
| Unregister client in the Registry system. | |
PD | |
| uint32_t | ReadValueFromPDFile (uint32_t file_id, const char *key, char *value, uint32_t *size) |
| Get the setting value from PD file. | |
| uint32_t | WriteValueToPDFile (uint32_t file_id, const char *key, const char *value, size_t size) |
| Write the setting value to PD file. | |
Profiles | |
| char | GetProfile (void) |
| Get ID of the active profile. | |
| char * | RamProfileNum (void) |
| Get ID of the active profile. | |
| char | SetProfile (char profile_id) |
| Change profile. | |
| void | getProfileNameByN (WSHDR *name, int profile_id, int unk) |
| Get profile name by ID. | |
| void | getCurrentProfileName (WSHDR *name) |
| Get current profile name. | |
| int | GetProfileVolumeSetting (int profile_id, int type) |
| Get volume from the profile. | |
Ringtones | |
| void | Ringtones_SetState (uint8_t state) |
| Set ringtones state. | |
Low-level functions for settings cache. | |
| int | pdcache_getval (char *value, int maxlen, int set_id, const char *entry, const char *keyword) |
| Get raw setting value from cache. | |
| int | pdcache_setval (const char *value, int set_id, const char *entry, const char *keyword) |
| Set raw setting value to cache. | |
| struct REG_CLIENT |
Definition at line 19 of file settings.h.
| typedef struct REG_CLIENT REG_CLIENT |
Definition at line 21 of file settings.h.
| enum SettingsID |
IDs of the settings files.
Definition at line 26 of file settings.h.
| enum ProfileVolumeTypeID |
Types of the profile volume.
| Enumerator | |
|---|---|
| PROFILE_VOLUME_TYPE_MAIN | Main phone volume. |
| PROFILE_VOLUME_TYPE_ALARMCLOCK | AlarmClock volume. |
| PROFILE_VOLUME_TYPE_INCALL | Incall volume. |
Definition at line 45 of file settings.h.
Update phone date and time.
| date | new date |
| time | new time |
| void SaveMaxIllumination | ( | int | level | ) |
Change maximum backlight level.
This function updates DISPLAY_ILLUMINATION in setup.pd
| level | 0-100 |
| void SetIlluminationoffTimeout | ( | int | timeout | ) |
Change the backlight timeout (time to OFF).
This function updates DISPLAY_ILLUMINATION_TIMEOUT in setup.pd
| timeout | time in seconds |
| int SettingsAE_GetFlag | ( | int * | value, |
| int | set_id, | ||
| char * | entry, | ||
| char * | keyword ) |
Get the setting value (flag 1 or 0).
| value | pointer where the result will be written |
| set_id | settings file id (SettingsID) |
| entry | entry id |
| keyword | key |
| int SettingsAE_Read | ( | int * | value, |
| int | set_id, | ||
| char * | entry, | ||
| char * | keyword ) |
Get the setting value (int).
| value | pointer where the result will be written |
| set_id | settings file id (SettingsID) |
| entry | entry id |
| keyword | key |
| char ** SettingsAE_GetEntryList | ( | int | set_id | ) |
Get a list of record IDs in a settings file.
| set_id | settings file id (SettingsID) |
| int SettingsAE_Read_ws | ( | WSHDR * | value, |
| int | set_id, | ||
| char * | entry, | ||
| char * | keyword ) |
Get the setting value (WSHDR).
| value | pointer where the result will be written |
| set_id | settings file id (SettingsID) |
| entry | entry id |
| keyword | key |
| int SettingsAE_Update | ( | int | value, |
| int | set_id, | ||
| char * | entry, | ||
| char * | keyword ) |
Set the setting value (int).
| value | new value |
| set_id | settings file id (SettingsID) |
| entry | entry id |
| keyword | key |
| int SettingsAE_Update_ws | ( | WSHDR * | value, |
| int | set_id, | ||
| char * | entry, | ||
| char * | keyword ) |
Set the setting value (WSHDR).
| value | new value |
| set_id | settings file id (SettingsID) |
| entry | entry id |
| keyword | key |
| int SettingsAE_SetFlag | ( | int | value, |
| int | set_id, | ||
| char * | entry, | ||
| char * | keyword ) |
Set the setting value (flag 1 or 0).
| value | new value |
| set_id | settings file id (SettingsID) |
| entry | entry id |
| keyword | key |
| int SettingsAE_RemoveEntry | ( | int | set_id, |
| char * | entry, | ||
| int | flag ) |
Delete an entry and all its values.
| set_id | settings file id (SettingsID) |
| entry | entry id |
| flag | unknown |
| void SettingsAE_RegisterListener | ( | SettingsAE_ListenerProc | proc, |
| int | set_id, | ||
| const char * | entry, | ||
| const char * | keyword ) |
Register SettingsAE changes listener.
| proc | callback |
| set_id | settings file id (SettingsID) |
| entry | entry id |
| keyword | key |
| void SettingsAE_DeregisterListener | ( | SettingsAE_ListenerProc | proc, |
| int | set_id, | ||
| const char * | entry, | ||
| const char * | keyword ) |
Unregister SettingsAE changes listener.
| proc | callback |
| set_id | settings file id (SettingsID) |
| entry | entry id |
| keyword | key |
| int Registry_GetHMIKeyID | ( | char * | key | ) |
Converting string key to the HMI key ID.
| key | string like "Wallpaper", "Screensaver", ... |
| int Registry_GetResourcePathFromLevel | ( | int | hmi_key_id, |
| int | start_prio, | ||
| int * | prio, | ||
| WSHDR * | path ) |
Get resource path from the registry.
| hmi_key_id | HMID key ID, see Registry_GetHMIKeyID | |
| start_prio | initial priority for searching in registry | |
| [out] | prio | actual priority of the founded resource path |
| [out] | path | founded resource path |
Set a path to the resource with priority.
| hmi_key_id | HMID key ID, see Registry_GetHMIKeyID |
| prio | priority of this resource path |
| path | path to the resource |
| int Registry_DeleteResourcePath | ( | int | hmi_key_id, |
| int | prio ) |
Remove the path with given priority from the registry.
| hmi_key_id | HMID key ID, see Registry_GetHMIKeyID |
| prio | priority of resource path |
| int Registry_RegClient | ( | const REG_CLIENT * | client | ) |
Register a client in the Registry system.
After successful registration, the client will receive Registry events.
| client | pointer to a REG_CLIENT structure with registration data |
| void Registry_UnregClient | ( | int | client_id | ) |
Unregister client in the Registry system.
| client_id | client ID returned by Registry_RegClient |
| uint32_t ReadValueFromPDFile | ( | uint32_t | file_id, |
| const char * | key, | ||
| char * | value, | ||
| uint32_t * | size ) |
Get the setting value from PD file.
| file_id | unique file id | |
| key | keyword | |
| [out] | value | pointer where the result will be written |
| size | max length, read size will be written in variable |
Write the setting value to PD file.
| file_id | unique file id |
| key | keyword |
| value | new value |
| size | write size |
| char GetProfile | ( | void | ) |
Get ID of the active profile.
| char * RamProfileNum | ( | void | ) |
Get ID of the active profile.
| char SetProfile | ( | char | profile_id | ) |
Change profile.
| profile_id | profile ID |
| void getProfileNameByN | ( | WSHDR * | name, |
| int | profile_id, | ||
| int | unk ) |
Get profile name by ID.
| [out] | name | profile name |
| profile_id | profile ID | |
| unk | set to 0 |
| void getCurrentProfileName | ( | WSHDR * | name | ) |
Get current profile name.
| [out] | name | profile name |
| int GetProfileVolumeSetting | ( | int | profile_id, |
| int | type ) |
Get volume from the profile.
| profile_id | profile ID |
| type | volume type, see ProfileVolumeTypeID |
| void Ringtones_SetState | ( | uint8_t | state | ) |
Set ringtones state.
| state | 1 - on, 0 - off |
| int pdcache_getval | ( | char * | value, |
| int | maxlen, | ||
| int | set_id, | ||
| const char * | entry, | ||
| const char * | keyword ) |
Get raw setting value from cache.
| value | pointer where the result will be written |
| maxlen | maximum size of the value buffer |
| set_id | settings file id (SettingsID) |
| entry | entry id |
| keyword | key |
Set raw setting value to cache.
| value | raw value |
| set_id | settings file id (SettingsID) |
| entry | entry id |
| keyword | key |