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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This file defines the major data type definitions for the LBS Host Settings API.
24 #ifndef LBSHOSTSETTINGSCLASSTYPES_H_
25 #define LBSHOSTSETTINGSCLASSTYPES_H_
30 Class types for TLbsHostSettingsBase and its derived classes
32 enum TLbsHostSettingsClassType
35 Unknown/undefined value
37 ELbsHostSettingsUnknownClass = 0x00,
39 Host settings base class type
41 ELbsHostSettingsBaseClass = 0x01,
43 Host settings SUPL class type
45 ELbsHostSettingsSuplClass = 0x02,
47 Defined for compiler optimisation
49 ELbsHostSettingsLastClass = 0xFFFFFFFF
53 Type for the ID of a host settings store.
55 typedef TUid TLbsHostStoreId;
57 Type for the ID of host settings.
59 typedef TUid TLbsHostSettingsId;
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.
64 typedef TUid TLbsHostCreatorId;
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.
70 class TLbsHostSettingsClassTypeBase
73 IMPORT_C TUint32 ClassType() const;
74 IMPORT_C TUint ClassSize() const;
77 IMPORT_C TLbsHostSettingsClassTypeBase();
80 /** The type of the derived class */
82 /** The size of the derived class */
87 Base class for host settings that adds a method to get the ID of the settings creator.
89 class TLbsHostSettingsBase : public TLbsHostSettingsClassTypeBase
92 IMPORT_C TLbsHostSettingsBase();
94 IMPORT_C TLbsHostCreatorId CreatorId() const;
96 IMPORT_C TLbsHostSettingsId HostSettingsId() const;
98 IMPORT_C TTime LastModified() const;
102 @param aCreatorId Id to set.
104 void SetCreatorId(TLbsHostCreatorId aCreatorId);
106 Sets the host settings id
107 @param aId Id to set.
109 void SetHostSettingsId(TLbsHostSettingsId &aId);
111 Set the last modified date of the account.
113 The Date must be in the format YYYYMMDD:HHMMSS.MMMMMM
115 void SetLastModifiedL(const TDesC& aTime);
117 Update the last modified date of the account to be the current time.
119 void UpdateLastModified();
121 TLbsHostSettingsId iHostSettingsId;
122 TLbsHostCreatorId iCreatorId;
124 TUint8 iReserved[20];
129 Maximum length of the array used for KLbsMaxHostNameAddressSize.
130 This is based on the maximum hostname URL length
133 const TInt KLbsMaxHostNameAddressSize = 256;
136 * Maximum length of the buffer used for the name setting
139 const TInt KLbsMaxSettingName = 256;
142 * Maximum length of the buffer used for the providerId setting
145 const TInt KLbsMaxProviderId = 256;
148 * Type for the network address of a SUPL server
150 typedef TBuf8<KLbsMaxHostNameAddressSize> TLbsHostNameAddress;
153 * Type for the name of a SUPL server
155 typedef TBuf8<KLbsMaxSettingName> TLbsHostName;
158 * Type for the location service provider
160 typedef TBuf8<KLbsMaxProviderId> TLbsProviderId;
163 * ConRef ID corresponding to the default setting
165 const TInt KLbsSuplUseDefaultConRefId = -100;
168 * Port ID corresponding to the default setting
170 const TInt KLbsSuplUseDefaultPortId = 7275;
173 Abstraction of a SUPL account
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.
180 class TLbsHostSettingsSupl : public TLbsHostSettingsBase
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;
187 /** SUPL authentication mechanisms.
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
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.
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
205 /** Unknown/undefined value */
207 /** No authentication allowed. */
209 /** TLS authentication allowed. */
211 /** TLS + Alternative Client authentication allowed. */
213 /** PSK-TLS authentication allowed. */
218 * Type of connection point to use for the connection to the SUPL server.
219 * Other connection types are expected in the future.
221 enum TLbsConnectionType
223 /** Connection type is invalid */
224 ELbsConnectionTypeInvalid = 0x00,
225 /** Network access point */
226 ELbsConnectionTypeNap = 0x01,
227 /** Proxy connection type */
228 ELbsConnectionTypeProxy = 0x02
231 IMPORT_C TLbsHostSettingsSupl();
233 IMPORT_C void GetHostNameAddress(TDes8& aHostAddress) const;
234 IMPORT_C void SetHostNameAddress(const TDesC8& aHostAddress);
236 IMPORT_C void GetConnectionPoint(TInt& aConnectionId, TLbsConnectionType& aConnectionType) const;
237 IMPORT_C void SetConnectionPoint(const TInt aConnectionId, const TLbsConnectionType aConnectionType);
239 IMPORT_C void GetReadOnly(TBool& aReadOnly) const;
240 IMPORT_C void SetReadOnly(const TBool aReadOnly);
242 IMPORT_C void GetPortId(TInt& aPortId) const;
243 IMPORT_C void SetPortId(const TInt aPortId);
245 IMPORT_C void GetName(TDes8& aName) const;
246 IMPORT_C void SetName(const TDesC8& aName);
248 IMPORT_C void GetProviderId(TDes8& aProviderId) const;
249 IMPORT_C void SetProviderId(const TDesC8& aProviderId);
251 IMPORT_C void GetAuthModesMOLR(TAuthModes& aAuthModes) const;
252 IMPORT_C void SetAuthModesMOLR(TAuthModes aAuthModes);
254 IMPORT_C void GetAuthModesMTLR(TAuthModes& aAuthModes) const;
255 IMPORT_C void SetAuthModesMTLR(TAuthModes aAuthModes);
258 SUPL server host address for these settings
260 TLbsHostNameAddress iHostAddress;
263 SUPL server host name
268 Provider of the host settings
270 TLbsProviderId iProviderId;
273 Network access point for these host settings
276 TLbsConnectionType iConnectionType;
279 * Whether the host settings are read only
284 Port to use to connect to SUPL server
289 Supported authentication modes for terminal initiated location requests
291 TAuthModes iAuthModesMOLR; //includes MOLR-Cell/MOLR-AGPS/MOLR-X3P
294 Supported authentication modes for network initiated location requests
296 TAuthModes iAuthModesMTLR;
299 Reserved for future use
301 TUint8 iReserved[20];
304 #endif // LBSHOSTSETTINGSCLASSTYPES_H_