author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:15:03 +0100 | |
branch | RCL_3 |
changeset 20 | 987c9837762f |
parent 19 | 7d48bed6ce0c |
permissions | -rw-r--r-- |
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Service Provider Settings entry |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#ifndef C_SPENTRY_H |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#define C_SPENTRY_H |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
#include <e32base.h> |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include "spdefinitions.h" |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
class CSPProperty; |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
/** |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
* Service Provider Settings entry. |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
* Container class for service attributes and settings properties |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
* |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
* @lib serviceprovidersettings.lib |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
* @since S60 V3.2 |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
*/ |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
NONSHARABLE_CLASS( CSPEntry ): public CBase |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
{ |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
|
20 | 39 |
public: // Constructors and destructor |
40 |
/** |
|
41 |
* Two-phased constructor. |
|
42 |
*/ |
|
43 |
IMPORT_C static CSPEntry* NewL(); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
|
20 | 45 |
/** |
46 |
* Two-phased constructor. |
|
47 |
*/ |
|
48 |
IMPORT_C static CSPEntry* NewLC(); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
|
20 | 50 |
/** |
51 |
* Destructors. |
|
52 |
*/ |
|
53 |
IMPORT_C virtual ~CSPEntry(); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
|
20 | 55 |
public: // Member functions |
56 |
/** |
|
57 |
* Returns service Id of this entry. |
|
58 |
* |
|
59 |
* @since S60 V3.2 |
|
60 |
* @return Service ID |
|
61 |
*/ |
|
62 |
IMPORT_C TServiceId GetServiceId() const; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
|
20 | 64 |
/** |
65 |
* Sets unique service provider ID for this entry. |
|
66 |
* This ID is generated automatically when new entry is added. |
|
67 |
* Service ID is also required when user updates entry in service table |
|
68 |
* |
|
69 |
* @since S60 V3.2 |
|
70 |
* @param aServiceId service ID |
|
71 |
*/ |
|
72 |
void SetServiceId( TServiceId aServiceId ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
|
20 | 74 |
/** |
75 |
* Returns service name of this entry. |
|
76 |
* |
|
77 |
* @since S60 V3.2 |
|
78 |
* @return Service name |
|
79 |
*/ |
|
80 |
IMPORT_C const TDesC& GetServiceName() const; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
|
20 | 82 |
/** |
83 |
* Sets service name for this entry. |
|
84 |
* |
|
85 |
* @since S60 V3.2 |
|
86 |
* @param aServiceName service name |
|
87 |
*/ |
|
88 |
IMPORT_C TInt SetServiceName( const TDesC& aServiceName ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
|
20 | 90 |
/** |
91 |
* Adds new property to this entry. |
|
92 |
* |
|
93 |
* @since S60 V3.2 |
|
94 |
* @param aProperty new property pointer |
|
95 |
* @return KErrNone if addition succeeded, |
|
96 |
* system wide error code otherwise. |
|
97 |
*/ |
|
98 |
IMPORT_C TInt AddPropertyL( const CSPProperty& aProperty ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
99 |
|
20 | 100 |
/** |
101 |
* Updates content of property in this entry. |
|
102 |
* |
|
103 |
* @since S60 V3.2 |
|
104 |
* @param aPropertyName property name |
|
105 |
* @param aValue new TInt value |
|
106 |
* @return KErrNone if update succeeded. |
|
107 |
*/ |
|
108 |
IMPORT_C TInt UpdateProperty( TServicePropertyName aPropertyName, TInt aValue ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
|
20 | 110 |
/** |
111 |
* Updates content of property in this entry. |
|
112 |
* |
|
113 |
* @since S60 V3.2 |
|
114 |
* @param aPropertyName property name |
|
115 |
* @param aValue new TDesC value |
|
116 |
* @return KErrNone if update succeeded. |
|
117 |
*/ |
|
118 |
IMPORT_C TInt UpdateProperty( TServicePropertyName aPropertyName, const TDesC& aValue ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
|
20 | 120 |
/** |
121 |
* Updates content of property in this entry. |
|
122 |
* |
|
123 |
* @since S60 V3.2 |
|
124 |
* @param aPropertyName property name |
|
125 |
* @param aValue new TOnOff value |
|
126 |
* @return KErrNone if update succeeded. |
|
127 |
*/ |
|
128 |
IMPORT_C TInt UpdateProperty( TServicePropertyName aPropertyName, TOnOff aValue ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
129 |
|
20 | 130 |
/** |
131 |
* Returns property of this entry by property name. |
|
132 |
* |
|
133 |
* @since S60 V3.2 |
|
134 |
* @param aProperty On return, reference to requested property |
|
135 |
* @param aPropertyName Name of requested property |
|
136 |
* @return error code |
|
137 |
*/ |
|
138 |
IMPORT_C TInt GetProperty( const CSPProperty*& aProperty, |
|
139 |
TServicePropertyName aPropertyName ) const; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
|
20 | 141 |
/** |
142 |
* Returns property of this entry by property index. |
|
143 |
* |
|
144 |
* @since S60 V3.2 |
|
145 |
* @param aProperty On return, reference to requested property |
|
146 |
* @param aIndex index of requested property |
|
147 |
* @return error code |
|
148 |
*/ |
|
149 |
IMPORT_C TInt GetProperty( const CSPProperty*& aProperty, |
|
150 |
TInt aIndex ) const; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
151 |
|
20 | 152 |
/** |
153 |
* Deletes property from this entry by index. |
|
154 |
* |
|
155 |
* @since S60 V3.2 |
|
156 |
* @param aIndex index of requested property |
|
157 |
* @return error code |
|
158 |
*/ |
|
159 |
IMPORT_C TInt DeleteProperty( TInt aIndex ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
|
20 | 161 |
/** |
162 |
* Deletes property from this entry by property name. |
|
163 |
* |
|
164 |
* @since S60 V3.2 |
|
165 |
* @param aProperty property name |
|
166 |
* @return error code |
|
167 |
*/ |
|
168 |
IMPORT_C TInt DeleteProperty( TServicePropertyName aProperty ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
169 |
|
20 | 170 |
/** |
171 |
* Returns all properties of this entry. |
|
172 |
* |
|
173 |
* @since S60 V3.2 |
|
174 |
* @return Reference to array of properties |
|
175 |
*/ |
|
176 |
IMPORT_C const RPropertyArray& GetAllProperties() const; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
177 |
|
20 | 178 |
/** |
179 |
* Returns count of properties in this entry |
|
180 |
* |
|
181 |
* @since S60 V3.2 |
|
182 |
* @return Count of properties |
|
183 |
*/ |
|
184 |
IMPORT_C TInt PropertyCount() const; |
|
185 |
||
186 |
/** |
|
187 |
* reset service entry |
|
188 |
* |
|
189 |
* @since S60 V3.2 |
|
190 |
* @return Count of properties |
|
191 |
*/ |
|
192 |
IMPORT_C void Reset(); |
|
193 |
||
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
194 |
|
20 | 195 |
private: |
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
196 |
|
20 | 197 |
/** |
198 |
* C++ default constructor. |
|
199 |
*/ |
|
200 |
CSPEntry(); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
201 |
|
20 | 202 |
/** |
203 |
* By default Symbian 2nd phase constructor is private. |
|
204 |
*/ |
|
205 |
void ConstructL(); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
206 |
|
20 | 207 |
/** |
208 |
* Search index of requested property in iPropertyArray |
|
209 |
* |
|
210 |
* @since S60 ?S60_version |
|
211 |
* @param aProperty |
|
212 |
* @return Index of property or KErrNotFound |
|
213 |
*/ |
|
214 |
TInt SearchProperty( TServicePropertyName aProperty ) const; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
215 |
|
20 | 216 |
private: // data |
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
217 |
|
20 | 218 |
/** |
219 |
* Id of service settings entry ( unique ) |
|
220 |
*/ |
|
221 |
TServiceId iServiceId; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
222 |
|
20 | 223 |
/** |
224 |
* Name of settings entry ( unique ) |
|
225 |
* Own. |
|
226 |
*/ |
|
227 |
RBuf iServiceName; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
228 |
|
20 | 229 |
/** |
230 |
* Service settings properties owned by this entry |
|
231 |
* Own. |
|
232 |
*/ |
|
233 |
RPropertyArray iPropertyArray; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
234 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
235 |
}; |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
237 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
#endif // C_SPENTRY_H |