epoc32/include/lbs/lbsprivacycontroller.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/lbs/lbsprivacycontroller.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,207 @@
     1.4 +/*
     1.5 +* Copyright (c) 2009 NTT DOCOMO, INC. All Rights Reserved.
     1.6 +* This component and the accompanying materials are made available
     1.7 +* under the terms of "Eclipse Public License v1.0"
     1.8 +* which accompanies this distribution, and is available
     1.9 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +*
    1.11 +* Initial Contributors:
    1.12 +* NTT DOCOMO, INC. - initial contribution.
    1.13 +* Nokia Corporation - additional changes.
    1.14 +* 
    1.15 +* Contributors:
    1.16 +* 
    1.17 +* Description:
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +/**
    1.22 + @file
    1.23 + @publishedPartner
    1.24 + @released
    1.25 +*/
    1.26 +
    1.27 +#ifndef LBS_PRIVACY_CONTROLLER_H
    1.28 +#define LBS_PRIVACY_CONTROLLER_H
    1.29 +
    1.30 +#include <e32std.h>
    1.31 +
    1.32 +class TLbsExternalRequestInfo;
    1.33 +class TPositionInfo;
    1.34 +class CLbsPrivacyControllerImpl;
    1.35 +
    1.36 +
    1.37 +/**
    1.38 +The mixin class that defines the interface for the LBS privacy 
    1.39 +controller observer.
    1.40 +
    1.41 +@publishedPartner
    1.42 +@released 
    1.43 +
    1.44 +The callbacks defined in this class are called by the LBS system 
    1.45 +when needed, e.g. when a network location request is received, 
    1.46 +when the reference position is received, when the final position 
    1.47 +is calculated and when the request has completed.
    1.48 +*/
    1.49 +class MLbsPrivacyObserver
    1.50 +	{
    1.51 +public:
    1.52 +	/** Contains the user notification action defined by the 
    1.53 +	network location request (MT-LR). This setting may be
    1.54 +	overridden by the setting(s) in the LBS Admin Settings API.
    1.55 +	
    1.56 +	@see CLbsAdmin::TExternalLocateService
    1.57 +	@see CLbsAdmin::TPrivacyTimeoutAction
    1.58 +	*/
    1.59 +	enum TNotificationType
    1.60 +		{
    1.61 +		/** Unused/Unknown notification. */
    1.62 +		ENotifyUnknown = 0,
    1.63 +		/** Accept and notify user.*/
    1.64 +		ENotifyLocationAccepted,
    1.65 +		/** Verify (query user). Accept if no response.*/
    1.66 +		ENotifyAndVerifyLocationAcceptedIfNoReponse,
    1.67 +		/** Verify (query user). Reject if no response.*/
    1.68 +		ENotifyAndVerifyLocationRejectedIfNoReponse,
    1.69 +		/** Reject and notify user.*/
    1.70 +		ENotifyLocationRejected,
    1.71 +		};
    1.72 +
    1.73 +public:
    1.74 +	IMPORT_C virtual TVersion Version();
    1.75 +	
    1.76 +	/**
    1.77 +	Called when a network location request is received by the LBS system.
    1.78 +	The implementer of this function must decide whether the location request 
    1.79 +	is allowed and give the result to the LBS system. The result is passed 
    1.80 +	by calling CPrivacyController::SendRequestVerificationResult().
    1.81 +	
    1.82 +	@param aRequestId Identifies the request within the LBS system.
    1.83 +	@param aRequestInfo Information about the external client making the request.
    1.84 +	  Note that the actual type may be of one the derived classes
    1.85 +	  e.g. TLbsExternalRequestInfo2.
    1.86 +	  The type may be determined by calling ClassType().
    1.87 +	  If the class is of the TLbsExternalRequestInfo2 type, this parameter may be 
    1.88 +	  casted to access the extended information.
    1.89 +	@param aNotificationType The value set by the network for the user notification.
    1.90 +	
    1.91 +	@see TLbsExternalRequestInfo2
    1.92 +	@see TLbsLocClassTypeBase::ClassType()
    1.93 +	*/
    1.94 +	virtual void ProcessNetworkLocationRequest(TUint aRequestId, const TLbsExternalRequestInfo& aRequestInfo, const TNotificationType& aNotificationType) = 0;
    1.95 +	
    1.96 +	/**
    1.97 +	Called whenever a position update is ready while processing a network 
    1.98 +	location request. Typically, it will be called twice:
    1.99 +	1) As soon as the network reference position is available.
   1.100 +	2) As soon as the final calculated position is available.
   1.101 +	
   1.102 +	@param aRequestId Identifies the request within the LBS system.
   1.103 +	@param aPosInfo The latest position data.
   1.104 +	*/
   1.105 +	virtual void ProcessNetworkPositionUpdate(TUint aRequestId, const TPositionInfo& aPosInfo) = 0;
   1.106 +	
   1.107 +	/**
   1.108 +	Called when a network location request (e.g. MT-LR) has been completed.
   1.109 +	
   1.110 +	@param aRequestId Identifies the request within the LBS system.
   1.111 +	@param aReason Contains the reason for the completion of the request.
   1.112 +	               Usually KErrNone, or a standard Symbian error code.
   1.113 +	               KErrNotFound if aRequestId is not a currently 
   1.114 +	               active external location request.
   1.115 +	*/
   1.116 +	virtual void ProcessRequestComplete(TUint aRequestId, TInt aReason) = 0;
   1.117 +	};
   1.118 +
   1.119 +
   1.120 +/**
   1.121 +The mixin class that defines an extended interface for the LBS privacy 
   1.122 +controller observer.
   1.123 +
   1.124 +It should be used only if the start up of a Privacy Controller process 
   1.125 +(platform specific, not a part of LBS) is controlled by the LBS sub-system
   1.126 +by adding the name of the Privacy Controller process to the LBS Root Process
   1.127 +configuration file.
   1.128 +
   1.129 +@see MLbsPrivacyObserver
   1.130 +@see CLbsPrivacyController
   1.131 +
   1.132 +@publishedPartner
   1.133 +@released
   1.134 +*/
   1.135 +class MLbsPrivacyObserver2 : public MLbsPrivacyObserver
   1.136 +	{
   1.137 +public:
   1.138 +	IMPORT_C virtual TVersion Version();
   1.139 +	
   1.140 +	/**
   1.141 +	Called whenever the LBS sub-system is closing down.
   1.142 +	After receiving the call the current process MUST close itself down.
   1.143 +	
   1.144 +	@param aReservedParam Reserved for future extensions.
   1.145 +	*/
   1.146 +	virtual void ProcessCloseDownNotification(TInt32 aReservedParam) = 0;
   1.147 +	};
   1.148 +
   1.149 +
   1.150 +/**
   1.151 +An application can use this class to register itself as the user
   1.152 +privacy controller for the LBS system. 
   1.153 +
   1.154 +The application must supply an implementation of the MLbsPrivacyObserver 
   1.155 +interface so that it can be notified of important events. 
   1.156 +
   1.157 +When it receives the MLbsPrivacyObserver::ProcessNetworkLocationRequest()
   1.158 +notification it must reply by calling 
   1.159 +CLbsPrivacyController::RespondNetworkLocationRequest() to tell the 
   1.160 +LBS system the user response to the network location request.
   1.161 +
   1.162 +If the request was accepted then the application will recieve more 
   1.163 +notifications:
   1.164 +1) MLbsPrivacyObserver::ProcessNetworkPositionUpdate() with the reference
   1.165 +position when the assistance data is received from the network.
   1.166 +2) MLbsPrivacyObserver::ProcessNetworkPositionUpdate() with the calculated
   1.167 +position when it is sent back to the network.
   1.168 +3) MLbsPrivacyObserver::ProcessRequestCompleted() when the application
   1.169 +no longer needs to listen to notifications for that request.
   1.170 +
   1.171 +Each notification contains aRequestId, which identifies each network
   1.172 +location request within the LBS system. It is meant to be used so that
   1.173 +each of the different notifications can be matched to the request they
   1.174 +came from.
   1.175 +*/	
   1.176 +NONSHARABLE_CLASS(CLbsPrivacyController) : public CBase
   1.177 +	{
   1.178 +  public:
   1.179 +  	/** The user response to the network location request dialog. */
   1.180 +  	enum TRequestVerificationResult
   1.181 +  		{
   1.182 +  		/** Unused request. */
   1.183 +  		ERequestUnknown = 0,
   1.184 +  		/** Request accepted (permission granted). */
   1.185 +  	   	ERequestAccepted,
   1.186 +  		/** Request rejected (permission denied). */
   1.187 +  	   	ERequestRejected,
   1.188 +  		/** Tell the Lbs system to ignore the request. Currently not implemented. */
   1.189 +  		ERequestIgnore
   1.190 +  		};
   1.191 +		
   1.192 +public:
   1.193 +	IMPORT_C static CLbsPrivacyController* NewL(MLbsPrivacyObserver& aObserver);
   1.194 +	~CLbsPrivacyController();
   1.195 +	
   1.196 +	IMPORT_C void RespondNetworkLocationRequest(TUint aRequestId, TRequestVerificationResult aResult);
   1.197 +	
   1.198 +	IMPORT_C void CancelNetworkLocationRequest(TUint aRequestId);
   1.199 +
   1.200 +private:
   1.201 +	CLbsPrivacyController();
   1.202 +	void ConstructL(MLbsPrivacyObserver& aObserver);
   1.203 +	
   1.204 +private:
   1.205 +	/** CLbsPrivacyControllerImp* Impl is the internal handle to the Implementation */
   1.206 +	CLbsPrivacyControllerImpl* iImpl;
   1.207 +	};
   1.208 +
   1.209 +	
   1.210 +#endif // LBS_PRIVACY_CONTROLLER_H