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 interface to the list of remote hosts used
15 // by the LBS subsystem.
25 #ifndef LBSHOSTSETTINGS_H_
26 #define LBSHOSTSETTINGS_H_
29 #include <lbs/lbshostsettingsclasstypes.h>
32 * The ID of the Central Repository store used by the Host Settings API
34 const TLbsHostStoreId KLbsHostSettingsSuplStoreId = {0x10285AA8};
37 * The host settings creator UID used by the device provisioning plug-ins.
38 * If host settings have this creator ID they can be used for network initiated location requests
40 const TLbsHostCreatorId KLbsHostSettingsDevProvCreatorId = {0x10285AA9};
43 * A test host settings creator UID
45 const TLbsHostCreatorId KLbsHostSettingsTestCreatorId = {0x10285AAA};
47 class CLbsHostSettingsStoreImpl;
48 class MLbsHostSettingsStoreImpl;
51 Interface that receives notification of changes to a host settings data store.
52 A reference to an object of this class can be passed to CLbsHostSettingsStore::NewL()
53 to register a client as a host settings data store observer.
54 @see CLbsHostSettingsStore
58 class MLbsHostSettingsStoreObserver
62 IMPORT_C virtual TVersion Version() const;
65 Receive notification that the contents of the data store have changed.
67 This method is called when a host settings entry in the data store been changed by
68 another client session. It specifies the ID of the entry that has changed
69 and also which store it belongs to.
71 Note: An application will not receive notification updates to changes it
72 itself has made to the same instance of CLbsHostSettingsStore.
74 @param aError KErrNone if an entry has been changed, otherwise an
75 error code from CenRep indicating a notification
77 @param aStoreId Identifies which data store has been updated or
79 @param aSettingsId Contains the ID of the host settings that has changed.
80 Valid only when aError == KErrNone.
83 IMPORT_C virtual void LbsHostSettingsUpdated(TInt aError, TLbsHostStoreId aStoreId, TLbsHostSettingsId aSettingsId) const = 0;
87 IMPORT_C virtual TAny* ExtendedInterface(TInt aFunctionNumber, TAny* aPtr1, TAny* aPtr2);
92 A class that encapsulates a host settings data store.
94 A host settings data store contains settings that describe the server hosts that the LBS subsystem
95 uses. For example, for the SUPL protocol, the data store contains settings for the SUPL servers that are used
96 for location requests (from local client applications and from the network), settings that define the authentication
97 type that should be used between client and server and the internet access point to use for network connections.
98 This class has methods to create a new host settings store, to create, modify and delete host settings and set the host
99 settings that should be used as defaults.
100 @see MLbsHostSettingsStoreObserver
104 class CLbsHostSettingsStore : public CBase
107 IMPORT_C static CLbsHostSettingsStore* NewL(TLbsHostStoreId aStoreId);
109 IMPORT_C static CLbsHostSettingsStore* NewL(TLbsHostStoreId aStoreId, MLbsHostSettingsStoreObserver& aObserver);
112 IMPORT_C TInt CreateHostSettings(const TLbsHostSettingsBase& aSettings, TLbsHostCreatorId aCreatorId, TLbsHostSettingsId& aSettingsId);
114 IMPORT_C TInt UpdateHostSettings(TLbsHostSettingsId aSettingsId, const TLbsHostSettingsBase& aSettings);
116 IMPORT_C TInt GetHostSettings(TLbsHostSettingsId aSettingsId, TLbsHostSettingsBase& aSettings) const;
119 IMPORT_C TInt RewindHostSettings();
121 IMPORT_C TInt GetNextHostSettings(TLbsHostSettingsBase& aSettings, TLbsHostSettingsId& aSettingsId);
123 IMPORT_C TInt GetNextHostSettingsByCreator(TLbsHostCreatorId aCreatorId, TLbsHostSettingsBase& aSettings, TLbsHostSettingsId& aSettingsId);
126 IMPORT_C TInt SetDefaultHostSettings(TLbsHostSettingsId aSettingsId);
128 IMPORT_C TInt GetDefaultHostSettings(TLbsHostSettingsBase& aSettings) const;
130 IMPORT_C TInt GetDefaultHostSettings(TLbsHostSettingsBase& aSettings, TLbsHostSettingsId& aSettingsId) const;
132 IMPORT_C TInt DeleteHostSettings(TLbsHostSettingsId aSettingsId);
134 IMPORT_C ~CLbsHostSettingsStore();
138 Default constructor for the settings store.
140 CLbsHostSettingsStore();
141 void ConstructL(TLbsHostStoreId aStoreId, MLbsHostSettingsStoreObserver *aObserver);
145 * In order to maintain two implementations behind one interface
146 * we are holding two different versions of the implementation.
147 * The pointer to the C class will only be used for instantiation
148 * and destruction, we shall use the pointer to the mixin for
151 CLbsHostSettingsStoreImpl* iImplementation;
152 MLbsHostSettingsStoreImpl* iSettingsStore;
158 #endif // LBSHOSTSETTINGS_H_