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 interface to the list of remote hosts used
|
williamr@4
|
15 |
// by the LBS subsystem.
|
williamr@4
|
16 |
//
|
williamr@4
|
17 |
//
|
williamr@4
|
18 |
|
williamr@4
|
19 |
/**
|
williamr@4
|
20 |
@file
|
williamr@4
|
21 |
@publishedPartner
|
williamr@4
|
22 |
@deprecated
|
williamr@4
|
23 |
*/
|
williamr@4
|
24 |
|
williamr@4
|
25 |
#ifndef LBSHOSTSETTINGS_H_
|
williamr@4
|
26 |
#define LBSHOSTSETTINGS_H_
|
williamr@4
|
27 |
|
williamr@4
|
28 |
#include <e32std.h>
|
williamr@4
|
29 |
#include <lbs/lbshostsettingsclasstypes.h>
|
williamr@4
|
30 |
|
williamr@4
|
31 |
/**
|
williamr@4
|
32 |
* The ID of the Central Repository store used by the Host Settings API
|
williamr@4
|
33 |
*/
|
williamr@4
|
34 |
const TLbsHostStoreId KLbsHostSettingsSuplStoreId = {0x10285AA8};
|
williamr@4
|
35 |
|
williamr@4
|
36 |
/**
|
williamr@4
|
37 |
* The host settings creator UID used by the device provisioning plug-ins.
|
williamr@4
|
38 |
* If host settings have this creator ID they can be used for network initiated location requests
|
williamr@4
|
39 |
*/
|
williamr@4
|
40 |
const TLbsHostCreatorId KLbsHostSettingsDevProvCreatorId = {0x10285AA9};
|
williamr@4
|
41 |
|
williamr@4
|
42 |
/**
|
williamr@4
|
43 |
* A test host settings creator UID
|
williamr@4
|
44 |
*/
|
williamr@4
|
45 |
const TLbsHostCreatorId KLbsHostSettingsTestCreatorId = {0x10285AAA};
|
williamr@4
|
46 |
|
williamr@4
|
47 |
class CLbsHostSettingsStoreImpl;
|
williamr@4
|
48 |
class MLbsHostSettingsStoreImpl;
|
williamr@4
|
49 |
|
williamr@4
|
50 |
/**
|
williamr@4
|
51 |
Interface that receives notification of changes to a host settings data store.
|
williamr@4
|
52 |
A reference to an object of this class can be passed to CLbsHostSettingsStore::NewL()
|
williamr@4
|
53 |
to register a client as a host settings data store observer.
|
williamr@4
|
54 |
@see CLbsHostSettingsStore
|
williamr@4
|
55 |
@publishedPartner
|
williamr@4
|
56 |
@deprecated
|
williamr@4
|
57 |
*/
|
williamr@4
|
58 |
class MLbsHostSettingsStoreObserver
|
williamr@4
|
59 |
{
|
williamr@4
|
60 |
|
williamr@4
|
61 |
public:
|
williamr@4
|
62 |
IMPORT_C virtual TVersion Version() const;
|
williamr@4
|
63 |
|
williamr@4
|
64 |
/**
|
williamr@4
|
65 |
Receive notification that the contents of the data store have changed.
|
williamr@4
|
66 |
|
williamr@4
|
67 |
This method is called when a host settings entry in the data store been changed by
|
williamr@4
|
68 |
another client session. It specifies the ID of the entry that has changed
|
williamr@4
|
69 |
and also which store it belongs to.
|
williamr@4
|
70 |
|
williamr@4
|
71 |
Note: An application will not receive notification updates to changes it
|
williamr@4
|
72 |
itself has made to the same instance of CLbsHostSettingsStore.
|
williamr@4
|
73 |
|
williamr@4
|
74 |
@param aError KErrNone if an entry has been changed, otherwise an
|
williamr@4
|
75 |
error code from CenRep indicating a notification
|
williamr@4
|
76 |
request failure.
|
williamr@4
|
77 |
@param aStoreId Identifies which data store has been updated or
|
williamr@4
|
78 |
incurred an error.
|
williamr@4
|
79 |
@param aSettingsId Contains the ID of the host settings that has changed.
|
williamr@4
|
80 |
Valid only when aError == KErrNone.
|
williamr@4
|
81 |
|
williamr@4
|
82 |
*/
|
williamr@4
|
83 |
IMPORT_C virtual void LbsHostSettingsUpdated(TInt aError, TLbsHostStoreId aStoreId, TLbsHostSettingsId aSettingsId) const = 0;
|
williamr@4
|
84 |
|
williamr@4
|
85 |
|
williamr@4
|
86 |
protected:
|
williamr@4
|
87 |
IMPORT_C virtual TAny* ExtendedInterface(TInt aFunctionNumber, TAny* aPtr1, TAny* aPtr2);
|
williamr@4
|
88 |
};
|
williamr@4
|
89 |
|
williamr@4
|
90 |
|
williamr@4
|
91 |
/**
|
williamr@4
|
92 |
A class that encapsulates a host settings data store.
|
williamr@4
|
93 |
|
williamr@4
|
94 |
A host settings data store contains settings that describe the server hosts that the LBS subsystem
|
williamr@4
|
95 |
uses. For example, for the SUPL protocol, the data store contains settings for the SUPL servers that are used
|
williamr@4
|
96 |
for location requests (from local client applications and from the network), settings that define the authentication
|
williamr@4
|
97 |
type that should be used between client and server and the internet access point to use for network connections.
|
williamr@4
|
98 |
This class has methods to create a new host settings store, to create, modify and delete host settings and set the host
|
williamr@4
|
99 |
settings that should be used as defaults.
|
williamr@4
|
100 |
@see MLbsHostSettingsStoreObserver
|
williamr@4
|
101 |
@publishedPartner
|
williamr@4
|
102 |
@deprecated
|
williamr@4
|
103 |
*/
|
williamr@4
|
104 |
class CLbsHostSettingsStore : public CBase
|
williamr@4
|
105 |
{
|
williamr@4
|
106 |
public:
|
williamr@4
|
107 |
IMPORT_C static CLbsHostSettingsStore* NewL(TLbsHostStoreId aStoreId);
|
williamr@4
|
108 |
|
williamr@4
|
109 |
IMPORT_C static CLbsHostSettingsStore* NewL(TLbsHostStoreId aStoreId, MLbsHostSettingsStoreObserver& aObserver);
|
williamr@4
|
110 |
|
williamr@4
|
111 |
|
williamr@4
|
112 |
IMPORT_C TInt CreateHostSettings(const TLbsHostSettingsBase& aSettings, TLbsHostCreatorId aCreatorId, TLbsHostSettingsId& aSettingsId);
|
williamr@4
|
113 |
|
williamr@4
|
114 |
IMPORT_C TInt UpdateHostSettings(TLbsHostSettingsId aSettingsId, const TLbsHostSettingsBase& aSettings);
|
williamr@4
|
115 |
|
williamr@4
|
116 |
IMPORT_C TInt GetHostSettings(TLbsHostSettingsId aSettingsId, TLbsHostSettingsBase& aSettings) const;
|
williamr@4
|
117 |
|
williamr@4
|
118 |
|
williamr@4
|
119 |
IMPORT_C TInt RewindHostSettings();
|
williamr@4
|
120 |
|
williamr@4
|
121 |
IMPORT_C TInt GetNextHostSettings(TLbsHostSettingsBase& aSettings, TLbsHostSettingsId& aSettingsId);
|
williamr@4
|
122 |
|
williamr@4
|
123 |
IMPORT_C TInt GetNextHostSettingsByCreator(TLbsHostCreatorId aCreatorId, TLbsHostSettingsBase& aSettings, TLbsHostSettingsId& aSettingsId);
|
williamr@4
|
124 |
|
williamr@4
|
125 |
|
williamr@4
|
126 |
IMPORT_C TInt SetDefaultHostSettings(TLbsHostSettingsId aSettingsId);
|
williamr@4
|
127 |
|
williamr@4
|
128 |
IMPORT_C TInt GetDefaultHostSettings(TLbsHostSettingsBase& aSettings) const;
|
williamr@4
|
129 |
|
williamr@4
|
130 |
IMPORT_C TInt GetDefaultHostSettings(TLbsHostSettingsBase& aSettings, TLbsHostSettingsId& aSettingsId) const;
|
williamr@4
|
131 |
|
williamr@4
|
132 |
IMPORT_C TInt DeleteHostSettings(TLbsHostSettingsId aSettingsId);
|
williamr@4
|
133 |
|
williamr@4
|
134 |
IMPORT_C ~CLbsHostSettingsStore();
|
williamr@4
|
135 |
|
williamr@4
|
136 |
protected:
|
williamr@4
|
137 |
/**
|
williamr@4
|
138 |
Default constructor for the settings store.
|
williamr@4
|
139 |
*/
|
williamr@4
|
140 |
CLbsHostSettingsStore();
|
williamr@4
|
141 |
void ConstructL(TLbsHostStoreId aStoreId, MLbsHostSettingsStoreObserver *aObserver);
|
williamr@4
|
142 |
|
williamr@4
|
143 |
private:
|
williamr@4
|
144 |
/**
|
williamr@4
|
145 |
* In order to maintain two implementations behind one interface
|
williamr@4
|
146 |
* we are holding two different versions of the implementation.
|
williamr@4
|
147 |
* The pointer to the C class will only be used for instantiation
|
williamr@4
|
148 |
* and destruction, we shall use the pointer to the mixin for
|
williamr@4
|
149 |
* everything else.
|
williamr@4
|
150 |
*/
|
williamr@4
|
151 |
CLbsHostSettingsStoreImpl* iImplementation;
|
williamr@4
|
152 |
MLbsHostSettingsStoreImpl* iSettingsStore;
|
williamr@4
|
153 |
|
williamr@4
|
154 |
private:
|
williamr@4
|
155 |
};
|
williamr@4
|
156 |
|
williamr@4
|
157 |
|
williamr@4
|
158 |
#endif // LBSHOSTSETTINGS_H_
|
williamr@4
|
159 |
|
williamr@4
|
160 |
|