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:
  • SLP address

  • IAP / destination.

  • SLP enabled / disabled.

  • Remove SLP, when SIM change ( yes / no ).

  • Usage in home network ( yes / no ).

  • Editable ( yes / no).

This is part of epos_suplsettings.lib
Since
S60 5.1

Inherits from

Public Member Functions
~CSuplSettings()
IMPORT_C TIntAddNewServer(const CServerParams *, TInt64 &)
IMPORT_C voidCancelInitialize()
IMPORT_C TIntCancelTriggerSession(TInt64)
IMPORT_C TIntChangePriority(TInt64, TInt, TBool)
IMPORT_C TIntGenerateHslpAddressFromImsi(TDes &)
IMPORT_C TIntGetAllSlp(RPointerArray< CServerParams > &)
IMPORT_C TIntGetAllSlp(RPointerArray< CServerParams > &, TRequestStatus &)
IMPORT_C TIntGetDefaultIAPName(TDes &)
IMPORT_C TIntGetDefaultServer(CServerParams *)
IMPORT_C TIntGetEditableFlag(const TInt64, TBool &)
IMPORT_C TIntGetFallBack(TBool &)
IMPORT_C TIntGetIapName(const TInt64, TDes &)
IMPORT_C TIntGetImsi(TDes &)
IMPORT_C TIntGetServerAddress(TInt64, TDes &)
IMPORT_C TIntGetServerEnabledFlag(const TInt64, TBool &)
IMPORT_C TIntGetSimChangeRemoveFlag(const TInt64, TBool &)
IMPORT_C TIntGetSlpInfoAddress(const TDesC &, CServerParams *)
IMPORT_C TIntGetSlpInfoFromId(const TInt64, CServerParams *)
IMPORT_C TIntGetSuplUsage(TSuplSettingsUsage &)
IMPORT_C TIntGetTriggerParams(RPointerArray< CTriggerParams > &)
IMPORT_C TIntGetTriggerParams(TInt64, CTriggerParams *&)
IMPORT_C TIntGetUsageInHomwNwFlag(const TInt64, TBool &)
IMPORT_C voidInitialize(TRequestStatus &)
IMPORT_C TIntIsImsiChanged(TBool &)
IMPORT_C TBoolIsSlpExists(const TInt64)
IMPORT_C TBoolIsSlpExists(const TDesC &)
IMPORT_C CSuplSettings *NewL()
IMPORT_C CSuplSettings *NewLC()
IMPORT_C voidRemoveObserver()
IMPORT_C TIntRemoveServer(const TInt64)
IMPORT_C voidRemoveSessionObserver()
IMPORT_C TIntSetAllParameter(const CServerParams *)
IMPORT_C TIntSetDefaultServer(const CServerParams *)
IMPORT_C TIntSetEditableFlag(const TInt64, const TBool)
IMPORT_C TIntSetFallBack(TBool)
IMPORT_C TIntSetIapName(const TInt64, const TDesC &)
IMPORT_C TIntSetNotificationStatus(TInt64, TBool)
IMPORT_C TIntSetObserverL(MSuplSettingsObserver &)
IMPORT_C TIntSetServerAddress(const TInt64, const TDesC &)
IMPORT_C TIntSetServerEnabledFlag(const TInt64, const TBool)
IMPORT_C TIntSetSessionObserverL(MSuplSessionObserver &)
IMPORT_C TIntSetSimChangeRemoveFlag(const TInt64, const TBool)
IMPORT_C TIntSetSuplUsage(TSuplSettingsUsage)
IMPORT_C TIntSetUsageInHomwNwFlag(const TInt64, const TBool)
IMPORT_C TIntSlpCount(TInt &)
Protected Member Functions
CSuplSettings()
voidConstructL()
Private Member Functions
CSuplSettings(const CSuplSettings &)
CSuplSettings &operator=(const CSuplSettings &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enumTSuplSettingsUsage { ESuplUsageAlwaysAsk = 0, ESuplUsageAutomatic, ESuplUsageHomeAutomatic, ESuplUsageDisabled }
Protected Attributes
TBool iLocked
CSuplSessionNotifier *iSessionNotifier
CSuplSettingsNotifier *iSettingsDBChangeNotifier
CSuplSettingsEngine *iSettingsEngine
CSuplSettingsNotifier *iSettingsNotifier
TRequestStatus iStatus

Constructor & Destructor Documentation

CSuplSettings()

CSuplSettings()[protected]

C++ default constructor.

Since
S60 3.1

CSuplSettings(const CSuplSettings &)

CSuplSettings(const CSuplSettings &)[private]

Parameters

const CSuplSettings &

~CSuplSettings()

IMPORT_C~CSuplSettings()

Destructor.

Since
S60 3.1

Member Functions Documentation

AddNewServer(const CServerParams *, TInt64 &)

IMPORT_C TIntAddNewServer(const CServerParams *aParamValues,
TInt64 &aSlpId
)

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.

Since
S60 5.1

Parameters

const CServerParams * aParamValues
TInt64 & aSlpId

CancelInitialize()

IMPORT_C voidCancelInitialize()

This method is invoked to cancel CSuplSettings::Initialize() .

Since
S60 3.1

CancelTriggerSession(TInt64)

IMPORT_C TIntCancelTriggerSession(TInt64aSessionId)

Parameters

TInt64 aSessionId

ChangePriority(TInt64, TInt, TBool)

IMPORT_C TIntChangePriority(TInt64aSlpId,
TIntaPriority,
TBoolaDirection
)

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.

Since
S60 5.1

Parameters

TInt64 aSlpId
TInt aPriority
TBool aDirection

ConstructL()

voidConstructL()[protected]

By default EPOC constructor is private.

Since
S60 3.1

GenerateHslpAddressFromImsi(TDes &)

IMPORT_C TIntGenerateHslpAddressFromImsi(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.

Since
S60 3.1

Parameters

TDes & aHslpAddress

GetAllSlp(RPointerArray< CServerParams > &)

IMPORT_C TIntGetAllSlp(RPointerArray< CServerParams > &aParamValues)const

This synchronous method is used to retrieve properties of all servers from SUPL settings storage. This method retrieves all properties for each server.

Since
S60 5.1

Parameters

RPointerArray< CServerParams > & aParamValues

GetAllSlp(RPointerArray< CServerParams > &, TRequestStatus &)

IMPORT_C TIntGetAllSlp(RPointerArray< CServerParams > &aParamValues,
TRequestStatus &aStatus
)const

This method is used to retrieve properties of all servers from SUPL settings storage. This method retrieves all properties for each server.

Since
S60 5.1

Parameters

RPointerArray< CServerParams > & aParamValues
TRequestStatus & aStatus

GetDefaultIAPName(TDes &)

IMPORT_C TIntGetDefaultIAPName(TDes &aIapName)

This method can be used to obtain the default IAP configured.

Since
S60 5.2

Parameters

TDes & aIapName

GetDefaultServer(CServerParams *)

IMPORT_C TIntGetDefaultServer(CServerParams *aParamValues)const

This method is used to retrieve all properties of default server from SUPL settings storage.

Since
S60 5.1

Parameters

CServerParams * aParamValues

GetEditableFlag(const TInt64, TBool &)

IMPORT_C TIntGetEditableFlag(const TInt64aSlpId,
TBool &aEditFlag
)const

This method is used to retrieve parameter which indicates whether server details are editable or not.

Since
S60 5.1

Parameters

const TInt64 aSlpId
TBool & aEditFlag

GetFallBack(TBool &)

IMPORT_C TIntGetFallBack(TBool &aFallBack)const

This method retrieves the fallback value from SUPL settings storage.

Since
S60 5.1

Parameters

TBool & aFallBack

GetIapName(const TInt64, TDes &)

IMPORT_C TIntGetIapName(const TInt64aSlpId,
TDes &aIapName
)const

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.

Since
S60 5.1

Parameters

const TInt64 aSlpId
TDes & aIapName

GetImsi(TDes &)

IMPORT_C TIntGetImsi(TDes &aImsi)

This method returns IMSI obtained during initialization of SUPL settings object. This method should be invoked after Initialize() is completed with KErrNone.

Since
S60 3.1

Parameters

TDes & aImsi

GetServerAddress(TInt64, TDes &)

IMPORT_C TIntGetServerAddress(TInt64aSlpId,
TDes &aServerAddress
)const

This method is used to retrieve server address parameter from server settings. Client has to allocate memory for server address parameter.

Since
S60 5.1

Parameters

TInt64 aSlpId
TDes & aServerAddress

GetServerEnabledFlag(const TInt64, TBool &)

IMPORT_C TIntGetServerEnabledFlag(const TInt64aSlpId,
TBool &aEnable
)const

This method is used to retrieve parameter which indicates whether server can be used for SUPL session or not.

Since
S60 5.1

Parameters

const TInt64 aSlpId
TBool & aEnable

GetSimChangeRemoveFlag(const TInt64, TBool &)

IMPORT_C TIntGetSimChangeRemoveFlag(const TInt64aSlpId,
TBool &aSimChangeFlag
)const

This method is used to retrieve parameter which indicates whether server details can be removed if SIM is changed.

Since
S60 5.1

Parameters

const TInt64 aSlpId
TBool & aSimChangeFlag

GetSlpInfoAddress(const TDesC &, CServerParams *)

IMPORT_C TIntGetSlpInfoAddress(const TDesC &aServerAddress,
CServerParams *aParamValues
)const

This method is used to retrieve all properties of server from SUPL settings storage based on SLP address.

Since
S60 5.1

Parameters

const TDesC & aServerAddress
CServerParams * aParamValues

GetSlpInfoFromId(const TInt64, CServerParams *)

IMPORT_C TIntGetSlpInfoFromId(const TInt64aSlpId,
CServerParams *aParamValues
)const

This method is used to retrieve all properties of server from SUPL settings storage based on SLP identification.

Since
S60 5.1

Parameters

const TInt64 aSlpId
CServerParams * aParamValues

GetSuplUsage(TSuplSettingsUsage &)

IMPORT_C TIntGetSuplUsage(TSuplSettingsUsage &aUsage)const

This method is used to retrieve SUPL usage from settings storage.

Since
S60 3.2

Parameters

TSuplSettingsUsage & aUsage

GetTriggerParams(RPointerArray< CTriggerParams > &)

IMPORT_C TIntGetTriggerParams(RPointerArray< CTriggerParams > &aParamValues)const

This method is used to retrieve properties of all active triggers.

Since
S60 5.2

Parameters

RPointerArray< CTriggerParams > & aParamValues

GetTriggerParams(TInt64, CTriggerParams *&)

IMPORT_C TIntGetTriggerParams(TInt64aSessionId,
CTriggerParams *&aParamValues
)const

This method is used to retrieve properties of a given session trigger.

Since
S60 5.2

Parameters

TInt64 aSessionId
CTriggerParams *& aParamValues

GetUsageInHomwNwFlag(const TInt64, TBool &)

IMPORT_C TIntGetUsageInHomwNwFlag(const TInt64aSlpId,
TBool &aHomeNwFlag
)const

This method is used to retrieve parameter which indicates whether server can be used out side home network or not.

Since
S60 5.1

Parameters

const TInt64 aSlpId
TBool & aHomeNwFlag

Initialize(TRequestStatus &)

IMPORT_C voidInitialize(TRequestStatus &aStatus)

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.

Since
S60 3.1

Parameters

TRequestStatus & aStatus

IsImsiChanged(TBool &)

IMPORT_C TIntIsImsiChanged(TBool &aChanged)

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.

Since
S60 3.1

Parameters

TBool & aChanged

IsSlpExists(const TInt64)

IMPORT_C TBoolIsSlpExists(const TInt64aSlpId)

This method is used check whether server entry exists or not based on SLP identification

Since
S60 5.1

Parameters

const TInt64 aSlpId

IsSlpExists(const TDesC &)

IMPORT_C TBoolIsSlpExists(const TDesC &aServerAddress)

This method is used check whether server entry exists or not based on SLP address

Since
S60 5.1

Parameters

const TDesC & aServerAddress

NewL()

IMPORT_C CSuplSettings *NewL()[static]

Two-phased constructor.

Since
S60 3.1

NewLC()

IMPORT_C CSuplSettings *NewLC()[static]

Two-phased constructor.

Since
S60 5.1

RemoveObserver()

IMPORT_C voidRemoveObserver()

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.

Since
S60 3.1

RemoveServer(const TInt64)

IMPORT_C TIntRemoveServer(const TInt64aSlpId)

This method is deletes server entry from SUPL settings storage.

Since
S60 5.1

Parameters

const TInt64 aSlpId

RemoveSessionObserver()

IMPORT_C voidRemoveSessionObserver()

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.

Since

SetAllParameter(const CServerParams *)

IMPORT_C TIntSetAllParameter(const CServerParams *aParamValues)

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.

Since
S60 5.1

Parameters

const CServerParams * aParamValues

SetDefaultServer(const CServerParams *)

IMPORT_C TIntSetDefaultServer(const CServerParams *aParamValues)

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.

Since
S60 5.1

Parameters

const CServerParams * aParamValues

SetEditableFlag(const TInt64, const TBool)

IMPORT_C TIntSetEditableFlag(const TInt64aSlpId,
const TBoolaEditFlag
)const

This method is used to change parameter which indicates whether server details are editable or not.

Since
S60 5.1

Parameters

const TInt64 aSlpId
const TBool aEditFlag

SetFallBack(TBool)

IMPORT_C TIntSetFallBack(TBoolaFallBack)

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.

Since
S60 5.1

Parameters

TBool aFallBack

SetIapName(const TInt64, const TDesC &)

IMPORT_C TIntSetIapName(const TInt64aSlpId,
const TDesC &aIapName
)

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.

Since
S60 5.1

Parameters

const TInt64 aSlpId
const TDesC & aIapName

SetNotificationStatus(TInt64, TBool)

IMPORT_C TIntSetNotificationStatus(TInt64aSessionId,
TBoolaTriggerNotificationStatus
)

Parameters

TInt64 aSessionId
TBool aTriggerNotificationStatus

SetObserverL(MSuplSettingsObserver &)

IMPORT_C TIntSetObserverL(MSuplSettingsObserver &aObserver)

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() .

Since
S60 3.1

Parameters

MSuplSettingsObserver & aObserver

SetServerAddress(const TInt64, const TDesC &)

IMPORT_C TIntSetServerAddress(const TInt64aSlpId,
const TDesC &aServerAddress
)

This method is used to change server address parameter in server settings

Since
S60 5.1

Parameters

const TInt64 aSlpId
const TDesC & aServerAddress

SetServerEnabledFlag(const TInt64, const TBool)

IMPORT_C TIntSetServerEnabledFlag(const TInt64aSlpId,
const TBoolaEnable
)

This method is used to change parameter which indicates whether server can be used for SUPL session or not.

Since
S60 5.1

Parameters

const TInt64 aSlpId
const TBool aEnable

SetSessionObserverL(MSuplSessionObserver &)

IMPORT_C TIntSetSessionObserverL(MSuplSessionObserver &aObserver)

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() .

Since

Parameters

MSuplSessionObserver & aObserver

SetSimChangeRemoveFlag(const TInt64, const TBool)

IMPORT_C TIntSetSimChangeRemoveFlag(const TInt64aSlpId,
const TBoolaSimChangeFlag
)

This method is used to change parameter which indicates whether server details can be removed if SIM is changed.

Since
S60 5.1

Parameters

const TInt64 aSlpId
const TBool aSimChangeFlag

SetSuplUsage(TSuplSettingsUsage)

IMPORT_C TIntSetSuplUsage(TSuplSettingsUsageaUsage)

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.

Since
S60 3.2

Parameters

TSuplSettingsUsage aUsage

SetUsageInHomwNwFlag(const TInt64, const TBool)

IMPORT_C TIntSetUsageInHomwNwFlag(const TInt64aSlpId,
const TBoolaHomeNwFlag
)

This method is used to change parameter which indicates whether server can be used out side home network or not.

Since
S60 5.1

Parameters

const TInt64 aSlpId
const TBool aHomeNwFlag

SlpCount(TInt &)

IMPORT_C TIntSlpCount(TInt &aCount)

This method is used to retrieve number of server entries present in SUPL settings.

Since
S60 5.1

Parameters

TInt & aCount

operator=(const CSuplSettings &)

CSuplSettings &operator=(const CSuplSettings &)[private]

Parameters

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.

Since
S60 3.2

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

TBool iLocked[protected]

To store whether settings are locked or not

CSuplSessionNotifier * iSessionNotifier

CSuplSessionNotifier *iSessionNotifier[protected]

CSuplSettingsNotifier * iSettingsDBChangeNotifier

CSuplSettingsNotifier *iSettingsDBChangeNotifier[protected]

CSuplSettingsEngine * iSettingsEngine

CSuplSettingsEngine *iSettingsEngine[protected]

Pointer to CSuplSettingsEngine to all settings functions

CSuplSettingsNotifier * iSettingsNotifier

CSuplSettingsNotifier *iSettingsNotifier[protected]

Pointer to notifiers, needed to listen to SUPL settings change events

TRequestStatus iStatus

TRequestStatus iStatus[protected]

To store and retun status for Initialize method