epoc32/include/lbs/lbshostsettingsclasstypes.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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 major data type definitions for the LBS Host Settings API.
    15 // 
    16 //
    17 
    18 /**
    19  @file
    20  @publishedPartner
    21  @deprecated 
    22 */
    23 
    24 #ifndef LBSHOSTSETTINGSCLASSTYPES_H_
    25 #define LBSHOSTSETTINGSCLASSTYPES_H_
    26 
    27 #include <e32std.h>
    28 
    29 /**
    30 Class types for TLbsHostSettingsBase and its derived classes
    31  */
    32 enum TLbsHostSettingsClassType
    33 	{
    34 	/**
    35 	Unknown/undefined value 
    36 	*/
    37 	ELbsHostSettingsUnknownClass	= 0x00,
    38 	/**
    39 	Host settings base class type
    40 	*/
    41 	ELbsHostSettingsBaseClass		= 0x01,
    42 	/**
    43 	Host settings SUPL class type
    44 	*/
    45 	ELbsHostSettingsSuplClass		= 0x02,
    46 	/**
    47 	Defined for compiler optimisation
    48 	*/
    49 	ELbsHostSettingsLastClass		= 0xFFFFFFFF
    50 	};
    51 
    52 /**
    53 Type for the ID of a host settings store.
    54 */
    55 typedef TUid TLbsHostStoreId;
    56 /**
    57 Type for the ID of host settings.
    58 */
    59 typedef TUid TLbsHostSettingsId;
    60 /**
    61 Type for the ID of the creator of host settings.
    62 It identifies the creator as (for example) a "control panel" application, or network provisioned.
    63 */
    64 typedef TUid TLbsHostCreatorId;
    65 
    66 /**
    67 Base class for host settings class types. It defines methods to
    68 get the type of the derived host settings class and the size of the derived class.
    69 */
    70 class TLbsHostSettingsClassTypeBase
    71 	{
    72 public:
    73 	IMPORT_C TUint32 ClassType() const;
    74 	IMPORT_C TUint ClassSize() const;
    75 
    76 protected:
    77 	IMPORT_C TLbsHostSettingsClassTypeBase();
    78 
    79 protected:
    80 	/** The type of the derived class */
    81 	TUint32 iClassType;
    82 	/** The size of the derived class */
    83 	TUint iClassSize;
    84 	};
    85 
    86 /**
    87 Base class for host settings that adds a method to get the ID of the settings creator. 
    88 */
    89 class TLbsHostSettingsBase : public TLbsHostSettingsClassTypeBase
    90 	{
    91 public:
    92 	IMPORT_C TLbsHostSettingsBase();
    93 	
    94 	IMPORT_C TLbsHostCreatorId CreatorId() const;
    95 	
    96 	IMPORT_C TLbsHostSettingsId HostSettingsId() const;
    97 	
    98 	IMPORT_C TTime LastModified() const;
    99 public:
   100 	/**
   101 	Sets the creator id
   102 	@param aCreatorId Id to set.
   103 	*/ 
   104 	void SetCreatorId(TLbsHostCreatorId aCreatorId);
   105 	/**
   106 	Sets the host settings id
   107 	@param aId Id to set.
   108 	*/
   109 	void SetHostSettingsId(TLbsHostSettingsId &aId);
   110 	/**
   111 	Set the last modified date of the account.
   112 
   113 	The Date must be in the format YYYYMMDD:HHMMSS.MMMMMM
   114 	*/
   115 	void SetLastModifiedL(const TDesC& aTime);
   116 	/**
   117 	Update the last modified date of the account to be the current time.
   118 	*/  
   119 	void UpdateLastModified();
   120 private:
   121 	TLbsHostSettingsId	iHostSettingsId;
   122 	TLbsHostCreatorId	iCreatorId;
   123 	TTime				iLastModified;
   124 	TUint8	iReserved[20];
   125 	};
   126 
   127 
   128 /**
   129 Maximum length of the array used for KLbsMaxHostNameAddressSize.
   130 This is based on the maximum hostname URL length
   131  */
   132 	
   133 const TInt KLbsMaxHostNameAddressSize = 256;
   134 
   135 /**
   136  * Maximum length of the buffer used for the name setting
   137  */
   138 
   139 const TInt KLbsMaxSettingName = 256;
   140 
   141 /**
   142  * Maximum length of the buffer used for the providerId setting
   143  */
   144 
   145 const TInt KLbsMaxProviderId = 256;
   146 
   147 /** 
   148  * Type for the network address of a SUPL server
   149  */
   150 typedef TBuf8<KLbsMaxHostNameAddressSize> TLbsHostNameAddress;
   151 
   152 /** 
   153  * Type for the name of a SUPL server
   154  */
   155 typedef TBuf8<KLbsMaxSettingName> TLbsHostName;
   156 
   157 /**
   158  *  Type for the location service provider
   159  */
   160 typedef TBuf8<KLbsMaxProviderId> TLbsProviderId;
   161 
   162 /** 
   163  * ConRef ID corresponding to the default setting
   164 */
   165 const TInt KLbsSuplUseDefaultConRefId = -100;
   166 
   167 /** 
   168  * Port ID corresponding to the default setting
   169 */
   170 const TInt KLbsSuplUseDefaultPortId = 7275;
   171 
   172 /**
   173 Abstraction of a SUPL account  
   174 
   175 The class has available data members to store the address, connection type as well
   176 as connection id associated with an account. Getters/seters are also provided
   177 to retrieve/set the connection type and id associated with an account, the operator
   178 identifier, the name and address of the Home SUPL server.   
   179 */
   180 class TLbsHostSettingsSupl : public TLbsHostSettingsBase
   181 	{
   182 public:
   183 	/** Defined type for maintaining Binary Compatibility of the _TAuthModes enumeration. 
   184 	Used to specify a bitmask of allowed authentication mechanisms. */
   185 	typedef TUint32 TAuthModes;
   186 
   187 	/** SUPL authentication mechanisms.
   188 	
   189 	To simplify interactions with a user, a UI (Control Panel) application may offer 
   190         only the following combinations:
   191 	  - EAuthNone & EAuthTls & EAuthAcaTls & EAuthPskTls
   192 	  - EAuthTls & EAuthAcaTls & EAuthPskTls
   193 	  - EAuthAcaTls & EAuthPskTls
   194 	  - EAuthPskTls
   195 	  	  
   196 	and translate them as No, Low, Medium and High Security when interacting with a user.
   197 	It is the responsibility of a SUPL Server to use the highest security level supported 
   198 	by both the Server and the SUPL Protocol Module.
   199 
   200 	Note that the enumeration may be extended in the future by adding more values. 
   201 	To maintain compatibility any unrecognized values must be handled as 
   202 	EAuthUnknown.*/
   203 	enum _TAuthModes
   204 		{
   205 		/** Unknown/undefined value */
   206 		EAuthUnknown = 0x00,
   207 		/** No authentication allowed. */
   208 		EAuthNone    = 0x01,
   209 		/** TLS authentication allowed. */
   210 		EAuthTls	 = 0x02,
   211 		/** TLS + Alternative Client authentication allowed. */
   212 		EAuthAcaTls	 = 0x04,
   213 		/** PSK-TLS authentication allowed. */
   214 		EAuthPskTls	 = 0x08
   215 		};
   216 	 
   217 	/**
   218 	 * Type of connection point to use for the connection to the SUPL server.
   219 	 * Other connection types are expected in the future. 
   220 	 */
   221 	enum TLbsConnectionType
   222 		{
   223 		/** Connection type is invalid */
   224 		ELbsConnectionTypeInvalid = 0x00,
   225 		/** Network access point */
   226 		ELbsConnectionTypeNap = 0x01,
   227 		/** Proxy connection type */
   228 		ELbsConnectionTypeProxy = 0x02
   229 		};
   230 	
   231 	IMPORT_C TLbsHostSettingsSupl();
   232 	
   233 	IMPORT_C void GetHostNameAddress(TDes8& aHostAddress) const;
   234 	IMPORT_C void SetHostNameAddress(const TDesC8& aHostAddress);
   235 
   236 	IMPORT_C void GetConnectionPoint(TInt& aConnectionId, TLbsConnectionType& aConnectionType) const;
   237 	IMPORT_C void SetConnectionPoint(const TInt aConnectionId, const TLbsConnectionType aConnectionType);
   238 		
   239 	IMPORT_C void GetReadOnly(TBool& aReadOnly) const;
   240 	IMPORT_C void SetReadOnly(const TBool aReadOnly);
   241 	
   242 	IMPORT_C void GetPortId(TInt& aPortId) const;
   243 	IMPORT_C void SetPortId(const TInt aPortId);
   244 		
   245 	IMPORT_C void GetName(TDes8& aName) const;
   246 	IMPORT_C void SetName(const TDesC8& aName);
   247 	
   248 	IMPORT_C void GetProviderId(TDes8& aProviderId) const;
   249 	IMPORT_C void SetProviderId(const TDesC8& aProviderId);
   250 	
   251 	IMPORT_C void GetAuthModesMOLR(TAuthModes& aAuthModes) const;
   252 	IMPORT_C void SetAuthModesMOLR(TAuthModes  aAuthModes);
   253 
   254 	IMPORT_C void GetAuthModesMTLR(TAuthModes& aAuthModes) const;
   255 	IMPORT_C void SetAuthModesMTLR(TAuthModes  aAuthModes);
   256 protected:
   257 	/**
   258 	SUPL server host address for these settings
   259 	*/
   260 	TLbsHostNameAddress iHostAddress;
   261 	
   262 	/**
   263 	SUPL server host name
   264 	*/
   265 	TLbsHostName iName;
   266 	
   267 	/**
   268 	Provider of the host settings
   269 	*/
   270 	TLbsProviderId iProviderId;
   271 	
   272 	/**
   273 	Network access point for these host settings
   274 	*/
   275 	TInt    			iConnectionId;
   276 	TLbsConnectionType 	iConnectionType;
   277 	
   278 	/**
   279 	 * Whether the host settings are read only
   280 	*/
   281 	TBool iReadOnly;
   282 	
   283 	/**
   284 	Port to use to connect to SUPL server 
   285 	*/
   286 	TInt iPortId;
   287 	
   288 	/**
   289 	Supported authentication modes for terminal initiated location requests
   290 	*/
   291 	TAuthModes			iAuthModesMOLR;		//includes MOLR-Cell/MOLR-AGPS/MOLR-X3P
   292 	
   293 	/**
   294 	Supported authentication modes for network initiated location requests
   295 	*/
   296 	TAuthModes			iAuthModesMTLR;
   297 	
   298 	/**
   299 	Reserved for future use
   300 	*/
   301 	TUint8				iReserved[20];
   302 	};
   303 
   304 #endif // LBSHOSTSETTINGSCLASSTYPES_H_
   305 
   306