CPosNetworkPrivacy Class Reference

class CPosNetworkPrivacy : public CBase

Main class for handling network privacy.

This class controls the access to the Privacy Framework. It contains methods for handling privacy for location requests from the network.

This class also contains functions for configuring the Privacy Framework connection.

In some functions, the client can acquire a request ID. This ID represents the location request. In other functions the request ID is required as an input parameter to specify which location request it is connected to.

Inherits from

Public Member Functions
~CPosNetworkPrivacy ()
IMPORT_C void CancelVerifyLocationRequest ( TInt )
IMPORT_C void CancelVerifyLocationRequest ( TInt , TCancelReason )
IMPORT_C TTimeIntervalMicroSeconds32 ConnectionTimeout ()
IMPORT_C CPosNetworkPrivacy * NewL ()
IMPORT_C void NotifyLocationRequestL (const CPosNetworkPrivacyRequestInfo &, TInt &)
IMPORT_C void NotifyVerificationTimeoutL (const CPosNetworkPrivacyRequestInfo &, TInt , TRequestDecision )
IMPORT_C void PositionUpdateL ( TInt , const TPosition &)
IMPORT_C void SetConnectionTimeout ( TTimeIntervalMicroSeconds32 )
IMPORT_C void VerifyLocationRequestL (const CPosNetworkPrivacyRequestInfo &, TInt &, MPosVerificationObserver &)
IMPORT_C void VerifyLocationRequestL (const CPosNetworkPrivacyRequestInfo &, TInt &, MPosVerificationObserver &, TRequestDecision )
Private Member Functions
CPosNetworkPrivacy ()
CPosNetworkPrivacy (const CPosNetworkPrivacy &)
void ConstructL ()
CPosNetworkPrivacy & operator= (const CPosNetworkPrivacy &)
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 TCancelReason { ECancelReasonNotAvailable  = 0, ECancelReasonTimeout }
enum TRequestDecision { EDecisionNotAvailable  = 0, EDecisionRejected , EDecisionAccepted }
enum TRequestorType { ERequestorClientName , ERequesterId }
Private Attributes
CPosNetworkPrivacyImpl * iImpl

Constructor & Destructor Documentation

CPosNetworkPrivacy()

CPosNetworkPrivacy ( ) [private]

Standard C++ constructor.

CPosNetworkPrivacy(const CPosNetworkPrivacy &)

CPosNetworkPrivacy ( const CPosNetworkPrivacy & ) [private]

Parameters

const CPosNetworkPrivacy &

~CPosNetworkPrivacy()

~CPosNetworkPrivacy ( ) [virtual]

Standard C++ destructor

Member Functions Documentation

CancelVerifyLocationRequest(TInt)

IMPORT_C void CancelVerifyLocationRequest ( TInt aRequestId )
Cancels a verification request. If no outstanding request with the specified ID exists, this call will be ignored.
capability
Location
capability
NetworkServices
capability
ReadDeviceData
capability
CommDD May be used instead of Location AND NetworkServices AND ReadDeviceData

Parameters

TInt aRequestId ID of the verification request to cancel.

CancelVerifyLocationRequest(TInt, TCancelReason)

IMPORT_C void CancelVerifyLocationRequest ( TInt aRequestId,
TCancelReason aCancelReason
)

Cancels a verification request.

If no outstanding request with the specified ID exists, this call will be ignored.

This overload of the cancel function specifies the reason for canceling the verification request.

capability
Location
capability
NetworkServices
capability
ReadDeviceData
capability
CommDD May be used instead of Location AND NetworkServices AND ReadDeviceData

Parameters

TInt aRequestId ID of the verification request to cancel.
TCancelReason aCancelReason The cancel reason.

ConnectionTimeout()

IMPORT_C TTimeIntervalMicroSeconds32 ConnectionTimeout ( ) const

Gets the timeout for the LBS subsystem connection.

If no client activity is registered, the LBS subsystem will be released after the timeout. The connection will be automatically restored when it is needed.

ConstructL()

void ConstructL ( ) [private]

Standard ConstructL

NewL()

IMPORT_C CPosNetworkPrivacy * NewL ( ) [static]

Standard Symbian OS two-phase constructor.

NotifyLocationRequestL(const CPosNetworkPrivacyRequestInfo &, TInt &)

IMPORT_C void NotifyLocationRequestL ( const CPosNetworkPrivacyRequestInfo & aRequestInfo,
TInt & aRequestId
)

Called to notify the phone user of the location request.

If this function is called and CancelVerifyLocationRequest has already been called, the LBS subsystem will treat it as a new location request.

leave
KErrArgument If the length of a requestor exceeds KPosNWMaxRequestorLength.
capability
Location
capability
NetworkServices
capability
ReadDeviceData
capability
CommDD May be used instead of Location AND NetworkServices AND ReadDeviceData

Parameters

const CPosNetworkPrivacyRequestInfo & aRequestInfo Network specific privacy request information.
TInt & aRequestId ID of the request. This can be used to perform more operations on the same request, e.g. PositionUpdateL.

NotifyVerificationTimeoutL(const CPosNetworkPrivacyRequestInfo &, TInt, TRequestDecision)

IMPORT_C void NotifyVerificationTimeoutL ( const CPosNetworkPrivacyRequestInfo & aRequestInfo,
TInt aRequestId,
TRequestDecision aRequestDecision
)

Called to report that a verification timed out.

This function is called by the client if the timeout occurs after the verification in the LBS subsystem was complete AND the timeout policy is different than the decision returned by LBS. It should not be called if * CancelVerifyLocationRequest was used to report the timeout during the verification.

This means that if the verification request is running, the timeout is reported by calling CancelVerifyLocationRequest(requestId, ECancelReasonTimeout) and if the verification is complete, the timeout is reported using this function.

leave
The function leaves with error code KErrArgument if the length of a requestor exceeds KPosNWMaxRequestorLength.
panic
KPosNetworkPrivacyPanicCategory EPosNetworkPrivacyInvalidArgument If aRequestDecision is an invalid value
capability
Location
capability
NetworkServices
capability
ReadDeviceData
capability
CommDD May be used instead of Location AND NetworkServices AND ReadDeviceData

Parameters

const CPosNetworkPrivacyRequestInfo & aRequestInfo Network specific privacy request information.
TInt aRequestId ID obtained in the verification request.
TRequestDecision aRequestDecision The request decision made by the network. If the value is EDecisionNotAvailable, this function will panic.

PositionUpdateL(TInt, const TPosition &)

IMPORT_C void PositionUpdateL ( TInt aRequestId,
const TPosition & aPosition
)

Reports the position acquired in a location request.

This function requires that VerifyLocationRequestL or NotifyLocationRequestL has previously been called for the same location request. The client must therefore specify the request ID acquired in the verification/notification.

If the request ID does not correspond to a known request, this call will be ignored.

capability
Location
capability
NetworkServices
capability
ReadDeviceData
capability
CommDD May be used instead of Location AND NetworkServices AND ReadDeviceData
leave
KErrNotSupported This function is not supported and always leaves with KErrNotSupported

Parameters

TInt aRequestId IN. An unique ID representing the location request.
const TPosition & aPosition IN. The position acquired in the location request.

SetConnectionTimeout(TTimeIntervalMicroSeconds32)

IMPORT_C void SetConnectionTimeout ( TTimeIntervalMicroSeconds32 aTimeout )

Sets a timeout for the connection to the LBS subsystem.

If no client activity is registered, the LBS subsystem connection will be released after the timeout. The connection will be automatically restored when it is needed.

panic
KPosNetworkPrivacyPanicCategory EPosNetworkPrivacyInvalidConnectionTimeout If this value is less than, or equal to zero.

Parameters

TTimeIntervalMicroSeconds32 aTimeout The connection timeout in microseconds.

VerifyLocationRequestL(const CPosNetworkPrivacyRequestInfo &, TInt &, MPosVerificationObserver &)

IMPORT_C void VerifyLocationRequestL ( const CPosNetworkPrivacyRequestInfo & aRequestInfo,
TInt & aRequestId,
MPosVerificationObserver & aObserver
)

Verifies a location request.

This function is asynchronous. On completion, MPosVerificationObserver::HandleVerifyComplete will be called in the passed observer object. The completion code and request ID are passed as parameters.

This function supports multiple outstanding asynchronous requests.

This call completes with code KErrNone if the location request is accepted, KErrAccessDenied if the location request is rejected, otherwise one of the system wide error codes.

The request can be cancelled by calling CancelVerifyLocationRequest with the request ID which was returned by the VerifyLocationRequestL call. In this case the observer will not be notified.

leave
KErrArgument The length of a requestor exceeds KPosNWMaxRequestorLength.
leave
KErrNoMemory Memory cannot be allocated to process the privacy request.
capability
Location
capability
NetworkServices
capability
ReadDeviceData
capability
CommDD May be used instead of Location AND NetworkServices AND ReadDeviceData

Parameters

const CPosNetworkPrivacyRequestInfo & aRequestInfo Network specific privacy request information.
TInt & aRequestId ID of the request. This can be used to cancel the request or to perform more operations on the same request, e.g. PositionUpdateL .
MPosVerificationObserver & aObserver An object observing the completion of the verification request.

VerifyLocationRequestL(const CPosNetworkPrivacyRequestInfo &, TInt &, MPosVerificationObserver &, TRequestDecision)

IMPORT_C void VerifyLocationRequestL ( const CPosNetworkPrivacyRequestInfo & aRequestInfo,
TInt & aRequestId,
MPosVerificationObserver & aObserver,
TRequestDecision aTimeoutStrategy
)

Verifies a location request. In this overload of the verification function, the caller can specify what the decision will be if the network thinks the verification takes too long. The decision is used when the verification is cancelled by the network.

leave
KErrArgument The length of a requestor exceeds KPosNWMaxRequestorLength.
leave
KErrNoMemory Memory cannot be allocated to process the privacy request.
capability
Location
capability
NetworkServices
capability
ReadDeviceData
capability
CommDD May be used instead of Location AND NetworkServices AND ReadDeviceData

Parameters

const CPosNetworkPrivacyRequestInfo & aRequestInfo Network specific privacy request information.
TInt & aRequestId ID of the request. This can be used to cancel the request or to perform more operations on the same request, e.g. PositionUpdateL.
MPosVerificationObserver & aObserver An object observing the completion of the verification request.
TRequestDecision aTimeoutStrategy Specifies whether the request will be accepted or rejected if the verification times out.

operator=(const CPosNetworkPrivacy &)

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

Parameters

const CPosNetworkPrivacy &

Member Enumerations Documentation

Enum TCancelReason

When canceling a verification request, this enum can be used to specify why the verification was cancelled.

Enumerators

ECancelReasonNotAvailable = 0

The cancel reason is not given.

ECancelReasonTimeout

Verification request timed out.

Enum TRequestDecision

Whether a location request is accepted or rejected.

Enumerators

EDecisionNotAvailable = 0

Location request decision is not specified.

EDecisionRejected

Location request is rejected.

EDecisionAccepted

Location request is accepted.

Enum TRequestorType

This enum specifies whether the requestor is a contact or a service.

Enumerators

ERequestorClientName

The requestor is a service.

ERequesterId

The requestor is a contact.

Member Data Documentation

CPosNetworkPrivacyImpl * iImpl

CPosNetworkPrivacyImpl * iImpl [private]