CPosPrivacyNotifier Class Reference

class CPosPrivacyNotifier : public CBase

Base class for LBS Privacy Query & Notify (Q&N) privacy notifiers.

A privacy notifier is a UI plug-in which handles privacy query and notification requests.

This class contains declarations for event methods that must be implemented by the notifier in order to receive information about new requests or cancelled requests.

It also contains methods for accessing information about a request and for completing a request.

Inherits from

Public Member Functions
~CPosPrivacyNotifier ()
IMPORT_C TPosVerifyCancelReason CancelReason ()
IMPORT_C TBool CheckClientSecureId ( TSecureId )
IMPORT_C void CompleteAllRequests ( TInt )
IMPORT_C void CompleteRequest ( TPosQNRequestId , TInt )
IMPORT_C TPosQNRequestId CurrentRequest ()
IMPORT_C void GetRequestsL ( RArray < TPosQNRequestId > &)
void HandleAllRequestCancelled ()
void HandleNewRequestL ( TPosQNRequestId )
void HandleRequestCancelled ( TPosQNRequestId )
IMPORT_C TPosRequestDecision LocationRequestDecision ()
IMPORT_C TPosNotificationReason NotificationReason ()
IMPORT_C MEikSrvNotifierBase2 * NotifierBase ()
IMPORT_C TPosRequestDecision QueryTimeoutStrategy ()
IMPORT_C TPosRequestSource RequestSource ()
IMPORT_C TRequestType RequestTypeL ( TPosQNRequestId )
IMPORT_C TInt RequestorCountL ()
IMPORT_C CPosRequestor * RequestorLC ( TInt )
IMPORT_C void SetCurrentRequestL ( TPosQNRequestId )
Protected Member Functions
CPosPrivacyNotifier ()
IMPORT_C void BaseConstructL ( TUid , TInt )
Private Member Functions
CPosPrivacyNotifier (const CPosPrivacyNotifier &)
CPosPrivacyNotifier & operator= (const CPosPrivacyNotifier &)
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 TRequestType { EQuery  = 0, ENotification }
Private Attributes
CPosPrivacyNotifierExtension * iExtension

Constructor & Destructor Documentation

CPosPrivacyNotifier()

IMPORT_C CPosPrivacyNotifier ( ) [protected]

Default constructor.

This constructor assumes that the notifier only supports EBasicCapabilities, i.e. the notifier supports queries but only notifications of accepted requests are supported. If the notifier is more advanced, the overloaded constructor should be used.

CPosPrivacyNotifier(const CPosPrivacyNotifier &)

CPosPrivacyNotifier ( const CPosPrivacyNotifier & ) [private]

Parameters

const CPosPrivacyNotifier &

~CPosPrivacyNotifier()

IMPORT_C ~CPosPrivacyNotifier ( ) [virtual]

Member Functions Documentation

BaseConstructL(TUid, TInt)

IMPORT_C void BaseConstructL ( TUid aChannel,
TInt aPriority
) [protected]

Symbian 2nd phase constructor. Must be called first thing during construction.

The notifier must specify channel and priority. These attributes are defined by the Notifier Framework in eiknotapi.h.

The different priority values are defined in MEikSrvNotifierBase2::TNotifierPriority .

MEikSrvNotifierBase2::TNotifierPriority

Parameters

TUid aChannel A channel. See definition in Notifier Framework.
TInt aPriority A notifier priority. See definition in Notifier Framework.

CancelReason()

IMPORT_C TPosVerifyCancelReason CancelReason ( ) const

Retrieves the cancel reason.

Cancel reason can only be retrieved when HandleRequestCancelled or HandleAllRequestCancelled is running. If the method is called at another time, it will return ECancelReasonNotAvailable.

Note that the TCancelReason enum is designed to be extendable, i.e. new values may be added in the future. This means that any unrecognized value must be treated like ECancelReasonNotAvailable.

HandleRequestCancelled() HandleAllRequestCancelled() ECancelReasonNotAvailable TCancelReason

CheckClientSecureId(TSecureId)

IMPORT_C TBool CheckClientSecureId ( TSecureId aSecureId )

Checks that the Privacy UI was launched by the expected client.

The caller specifies the secure ID of the expected client and this method returns whether the Privacy UI was launched by that client or not.

Parameters

TSecureId aSecureId The secureID of the expected client

CompleteAllRequests(TInt)

IMPORT_C void CompleteAllRequests ( TInt aCompletionCode )

This method completes all outstanding requests.

This method can be used to accept or reject all outstanding requests by completing with codes KErrNone or KErrAccessDenied respectively. All notification requests will also be completed with this code.

Parameters

TInt aCompletionCode The request completion code.

CompleteRequest(TPosQNRequestId, TInt)

IMPORT_C void CompleteRequest ( TPosQNRequestId aRequestId,
TInt aCompletionCode
)

This method completes a privacy query or notification request.

If the request is a privacy notification, the completion code should be one of:
  • KErrNone if the phone user dismisses the privacy notification

  • KErrTimedOut if the notification times out.

Parameters

TPosQNRequestId aRequestId The ID of the privacy query or notification request to complete.
TInt aCompletionCode The request completion code. If the request is a privacy query, the completion code should be one of:KErrNone if query is accepted by the phone user.KErrAccessDenied if query is rejected by the phone user.KErrTimedOut if the query times out.

CurrentRequest()

IMPORT_C TPosQNRequestId CurrentRequest ( ) const

Returns the ID of the current request.

Current request specifies the request which will be accessed when RequestorCountL and RequestorLC are called.

RequestorCountL() RequestorLC()

GetRequestsL(RArray< TPosQNRequestId > &)

IMPORT_C void GetRequestsL ( RArray < TPosQNRequestId > & aRequestArray ) const

Returns a list of all outstanding privacy query and notification requests.

If there are no outstanding requests, an empty array will be returned.

Parameters

RArray < TPosQNRequestId > & aRequestArray On return, this array will contain all outstanding query and notification requests.

HandleAllRequestCancelled()

void HandleAllRequestCancelled ( ) [pure virtual]

This method is called to cancel all outstanding requests.

It is not necessary to call CompleteRequest for a cancelled request.

HandleNewRequestL(TPosQNRequestId)

void HandleNewRequestL ( TPosQNRequestId aRequestId ) [pure virtual]

This method is called when a new privacy query or notification has been requested.

Parameters

TPosQNRequestId aRequestId The ID of the new query or notification request.

HandleRequestCancelled(TPosQNRequestId)

void HandleRequestCancelled ( TPosQNRequestId aRequestId ) [pure virtual]

This method is called when a privacy query or notification request is cancelled.

It is not necessary to call CompleteRequest for a cancelled request.

Parameters

TPosQNRequestId aRequestId The ID of the cancelled query or notification request.

LocationRequestDecision()

IMPORT_C TPosRequestDecision LocationRequestDecision ( ) const

Retrieves whether the location request was accepted or rejected.

For notification requests, this method will return the request decision. For queries, this method will return EPosDecisionNotAvailable.

Before calling this method, current request must first be set by calling SetCurrentRequestL, otherwise this method will return EPosDecisionNotAvailable.

Note that the TPosRequestDecision enum is designed to be extendable, i.e. new values may be added in the future. This means that any unrecognized value must be treated like EPosDecisionNotAvailable.

SetCurrentRequestL() TPosRequestDecision

NotificationReason()

IMPORT_C TPosNotificationReason NotificationReason ( ) const

Retrieves the reason for a notification.

Note that the TPosNotificationReason enum is designed to be extendable, i.e. new values may be added in the future. This means that any unrecognized value must be treated like EPosNotificationReasonNotAvailable. If the notification reason is not known, the notification request should be completed with code KErrNotSupported.

Before calling this method, current request must first be set by calling SetCurrentRequestL, otherwise this method will return EPosNotificationReasonNotAvailable.

EPosNotificationReasonNotAvailable SetCurrentRequestL() TPosNotificationReason

NotifierBase()

IMPORT_C MEikSrvNotifierBase2 * NotifierBase ( ) const

Retrieves a handle to the notifier base.

This handle is needed to populate the notifier base array in the notifier factory method.

QueryTimeoutStrategy()

IMPORT_C TPosRequestDecision QueryTimeoutStrategy ( ) const

Retrieves the timeout strategy for a query.

Timeout strategy specifies what the decision will be if the verification query times out. The decision is either EPosDecisionRejected or EPosDecisionAccepted.

Before calling this method, current request must first be set by calling SetCurrentRequestL.

Timeout strategy can only be retrieved for a query request. If the current request is a notification, this method will return EPosDecisionNotAvailable.

Note that the TPosRequestDecision enum is designed to be extendable, i.e. new values may be added in the future. This means that any unrecognized value must be treated like EPosDecisionNotAvailable.

SetCurrentRequestL()

RequestSource()

IMPORT_C TPosRequestSource RequestSource ( ) const

Retrieves the source of the location request.

Before calling this method, current request must first be set by calling SetCurrentRequestL.

Note that the TPosRequestSource enum is designed to be extendable, i.e. new values may be added in the future. This means that any unrecognized value must be treated like EPosRequestSourceNotAvailable.

SetCurrentRequestL() TPosRequestSource

RequestTypeL(TPosQNRequestId)

IMPORT_C TRequestType RequestTypeL ( TPosQNRequestId aRequestId ) const

Checks whether a request is privacy query or notification type.

leave
If the specified request is not an outstanding request, this method will leave with error code KErrNotFound.

Parameters

TPosQNRequestId aRequestId The ID of the request to check.

RequestorCountL()

IMPORT_C TInt RequestorCountL ( ) const

Returns the number of requestors in the current request.

Before calling this method, current request must first be set by calling SetCurrentRequestL.

leave
If the current request has not been set or the current request is no longer valid, e.g. because it has been cancelled or completed, this method will leave with error code KErrNotFound.
SetCurrentRequestL()

RequestorLC(TInt)

IMPORT_C CPosRequestor * RequestorLC ( TInt aRequestorIndex ) const

Returns basic information about the requestor at a specified index.

Before calling this method, current request must first be set by calling SetCurrentRequestL.

Whether the requestor is a contact or a service can be found by calling CPosRequestor::RequestorType .

If the requestor is a contact, the requestor object can be cast to CPosContactRequestor .

If the requestor is a service, the requestor object can be cast to CPosServiceRequestor .

leave
If the specified requestor index is not valid, i.e. less than 0 or larger than or equal to RequestorCountL, this method will leave with error code KErrArgument.
If the current request has not been set or the current request is no longer valid, e.g. because it has been cancelled or completed, this method will leave with error code KErrNotFound.

SetCurrentRequestL() RequestorCountL() CPosContactRequestor CPosServiceRequestor CPosRequestor::RequestorType

Parameters

TInt aRequestorIndex The index of the requestor.

SetCurrentRequestL(TPosQNRequestId)

IMPORT_C void SetCurrentRequestL ( TPosQNRequestId aRequestId )

Sets the request which the notifier wants to read information about.

Current request specifies the request which will be accessed when RequestorCountL and RequestorLC are called.

leave
If the specified request is not an outstanding request, this method will leave with error code KErrNotFound.

Parameters

TPosQNRequestId aRequestId The ID of the current request.

operator=(const CPosPrivacyNotifier &)

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

Parameters

const CPosPrivacyNotifier &

Member Enumerations Documentation

Enum TRequestType

Specifies whether the requested dialog should be a query or a notification dialog.

Enumerators

EQuery = 0

Query dialog requested.

ENotification

Notification dialog requested.

Member Data Documentation

CPosPrivacyNotifierExtension * iExtension

CPosPrivacyNotifierExtension * iExtension [private]