CLbsPrivacyController Class Reference

#include <lbs/lbsprivacycontroller.h>

Link against: lbsprivacycontroller.lib

class CLbsPrivacyController : public CBase

Inherits from

  • CLbsPrivacyController

    Detailed Description

    An application can use this class to register itself as the user privacy controller for the LBS system.

    The application must supply an implementation of the MLbsPrivacyObserver interface so that it can be notified of important events.

    When it receives the MLbsPrivacyObserver::ProcessNetworkLocationRequest() notification it must reply by calling CLbsPrivacyController::RespondNetworkLocationRequest() to tell the LBS system the user response to the network location request.

    If the request was accepted then the application will recieve more notifications: 1) MLbsPrivacyObserver::ProcessNetworkPositionUpdate() with the reference position when the assistance data is received from the network. 2) MLbsPrivacyObserver::ProcessNetworkPositionUpdate() with the calculated position when it is sent back to the network. 3) MLbsPrivacyObserver::ProcessRequestCompleted() when the application no longer needs to listen to notifications for that request.

    Each notification contains aRequestId, which identifies each network location request within the LBS system. It is meant to be used so that each of the different notifications can be matched to the request they came from.

    Member Enumeration Documentation

    Enum TRequestVerificationResult

    The user response to the network location request dialog.

    EnumeratorValueDescription
    ERequestUnknown0

    Unused request.

    ERequestAccepted

    Request accepted (permission granted).

    ERequestRejected

    Request rejected (permission denied).

    ERequestIgnore

    Tell the Lbs system to ignore the request. Currently not implemented.

    Constructor & Destructor Documentation

    ~CLbsPrivacyController ( )

    ~CLbsPrivacyController()

    Standard C++ destructor

    Member Function Documentation

    CancelNetworkLocationRequest ( TUint )

    IMPORT_C voidCancelNetworkLocationRequest(TUintaRequestId)

    Force the LBS system to cancel a currently running network location request, or to reject a request which has not yet been answered.

    If this function is called after CLbsPrivacyController::RespondNetworkLocationRequest() then the LBS system will send a KErrCancel error in the next network Measurement Control message.

    If this function is called before the request has been accepted (by a call to CLbsPrivacyController::RespondNetworkLocationRequest()) the effect is the same as a call to CLbsPrivacyController::RespondNetworkLocationRequest() with the value ERequestRejected.

    If aRequestId is not a currently active external location request then the call is ignored.

    capability
    ECapabilityLocation, ECapabilityWriteDeviceData
    ParameterDescription
    aRequestIdThe Id of the network location request (MT-LR) to cancel.

    NewL ( MLbsPrivacyObserver & )

    IMPORT_C CLbsPrivacyController *NewL(MLbsPrivacyObserver &aObserver)[static]

    Standard Symbian OS two-phase constructor.

    capability
    ECapabilityLocation, ECapabilityReadDeviceData
    ParameterDescription
    aObserverReference to an observer that will be notified when a network location request is recieved by the LBS system.

    Returns: A new CLbsPrivacyController object.

    RespondNetworkLocationRequest ( TUint, TRequestVerificationResult )

    IMPORT_C voidRespondNetworkLocationRequest(TUintaRequestId,
    TRequestVerificationResultaResult
    )

    The application that is listening to network location requests must use this function to give the LBS system the response to the location request.

    The application is first notified of a network location request when MLbsObserver::ProcessNetworkLocationRequest is called. Then it can ask the user for verification if needed, or decide on its own. It must then use this function to tell the LBS system whether to accept or reject the network location request.

    The response can be one of the values of TRequestVerificationResult, usually it will either be ERequestAccepted or ERequestRejected.

    See also: CLbsPrivacyController::TRequestVerificationResult MLbsPrivacyObserver::ProcessNetworkLocationRequest

    capability
    ECapabilityLocation, ECapabilityWriteDeviceData
    ParameterDescription
    aRequestIdIdentifies the request within the LBS system.
    aResultThe response to the network location request.