epoc32/include/lbs/lbshostsettingsclasstypes.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/lbs/lbshostsettingsclasstypes.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,306 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// 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 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// This file defines the major data type definitions for the LBS Host Settings API.
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +/**
    1.22 + @file
    1.23 + @publishedPartner
    1.24 + @deprecated 
    1.25 +*/
    1.26 +
    1.27 +#ifndef LBSHOSTSETTINGSCLASSTYPES_H_
    1.28 +#define LBSHOSTSETTINGSCLASSTYPES_H_
    1.29 +
    1.30 +#include <e32std.h>
    1.31 +
    1.32 +/**
    1.33 +Class types for TLbsHostSettingsBase and its derived classes
    1.34 + */
    1.35 +enum TLbsHostSettingsClassType
    1.36 +	{
    1.37 +	/**
    1.38 +	Unknown/undefined value 
    1.39 +	*/
    1.40 +	ELbsHostSettingsUnknownClass	= 0x00,
    1.41 +	/**
    1.42 +	Host settings base class type
    1.43 +	*/
    1.44 +	ELbsHostSettingsBaseClass		= 0x01,
    1.45 +	/**
    1.46 +	Host settings SUPL class type
    1.47 +	*/
    1.48 +	ELbsHostSettingsSuplClass		= 0x02,
    1.49 +	/**
    1.50 +	Defined for compiler optimisation
    1.51 +	*/
    1.52 +	ELbsHostSettingsLastClass		= 0xFFFFFFFF
    1.53 +	};
    1.54 +
    1.55 +/**
    1.56 +Type for the ID of a host settings store.
    1.57 +*/
    1.58 +typedef TUid TLbsHostStoreId;
    1.59 +/**
    1.60 +Type for the ID of host settings.
    1.61 +*/
    1.62 +typedef TUid TLbsHostSettingsId;
    1.63 +/**
    1.64 +Type for the ID of the creator of host settings.
    1.65 +It identifies the creator as (for example) a "control panel" application, or network provisioned.
    1.66 +*/
    1.67 +typedef TUid TLbsHostCreatorId;
    1.68 +
    1.69 +/**
    1.70 +Base class for host settings class types. It defines methods to
    1.71 +get the type of the derived host settings class and the size of the derived class.
    1.72 +*/
    1.73 +class TLbsHostSettingsClassTypeBase
    1.74 +	{
    1.75 +public:
    1.76 +	IMPORT_C TUint32 ClassType() const;
    1.77 +	IMPORT_C TUint ClassSize() const;
    1.78 +
    1.79 +protected:
    1.80 +	IMPORT_C TLbsHostSettingsClassTypeBase();
    1.81 +
    1.82 +protected:
    1.83 +	/** The type of the derived class */
    1.84 +	TUint32 iClassType;
    1.85 +	/** The size of the derived class */
    1.86 +	TUint iClassSize;
    1.87 +	};
    1.88 +
    1.89 +/**
    1.90 +Base class for host settings that adds a method to get the ID of the settings creator. 
    1.91 +*/
    1.92 +class TLbsHostSettingsBase : public TLbsHostSettingsClassTypeBase
    1.93 +	{
    1.94 +public:
    1.95 +	IMPORT_C TLbsHostSettingsBase();
    1.96 +	
    1.97 +	IMPORT_C TLbsHostCreatorId CreatorId() const;
    1.98 +	
    1.99 +	IMPORT_C TLbsHostSettingsId HostSettingsId() const;
   1.100 +	
   1.101 +	IMPORT_C TTime LastModified() const;
   1.102 +public:
   1.103 +	/**
   1.104 +	Sets the creator id
   1.105 +	@param aCreatorId Id to set.
   1.106 +	*/ 
   1.107 +	void SetCreatorId(TLbsHostCreatorId aCreatorId);
   1.108 +	/**
   1.109 +	Sets the host settings id
   1.110 +	@param aId Id to set.
   1.111 +	*/
   1.112 +	void SetHostSettingsId(TLbsHostSettingsId &aId);
   1.113 +	/**
   1.114 +	Set the last modified date of the account.
   1.115 +
   1.116 +	The Date must be in the format YYYYMMDD:HHMMSS.MMMMMM
   1.117 +	*/
   1.118 +	void SetLastModifiedL(const TDesC& aTime);
   1.119 +	/**
   1.120 +	Update the last modified date of the account to be the current time.
   1.121 +	*/  
   1.122 +	void UpdateLastModified();
   1.123 +private:
   1.124 +	TLbsHostSettingsId	iHostSettingsId;
   1.125 +	TLbsHostCreatorId	iCreatorId;
   1.126 +	TTime				iLastModified;
   1.127 +	TUint8	iReserved[20];
   1.128 +	};
   1.129 +
   1.130 +
   1.131 +/**
   1.132 +Maximum length of the array used for KLbsMaxHostNameAddressSize.
   1.133 +This is based on the maximum hostname URL length
   1.134 + */
   1.135 +	
   1.136 +const TInt KLbsMaxHostNameAddressSize = 256;
   1.137 +
   1.138 +/**
   1.139 + * Maximum length of the buffer used for the name setting
   1.140 + */
   1.141 +
   1.142 +const TInt KLbsMaxSettingName = 256;
   1.143 +
   1.144 +/**
   1.145 + * Maximum length of the buffer used for the providerId setting
   1.146 + */
   1.147 +
   1.148 +const TInt KLbsMaxProviderId = 256;
   1.149 +
   1.150 +/** 
   1.151 + * Type for the network address of a SUPL server
   1.152 + */
   1.153 +typedef TBuf8<KLbsMaxHostNameAddressSize> TLbsHostNameAddress;
   1.154 +
   1.155 +/** 
   1.156 + * Type for the name of a SUPL server
   1.157 + */
   1.158 +typedef TBuf8<KLbsMaxSettingName> TLbsHostName;
   1.159 +
   1.160 +/**
   1.161 + *  Type for the location service provider
   1.162 + */
   1.163 +typedef TBuf8<KLbsMaxProviderId> TLbsProviderId;
   1.164 +
   1.165 +/** 
   1.166 + * ConRef ID corresponding to the default setting
   1.167 +*/
   1.168 +const TInt KLbsSuplUseDefaultConRefId = -100;
   1.169 +
   1.170 +/** 
   1.171 + * Port ID corresponding to the default setting
   1.172 +*/
   1.173 +const TInt KLbsSuplUseDefaultPortId = 7275;
   1.174 +
   1.175 +/**
   1.176 +Abstraction of a SUPL account  
   1.177 +
   1.178 +The class has available data members to store the address, connection type as well
   1.179 +as connection id associated with an account. Getters/seters are also provided
   1.180 +to retrieve/set the connection type and id associated with an account, the operator
   1.181 +identifier, the name and address of the Home SUPL server.   
   1.182 +*/
   1.183 +class TLbsHostSettingsSupl : public TLbsHostSettingsBase
   1.184 +	{
   1.185 +public:
   1.186 +	/** Defined type for maintaining Binary Compatibility of the _TAuthModes enumeration. 
   1.187 +	Used to specify a bitmask of allowed authentication mechanisms. */
   1.188 +	typedef TUint32 TAuthModes;
   1.189 +
   1.190 +	/** SUPL authentication mechanisms.
   1.191 +	
   1.192 +	To simplify interactions with a user, a UI (Control Panel) application may offer 
   1.193 +        only the following combinations:
   1.194 +	  - EAuthNone & EAuthTls & EAuthAcaTls & EAuthPskTls
   1.195 +	  - EAuthTls & EAuthAcaTls & EAuthPskTls
   1.196 +	  - EAuthAcaTls & EAuthPskTls
   1.197 +	  - EAuthPskTls
   1.198 +	  	  
   1.199 +	and translate them as No, Low, Medium and High Security when interacting with a user.
   1.200 +	It is the responsibility of a SUPL Server to use the highest security level supported 
   1.201 +	by both the Server and the SUPL Protocol Module.
   1.202 +
   1.203 +	Note that the enumeration may be extended in the future by adding more values. 
   1.204 +	To maintain compatibility any unrecognized values must be handled as 
   1.205 +	EAuthUnknown.*/
   1.206 +	enum _TAuthModes
   1.207 +		{
   1.208 +		/** Unknown/undefined value */
   1.209 +		EAuthUnknown = 0x00,
   1.210 +		/** No authentication allowed. */
   1.211 +		EAuthNone    = 0x01,
   1.212 +		/** TLS authentication allowed. */
   1.213 +		EAuthTls	 = 0x02,
   1.214 +		/** TLS + Alternative Client authentication allowed. */
   1.215 +		EAuthAcaTls	 = 0x04,
   1.216 +		/** PSK-TLS authentication allowed. */
   1.217 +		EAuthPskTls	 = 0x08
   1.218 +		};
   1.219 +	 
   1.220 +	/**
   1.221 +	 * Type of connection point to use for the connection to the SUPL server.
   1.222 +	 * Other connection types are expected in the future. 
   1.223 +	 */
   1.224 +	enum TLbsConnectionType
   1.225 +		{
   1.226 +		/** Connection type is invalid */
   1.227 +		ELbsConnectionTypeInvalid = 0x00,
   1.228 +		/** Network access point */
   1.229 +		ELbsConnectionTypeNap = 0x01,
   1.230 +		/** Proxy connection type */
   1.231 +		ELbsConnectionTypeProxy = 0x02
   1.232 +		};
   1.233 +	
   1.234 +	IMPORT_C TLbsHostSettingsSupl();
   1.235 +	
   1.236 +	IMPORT_C void GetHostNameAddress(TDes8& aHostAddress) const;
   1.237 +	IMPORT_C void SetHostNameAddress(const TDesC8& aHostAddress);
   1.238 +
   1.239 +	IMPORT_C void GetConnectionPoint(TInt& aConnectionId, TLbsConnectionType& aConnectionType) const;
   1.240 +	IMPORT_C void SetConnectionPoint(const TInt aConnectionId, const TLbsConnectionType aConnectionType);
   1.241 +		
   1.242 +	IMPORT_C void GetReadOnly(TBool& aReadOnly) const;
   1.243 +	IMPORT_C void SetReadOnly(const TBool aReadOnly);
   1.244 +	
   1.245 +	IMPORT_C void GetPortId(TInt& aPortId) const;
   1.246 +	IMPORT_C void SetPortId(const TInt aPortId);
   1.247 +		
   1.248 +	IMPORT_C void GetName(TDes8& aName) const;
   1.249 +	IMPORT_C void SetName(const TDesC8& aName);
   1.250 +	
   1.251 +	IMPORT_C void GetProviderId(TDes8& aProviderId) const;
   1.252 +	IMPORT_C void SetProviderId(const TDesC8& aProviderId);
   1.253 +	
   1.254 +	IMPORT_C void GetAuthModesMOLR(TAuthModes& aAuthModes) const;
   1.255 +	IMPORT_C void SetAuthModesMOLR(TAuthModes  aAuthModes);
   1.256 +
   1.257 +	IMPORT_C void GetAuthModesMTLR(TAuthModes& aAuthModes) const;
   1.258 +	IMPORT_C void SetAuthModesMTLR(TAuthModes  aAuthModes);
   1.259 +protected:
   1.260 +	/**
   1.261 +	SUPL server host address for these settings
   1.262 +	*/
   1.263 +	TLbsHostNameAddress iHostAddress;
   1.264 +	
   1.265 +	/**
   1.266 +	SUPL server host name
   1.267 +	*/
   1.268 +	TLbsHostName iName;
   1.269 +	
   1.270 +	/**
   1.271 +	Provider of the host settings
   1.272 +	*/
   1.273 +	TLbsProviderId iProviderId;
   1.274 +	
   1.275 +	/**
   1.276 +	Network access point for these host settings
   1.277 +	*/
   1.278 +	TInt    			iConnectionId;
   1.279 +	TLbsConnectionType 	iConnectionType;
   1.280 +	
   1.281 +	/**
   1.282 +	 * Whether the host settings are read only
   1.283 +	*/
   1.284 +	TBool iReadOnly;
   1.285 +	
   1.286 +	/**
   1.287 +	Port to use to connect to SUPL server 
   1.288 +	*/
   1.289 +	TInt iPortId;
   1.290 +	
   1.291 +	/**
   1.292 +	Supported authentication modes for terminal initiated location requests
   1.293 +	*/
   1.294 +	TAuthModes			iAuthModesMOLR;		//includes MOLR-Cell/MOLR-AGPS/MOLR-X3P
   1.295 +	
   1.296 +	/**
   1.297 +	Supported authentication modes for network initiated location requests
   1.298 +	*/
   1.299 +	TAuthModes			iAuthModesMTLR;
   1.300 +	
   1.301 +	/**
   1.302 +	Reserved for future use
   1.303 +	*/
   1.304 +	TUint8				iReserved[20];
   1.305 +	};
   1.306 +
   1.307 +#endif // LBSHOSTSETTINGSCLASSTYPES_H_
   1.308 +
   1.309 +