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 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 &)
Protected Member Functions
CSuplSettings ()
void ConstructL ()
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
enum TSuplSettingsUsage { 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 TInt AddNewServer ( 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 void CancelInitialize ( )

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

Since
S60 3.1

CancelTriggerSession(TInt64)

IMPORT_C TInt CancelTriggerSession ( TInt64 aSessionId )

Parameters

TInt64 aSessionId

ChangePriority(TInt64, TInt, TBool)

IMPORT_C TInt ChangePriority ( TInt64 aSlpId,
TInt aPriority,
TBool aDirection
)

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

void ConstructL ( ) [protected]

By default EPOC constructor is private.

Since
S60 3.1

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.

Since
S60 3.1

Parameters

TDes & aHslpAddress

GetAllSlp(RPointerArray< CServerParams > &)

IMPORT_C TInt GetAllSlp ( 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 TInt GetAllSlp ( 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 TInt GetDefaultIAPName ( TDes & aIapName )

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

Since
S60 5.2

Parameters

TDes & aIapName

GetDefaultServer(CServerParams *)

IMPORT_C TInt GetDefaultServer ( 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 TInt GetEditableFlag ( const TInt64 aSlpId,
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 TInt GetFallBack ( 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 TInt GetIapName ( const TInt64 aSlpId,
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 TInt GetImsi ( 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 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.

Since
S60 5.1

Parameters

TInt64 aSlpId
TDes & aServerAddress

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.

Since
S60 5.1

Parameters

const TInt64 aSlpId
TBool & aEnable

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.

Since
S60 5.1

Parameters

const TInt64 aSlpId
TBool & aSimChangeFlag

GetSlpInfoAddress(const TDesC &, CServerParams *)

IMPORT_C TInt GetSlpInfoAddress ( 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 TInt GetSlpInfoFromId ( const TInt64 aSlpId,
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 TInt GetSuplUsage ( 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 TInt GetTriggerParams ( 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 TInt GetTriggerParams ( TInt64 aSessionId,
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 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.

Since
S60 5.1

Parameters

const TInt64 aSlpId
TBool & aHomeNwFlag

Initialize(TRequestStatus &)

IMPORT_C void Initialize ( 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 TInt IsImsiChanged ( 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 TBool IsSlpExists ( const TInt64 aSlpId )

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 TBool IsSlpExists ( 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 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.

Since
S60 3.1

RemoveServer(const TInt64)

IMPORT_C TInt RemoveServer ( const TInt64 aSlpId )

This method is deletes server entry from SUPL settings storage.

Since
S60 5.1

Parameters

const TInt64 aSlpId

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.

Since

SetAllParameter(const CServerParams *)

IMPORT_C TInt SetAllParameter ( 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 TInt SetDefaultServer ( 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 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.

Since
S60 5.1

Parameters

const TInt64 aSlpId
const TBool aEditFlag

SetFallBack(TBool)

IMPORT_C TInt SetFallBack ( TBool aFallBack )

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 TInt SetIapName ( const TInt64 aSlpId,
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 TInt SetNotificationStatus ( TInt64 aSessionId,
TBool aTriggerNotificationStatus
)

Parameters

TInt64 aSessionId
TBool aTriggerNotificationStatus

SetObserverL(MSuplSettingsObserver &)

IMPORT_C TInt SetObserverL ( 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 TInt SetServerAddress ( const TInt64 aSlpId,
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 TInt SetServerEnabledFlag ( const TInt64 aSlpId,
const TBool aEnable
)

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 TInt SetSessionObserverL ( 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 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.

Since
S60 5.1

Parameters

const TInt64 aSlpId
const TBool aSimChangeFlag

SetSuplUsage(TSuplSettingsUsage)

IMPORT_C TInt SetSuplUsage ( TSuplSettingsUsage aUsage )

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

Since
S60 5.1

Parameters

const TInt64 aSlpId
const TBool aHomeNwFlag

SlpCount(TInt &)

IMPORT_C TInt SlpCount ( 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