networkprotocolmodules/privacyprotocolmodule/ClientAPI/PrivacyRequestAPI/inc/lbsprivacyrequestcommon.h
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This file defines the common data structures used by the
       
    15 // Privacy Request interface. 
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @publishedPartner
       
    22  @prototype
       
    23 */
       
    24 
       
    25 #include <lbs/lbsprivacyrequestclasstypes.h>
       
    26 
       
    27 #ifndef LBSPRVREQUESTCOMMON_H_
       
    28 #define LBSPRVREQUESTCOMMON_H_
       
    29 
       
    30 /**
       
    31 The generic base class for classes that store LBS privacy related information.
       
    32 @publishedPartner
       
    33 @prototype
       
    34 @see TLbsPrivacyRequest
       
    35  */
       
    36 class TLbsPrivacyClassTypeBase
       
    37 	{
       
    38 public:
       
    39 	IMPORT_C TUint32 ClassType() const;
       
    40 	IMPORT_C TUint ClassSize() const;
       
    41 
       
    42 protected:
       
    43 	/**
       
    44 	 Constructor that takes a class type and class size as parameters
       
    45 	 @param aClassType the type of the class
       
    46 	 @param aClassSize the size of the class
       
    47 	 */
       
    48 	inline TLbsPrivacyClassTypeBase(TUint32 aClassType, TUint aClassSize)
       
    49 		: iClassType(aClassType), iClassSize(aClassSize)
       
    50 	{}
       
    51 
       
    52 protected:
       
    53 	/** The type of the derived class.
       
    54 	 @see TLbsPrivacyRequestClassType
       
    55 	 */
       
    56 	TUint32 iClassType;
       
    57 	/** The size of the derived class */
       
    58 	TUint iClassSize;
       
    59 	};
       
    60 
       
    61 
       
    62 /**
       
    63 A class that wraps privacy request parameters.
       
    64 
       
    65 An instance of the class TLbsPrivacyRequest is passed to the LBS subsystem when a local or 
       
    66 remote privacy request is sent via the Privacy Request API. 
       
    67 The class is used to indicate what advice should be given to the user. For example, this may advise
       
    68 that the user is required to verify the request or is simply notified about it.
       
    69 
       
    70 The class also specifies whether the request should be accepted or rejected. In the situation
       
    71 where the user must verify the request, the action is the default behaviour when the user does not respond.
       
    72 
       
    73 For example, if the advice is set to ERequestAdviceVerify and the action is ERequestActionAllow,
       
    74 this indicates that the user should be asked if they wish to accept or reject the request. 
       
    75 However, if the user does not respond, the LBS subsystem should automatically accept the request.
       
    76 
       
    77 Alternatively, the user may be notified that a request has been rejected. In this situation the advice 
       
    78 is set to ERequestAdviceNotify with an action of ERequestActionReject.
       
    79 	
       
    80 @publishedPartner
       
    81 @prototype
       
    82 */
       
    83 class TLbsPrivacyRequest : public TLbsPrivacyClassTypeBase
       
    84 	{
       
    85 public:
       
    86 	/** Defined type for TLbsRequestAdvice */
       
    87 	typedef TUint32 TLbsRequestAdvice;
       
    88 
       
    89 
       
    90  	/** Note that the TLbsRequestAdvice enum may be extended in the future by adding
       
    91  	more enumerated values. To maintain compatibility any unrecognized values 
       
    92  	must be handled as ERequestAdviceNotUsed. */
       
    93 	enum _TLbsRequestAdvice
       
    94 		{
       
    95 				/** Not Used */
       
    96 		ERequestAdviceNotUsed = 0,
       
    97 				/** The LBS subsystem should notify the user that their
       
    98 				location has been requested. */
       
    99 		ERequestAdviceNotify,
       
   100 				/** The LBS subsystem should ask the user if they wish
       
   101 				to accept or reject the request. */
       
   102 		ERequestAdviceVerify,
       
   103 				/** The LBS subsystem should neither notify or query the user if they wish
       
   104 				to accept or reject a request. Details of the request should be logged. */
       
   105 		ERequestAdviceSilent,
       
   106 				/** No indication should be given to a user. The user should neither be 
       
   107 				notified nor queried. In addition, no information about the request should be logged.
       
   108 				This option is defined by some network protocols (e.g. SUPL) but is not implemented
       
   109 				by the LBS subsystem. */
       
   110 		ERequestAdviceStealth
       
   111 		};
       
   112 		
       
   113 
       
   114 	/** Defined type for TLbsRequestAction.*/
       
   115 	typedef TUint32 TLbsRequestAction;
       
   116 
       
   117  	/** Note that the TLbsRequestAction enum may be extended in the future by adding
       
   118  	more enumerated values. To maintain compatibility any unrecognized values 
       
   119  	must be handled as ERequestActionNotUsed. */
       
   120 	enum _TLbsRequestAction 
       
   121 		{
       
   122 				/** Not Used */
       
   123 		ERequestActionNotUsed = 0,
       
   124 				/** The default action for LBS subsystem should be to accept the request.
       
   125 				If this value is passed in combination with ERequestAdviceVerify, it
       
   126 				indicates that the user should be asked if they wish to accept or reject
       
   127 				the request. However, if the user does not respond, the request should
       
   128 				be allowed. 
       
   129 				
       
   130 				In most situations the privacy response of the user should be used to decide
       
   131 				whether to accept a location request. Therefore in most cases a privacy advice
       
   132 				of ERequestAdviceNotify and a privacy action of ERequestActionAllow should
       
   133 				not be used together, although it is not an error to do so.							
       
   134 				*/
       
   135 		ERequestActionAllow,
       
   136 				/** The default action for LBS subsystem should be to reject the request.
       
   137 				If this value is passed in combination with ERequestAdviceVerify, it
       
   138 				indicates that the user should asked if they wish to accept or reject
       
   139 				the request. However, if the user does not respond, the request should
       
   140 				be rejected.
       
   141 		
       
   142 				If ERequestActionReject is passed in combination with ERequestAdviceNotify,
       
   143 				it indicates that the user should be informed that a request has been made
       
   144 				but the terminal should	automatically reject it.
       
   145 				*/
       
   146 		ERequestActionReject,
       
   147 		};
       
   148 	
       
   149 	IMPORT_C TLbsPrivacyRequest();
       
   150 
       
   151 	IMPORT_C TLbsRequestAdvice RequestAdvice() const;
       
   152 	
       
   153 	IMPORT_C TLbsRequestAction RequestAction() const;
       
   154 
       
   155 	IMPORT_C void SetRequestAdvice(TLbsRequestAdvice aAdvice);
       
   156 	
       
   157 	IMPORT_C void SetRequestAction(TLbsRequestAction aAction);
       
   158 	
       
   159 protected:
       
   160 	TLbsRequestAction iAction;
       
   161 	TLbsRequestAdvice iAdvice;
       
   162 	TUint8  iReserved[16];
       
   163 	};
       
   164 
       
   165 
       
   166 #endif // LBSPRVREQUESTCOMMON_H_