CSuplSettings Class Reference
class CSuplSettings : public CBase |
This class is used for accessing SUPL settings. The SUPL settings contains information such about server properties which includes following:
Server address in string format. This is an HSLP address used for SUPL connection. Protocol version in mmnn format where mm indicates minor version nn is major version The Internet Access Point Name refers to the access point which is used to access the HSLP over the internet. This can have maximum size of 100 characters. Manufacturer name of server indicates the server manufacturer. Time stamp when last used. Time stamp when last tried. Network info when the server was last used Network info when the server was last used sucessfully Information on whether server supports emergency support or not Information on whether server supports TLS or not Information on whether server supports PSK-TLS or not Information on whether server enabled or not Information on whether this server entry needs to be deleted when SIM changes Information on whether server can be used in the home network or not Information on whether this server entry can be edited or not SUPL Usage indicates whether user should be notified before using SUPL. Fallback indicates whether fallback is allowed or not if SUPL session fails with default server.
From the abover properties, only following fieds can be changed by SUPL settings client:
This is part of epos_suplsettings.lib
- Since
- S60 5.1
Public Member Functions |
---|
| ~CSuplSettings() |
IMPORT_C TInt | AddNewServer(const CServerParams *, TInt64 &) |
IMPORT_C void | CancelInitialize() |
IMPORT_C TInt | CancelTriggerSession(TInt64) |
IMPORT_C TInt | ChangePriority(TInt64, TInt, TBool) |
IMPORT_C TInt | GenerateHslpAddressFromImsi(TDes &) |
IMPORT_C TInt | GetAllSlp(RPointerArray< CServerParams > &) |
IMPORT_C TInt | GetAllSlp(RPointerArray< CServerParams > &, TRequestStatus &) |
IMPORT_C TInt | GetDefaultIAPName(TDes &) |
IMPORT_C TInt | GetDefaultServer(CServerParams *) |
IMPORT_C TInt | GetEditableFlag(const TInt64, TBool &) |
IMPORT_C TInt | GetFallBack(TBool &) |
IMPORT_C TInt | GetIapName(const TInt64, TDes &) |
IMPORT_C TInt | GetImsi(TDes &) |
IMPORT_C TInt | GetServerAddress(TInt64, TDes &) |
IMPORT_C TInt | GetServerEnabledFlag(const TInt64, TBool &) |
IMPORT_C TInt | GetSimChangeRemoveFlag(const TInt64, TBool &) |
IMPORT_C TInt | GetSlpInfoAddress(const TDesC &, CServerParams *) |
IMPORT_C TInt | GetSlpInfoFromId(const TInt64, CServerParams *) |
IMPORT_C TInt | GetSuplUsage(TSuplSettingsUsage &) |
IMPORT_C TInt | GetTriggerParams(RPointerArray< CTriggerParams > &) |
IMPORT_C TInt | GetTriggerParams(TInt64, CTriggerParams *&) |
IMPORT_C TInt | GetUsageInHomwNwFlag(const TInt64, TBool &) |
IMPORT_C void | Initialize(TRequestStatus &) |
IMPORT_C TInt | IsImsiChanged(TBool &) |
IMPORT_C TBool | IsSlpExists(const TInt64) |
IMPORT_C TBool | IsSlpExists(const TDesC &) |
IMPORT_C CSuplSettings * | NewL() |
IMPORT_C CSuplSettings * | NewLC() |
IMPORT_C void | RemoveObserver() |
IMPORT_C TInt | RemoveServer(const TInt64) |
IMPORT_C void | RemoveSessionObserver() |
IMPORT_C TInt | SetAllParameter(const CServerParams *) |
IMPORT_C TInt | SetDefaultServer(const CServerParams *) |
IMPORT_C TInt | SetEditableFlag(const TInt64, const TBool) |
IMPORT_C TInt | SetFallBack(TBool) |
IMPORT_C TInt | SetIapName(const TInt64, const TDesC &) |
IMPORT_C TInt | SetNotificationStatus(TInt64, TBool) |
IMPORT_C TInt | SetObserverL(MSuplSettingsObserver &) |
IMPORT_C TInt | SetServerAddress(const TInt64, const TDesC &) |
IMPORT_C TInt | SetServerEnabledFlag(const TInt64, const TBool) |
IMPORT_C TInt | SetSessionObserverL(MSuplSessionObserver &) |
IMPORT_C TInt | SetSimChangeRemoveFlag(const TInt64, const TBool) |
IMPORT_C TInt | SetSuplUsage(TSuplSettingsUsage) |
IMPORT_C TInt | SetUsageInHomwNwFlag(const TInt64, const TBool) |
IMPORT_C TInt | SlpCount(TInt &) |
Constructor & Destructor Documentation
CSuplSettings()
CSuplSettings | ( | ) | [protected] |
CSuplSettings(const CSuplSettings &)
Member Functions Documentation
AddNewServer(const CServerParams *, TInt64 &)
This method is used to add new server into settings. It is client's responsibility to set all the parameters in aParamValues except SLP identification. After adding server entry, the server identity generated will be retuned with aSlpId. The returned server identity can be used with other methods change any of server parameters. If server entry with the same server address already presnt, then this method returns error.
CancelInitialize()
IMPORT_C void | CancelInitialize | ( | ) | |
CancelTriggerSession(TInt64)
IMPORT_C TInt | CancelTriggerSession | ( | TInt64 | aSessionId | ) | |
ChangePriority(TInt64, TInt, TBool)
This method changes the priority of the server to the specified priority. Here the priority refers to the order of server entries in the SUPL settings storage. If the priority of server is changed from position N to M and N > M, then the priority of all the server entries from Mth position will get. If the priority of server is changed from position N to M and N < M, then the priority of all servers from N+1 whill get changed. Priority is not valid if the mentioned priority specified beyond the number of number of servers already present in the settings. For example, if the specified priority is N and number of server entries in the settings in M, then N is invalid if N > M.
The parameter aDirection specifies whether the server to be moved up or down. If this has value ETrue server will be moved up. Else server will be moved down.
ConstructL()
void | ConstructL | ( | ) | [protected] |
By default EPOC constructor is private.
GenerateHslpAddressFromImsi(TDes &)
IMPORT_C TInt | GenerateHslpAddressFromImsi | ( | TDes & | aHslpAddress | ) | |
This method can be used to generate HSLP address from the IMSI obtained during initialization. HSLP address in the FQDN format can have maximum size of 256 bytes. Client must allocate enough memory to hold the HSLP address. HSLP address can be generated from IMSI, for example, if HSLP address read from SUPL settings is empty or not valid. The generated HSLP is in the FQDN format and looks like "h-slp.mncXXX.mccYYY.3gppnetwork.org" where XXX and YYY values for MNC and MCC extracted from the IMSI.
This method should be invoked only after Initialize() is completed with KErrNone.
GetAllSlp(RPointerArray< CServerParams > &)
This synchronous method is used to retrieve properties of all servers from SUPL settings storage. This method retrieves all properties for each server.
GetAllSlp(RPointerArray< CServerParams > &, TRequestStatus &)
This method is used to retrieve properties of all servers from SUPL settings storage. This method retrieves all properties for each server.
GetDefaultIAPName(TDes &)
IMPORT_C TInt | GetDefaultIAPName | ( | TDes & | aIapName | ) | |
This method can be used to obtain the default IAP configured.
GetDefaultServer(CServerParams *)
This method is used to retrieve all properties of default server from SUPL settings storage.
GetEditableFlag(const TInt64, TBool &)
This method is used to retrieve parameter which indicates whether server details are editable or not.
GetFallBack(TBool &)
IMPORT_C TInt | GetFallBack | ( | TBool & | aFallBack | ) | const |
This method retrieves the fallback value from SUPL settings storage.
GetIapName(const TInt64, TDes &)
This method is used to retrieve IAP Name in server parameters. IAP name refers to the access point which is used to access the HSLP over the internet. It is client's responsibility to allocate memory for IAP name before invoking this method.
GetImsi(TDes &)
This method returns IMSI obtained during initialization of SUPL settings object. This method should be invoked after Initialize() is completed with KErrNone.
GetServerAddress(TInt64, TDes &)
IMPORT_C TInt | GetServerAddress | ( | TInt64 | aSlpId, |
| TDes & | aServerAddress |
| ) | const |
This method is used to retrieve server address parameter from server settings. Client has to allocate memory for server address parameter.
GetServerEnabledFlag(const TInt64, TBool &)
IMPORT_C TInt | GetServerEnabledFlag | ( | const TInt64 | aSlpId, |
| TBool & | aEnable |
| ) | const |
This method is used to retrieve parameter which indicates whether server can be used for SUPL session or not.
GetSimChangeRemoveFlag(const TInt64, TBool &)
IMPORT_C TInt | GetSimChangeRemoveFlag | ( | const TInt64 | aSlpId, |
| TBool & | aSimChangeFlag |
| ) | const |
This method is used to retrieve parameter which indicates whether server details can be removed if SIM is changed.
GetSlpInfoAddress(const TDesC &, CServerParams *)
This method is used to retrieve all properties of server from SUPL settings storage based on SLP address.
GetSlpInfoFromId(const TInt64, CServerParams *)
This method is used to retrieve all properties of server from SUPL settings storage based on SLP identification.
GetSuplUsage(TSuplSettingsUsage &)
This method is used to retrieve SUPL usage from settings storage.
GetTriggerParams(RPointerArray< CTriggerParams > &)
This method is used to retrieve properties of all active triggers.
GetTriggerParams(TInt64, CTriggerParams *&)
This method is used to retrieve properties of a given session trigger.
GetUsageInHomwNwFlag(const TInt64, TBool &)
IMPORT_C TInt | GetUsageInHomwNwFlag | ( | const TInt64 | aSlpId, |
| TBool & | aHomeNwFlag |
| ) | const |
This method is used to retrieve parameter which indicates whether server can be used out side home network or not.
Initialize(TRequestStatus &)
This method is invoked to initialize SUPL settings object. This is an asynchronous call and client can cancel this request by invoking CancelInitialize() . During initialization, current IMSI value is obtained from the system. Client should invoke this method to re-read the IMSI if the client detects an IMSI change.
Note that if Initialize() method is invoked after started listening to SUPL settings changes by invoking SetObserverL() , listening is not stopped.
IsImsiChanged(TBool &)
This method compares IMSI value currently stored in SUPL settings storage with IMSI value obtained during initialization. If IMSI value obtained during initialization and IMSI value stored in SUPL settings storage are same, this method returns false otherwise true is returned. This method should be invoked after Initialize() is completed with KErrNone.
IsSlpExists(const TInt64)
This method is used check whether server entry exists or not based on SLP identification
IsSlpExists(const TDesC &)
IMPORT_C TBool | IsSlpExists | ( | const TDesC & | aServerAddress | ) | |
This method is used check whether server entry exists or not based on SLP address
Parameters
const TDesC & aServerAddress | |
RemoveObserver()
IMPORT_C void | RemoveObserver | ( | ) | |
This method is used to stop listening for SUPL setting changes. After removing observer, client has to free the memory allocated for the observer. If this method is invoked without setting observer using SetObserverL() method, the request is silently ignored.
RemoveServer(const TInt64)
This method is deletes server entry from SUPL settings storage.
RemoveSessionObserver()
IMPORT_C void | RemoveSessionObserver | ( | ) | |
This method is used to stop listening for SUPL session changes. After removing observer, client has to free the memory allocated for the observer. If this method is invoked without setting observer using SetSessionObserverL() method, the request is silently ignored.
SetAllParameter(const CServerParams *)
This method is used to change all parameters of server in SUPL settings. The server identity in CServerParams which is passed as parameter gives information on for which server entry the values needs to be changed. If the passed server identity does not exists in settings, error is returned.
SetDefaultServer(const CServerParams *)
This method is used to change all parameters of default server in SUPL settings. In this method server identity of CServerParams passed is not considered and values of default server is updated except server identity. If none of the server is set as default, the new server entry will be added and will be marked as default. Client can use GetDefaultSlpId() method to get SLP identity of default server entry.
SetEditableFlag(const TInt64, const TBool)
IMPORT_C TInt | SetEditableFlag | ( | const TInt64 | aSlpId, |
| const TBool | aEditFlag |
| ) | const |
This method is used to change parameter which indicates whether server details are editable or not.
SetFallBack(TBool)
This method enables or disables the fall back in SUPL settings. If the fallback enabled, if the SUPL session fails with default server or with the sever mentioned then fallback will happen to next server in the list or to the server address generated from IMSI depending on the failure type. If the SUPL session has failed due to connection problem with server, then fallback will happen to the address generated from IMSI. In all other failures, fallback will happen to the next server in the list.
SetIapName(const TInt64, const TDesC &)
This method is used to change IAP Name in server parameters. IAP name refers to the access point which is used to access the HSLP over the internet.
SetNotificationStatus(TInt64, TBool)
IMPORT_C TInt | SetNotificationStatus | ( | TInt64 | aSessionId, |
| TBool | aTriggerNotificationStatus |
| ) | |
SetObserverL(MSuplSettingsObserver &)
This method is used to start listening for SUPL setting changes. To listen for changes, the client must implement the MSuplSettingsObserver interface. Client must allocated memory for the observer.
Listening can be stopped by invoking RemoveObserver() .
SetServerAddress(const TInt64, const TDesC &)
IMPORT_C TInt | SetServerAddress | ( | const TInt64 | aSlpId, |
| const TDesC & | aServerAddress |
| ) | |
This method is used to change server address parameter in server settings
SetServerEnabledFlag(const TInt64, const TBool)
This method is used to change parameter which indicates whether server can be used for SUPL session or not.
SetSessionObserverL(MSuplSessionObserver &)
This method is used to start listening for SUPL session changes. To listen for changes, the client must implement the MSuplSessionObserver interface. Client must allocated memory for the observer.
Listening can be stopped by invoking RemoveSessionObserver() .
SetSimChangeRemoveFlag(const TInt64, const TBool)
IMPORT_C TInt | SetSimChangeRemoveFlag | ( | const TInt64 | aSlpId, |
| const TBool | aSimChangeFlag |
| ) | |
This method is used to change parameter which indicates whether server details can be removed if SIM is changed.
SetSuplUsage(TSuplSettingsUsage)
This method is used to change SUPL usage. Using this method, SUPL usage can be set to any of the values specified in the enumeration TSuplSettingsUsage By default, SUPL usage will be set to always ask.
SetUsageInHomwNwFlag(const TInt64, const TBool)
IMPORT_C TInt | SetUsageInHomwNwFlag | ( | const TInt64 | aSlpId, |
| const TBool | aHomeNwFlag |
| ) | |
This method is used to change parameter which indicates whether server can be used out side home network or not.
SlpCount(TInt &)
This method is used to retrieve number of server entries present in SUPL settings.
operator=(const CSuplSettings &)
Member Enumerations Documentation
Enum TSuplSettingsUsage
Enumeration to indicate SUPL usage. This is used as parameter for SetSuplUsage() method. Client has to select one of the values from this enumeration when changing SUPL usage. For example, if client is changing SUPL usage to "always ask", it should select ESuplUsageAlwaysAsk. If SUPL usage is set to ESuplUsageDisabled, SUPL cannot be used.
Client can get SUPL usage using GetSuplUsage() method.
Enumerators
ESuplUsageAlwaysAsk = 0 |
Indicates that user should be asked always before SUPL usage
|
ESuplUsageAutomatic |
Indicates that SUPL can be used without asking user
|
ESuplUsageHomeAutomatic |
Indicates that SUPL can be used without asking user in the home network and user should be notified in the visiting network
|
ESuplUsageDisabled |
Indicates that SUPL usage is disabled
|
Member Data Documentation
TBool
iLocked
To store whether settings are locked or not
CSuplSessionNotifier * iSessionNotifier
CSuplSettingsNotifier * iSettingsDBChangeNotifier
CSuplSettingsEngine * iSettingsEngine
CSuplSettingsNotifier * iSettingsNotifier
Pointer to notifiers, needed to listen to SUPL settings change events
TRequestStatus
iStatus
To store and retun status for Initialize method
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.