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

Constructor & Destructor Documentation

CPosPrivacyNotifier()

IMPORT_CCPosPrivacyNotifier()[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 voidBaseConstructL(TUidaChannel,
TIntaPriority
)[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 aChannelA channel. See definition in Notifier Framework.
TInt aPriorityA notifier priority. See definition in Notifier Framework.

CancelReason()

IMPORT_C TPosVerifyCancelReasonCancelReason()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 TBoolCheckClientSecureId(TSecureIdaSecureId)

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 aSecureIdThe secureID of the expected client

CompleteAllRequests(TInt)

IMPORT_C voidCompleteAllRequests(TIntaCompletionCode)

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 aCompletionCodeThe request completion code.

CompleteRequest(TPosQNRequestId, TInt)

IMPORT_C voidCompleteRequest(TPosQNRequestIdaRequestId,
TIntaCompletionCode
)

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 aRequestIdThe ID of the privacy query or notification request to complete.
TInt aCompletionCodeThe 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 TPosQNRequestIdCurrentRequest()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 voidGetRequestsL(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 > & aRequestArrayOn return, this array will contain all outstanding query and notification requests.

HandleAllRequestCancelled()

voidHandleAllRequestCancelled()[pure virtual]

This method is called to cancel all outstanding requests.

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

HandleNewRequestL(TPosQNRequestId)

voidHandleNewRequestL(TPosQNRequestIdaRequestId)[pure virtual]

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

Parameters

TPosQNRequestId aRequestIdThe ID of the new query or notification request.

HandleRequestCancelled(TPosQNRequestId)

voidHandleRequestCancelled(TPosQNRequestIdaRequestId)[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 aRequestIdThe ID of the cancelled query or notification request.

LocationRequestDecision()

IMPORT_C TPosRequestDecisionLocationRequestDecision()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 TPosNotificationReasonNotificationReason()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 TPosRequestDecisionQueryTimeoutStrategy()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 TPosRequestSourceRequestSource()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 TRequestTypeRequestTypeL(TPosQNRequestIdaRequestId)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 aRequestIdThe ID of the request to check.

RequestorCountL()

IMPORT_C TIntRequestorCountL()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(TIntaRequestorIndex)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 aRequestorIndexThe index of the requestor.

SetCurrentRequestL(TPosQNRequestId)

IMPORT_C voidSetCurrentRequestL(TPosQNRequestIdaRequestId)

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 aRequestIdThe 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]