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