|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: MBSUpdater |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __MBSUPDATER_H |
|
22 #define __MBSUPDATER_H |
|
23 |
|
24 #include <e32std.h> |
|
25 #include <mbselement.h> |
|
26 |
|
27 class MBSBackupRestoreStateObserver ; |
|
28 |
|
29 const TInt KBSAutomaticVersionUpdate = -1; |
|
30 |
|
31 /** |
|
32 * An interface for updating branding information |
|
33 * |
|
34 * @since |
|
35 */ |
|
36 class MBSUpdater |
|
37 { |
|
38 public: |
|
39 |
|
40 enum TUpdateTransactionType |
|
41 { |
|
42 EUpdateInstall = 1, |
|
43 EUpdateAppend, |
|
44 EUpdateReplace, |
|
45 EUpdateUninstall |
|
46 }; |
|
47 |
|
48 //*** TRANSACTION HANDLING ***// |
|
49 |
|
50 /* |
|
51 * Start transaction for installing a brand. |
|
52 * @param aApplicationId id of the application |
|
53 * @param aBrandId id of the brand |
|
54 * @param aLanguageId languageid of the brand |
|
55 * @param aReserved for further use |
|
56 */ |
|
57 virtual void StartTransactionL( const TDesC8& aBrandId, |
|
58 TLanguage aLanguageId, |
|
59 TUpdateTransactionType aType = EUpdateInstall, |
|
60 TInt aReserved = 0 ) = 0; |
|
61 |
|
62 /* |
|
63 * Stop brand installation transaction. |
|
64 * Calling this will indicate that the brand has |
|
65 * been updated completely and it will be taken |
|
66 * into use. |
|
67 * @return new version of the installed/updated brand |
|
68 */ |
|
69 virtual TInt StopTransactionL() = 0; |
|
70 |
|
71 /* |
|
72 * Cancels brand installation transaction. |
|
73 * All the elements updated in this transaction |
|
74 * will be discarded. |
|
75 */ |
|
76 virtual void CancelTransactionL() = 0; |
|
77 |
|
78 |
|
79 //*** BRAND REMOVING ***// |
|
80 |
|
81 /* |
|
82 * Removes all brand data from the specified brand. |
|
83 */ |
|
84 virtual void RemoveBrandL( const TDesC8& aApplicationId, |
|
85 const TDesC8& aBrandId ) = 0; |
|
86 |
|
87 /* |
|
88 * Removes all brand data from the specified application. |
|
89 */ |
|
90 virtual void RemoveBrandsL( const TDesC8& aApplicationId ) = 0; |
|
91 |
|
92 |
|
93 //*** BRAND INSTALLING ***// |
|
94 |
|
95 |
|
96 /* |
|
97 * Insert text type item into the new brand |
|
98 * @param aId ID of the item |
|
99 * @param aText the text item |
|
100 */ |
|
101 virtual void InsertTextL( const TDesC8& aId, const TDesC& aText ) = 0; |
|
102 |
|
103 /* |
|
104 * Insert 8-bit data type item into the new brand |
|
105 * @param aId ID of the item |
|
106 * @param aBuffer the data item |
|
107 */ |
|
108 virtual void InsertBufferL( const TDesC8& aId, const TDesC8& aBuffer ) = 0; |
|
109 |
|
110 /* |
|
111 * Insert integer type item into the new brand |
|
112 * @param aId ID of the item |
|
113 * @param aInt the integer item |
|
114 */ |
|
115 virtual void InsertIntL( const TDesC8& aId, TInt aInt ) = 0; |
|
116 |
|
117 /* |
|
118 * Insert a file type item into the new brand. |
|
119 * Note that the this is only the id and file name pair, |
|
120 * the file itself has to be imported separately. |
|
121 * @param aId ID of the item |
|
122 * @param aFile the integer item |
|
123 */ |
|
124 virtual void InsertFileL( const TDesC8& aId, |
|
125 const TDesC& aFileName ) = 0; |
|
126 |
|
127 /* |
|
128 * Inserts an element into the brand that is being installed. |
|
129 * @param aElement the element |
|
130 */ |
|
131 virtual void InsertElementL( MBSElement* aElement ) = 0; |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 //*** BRAND UPDATING - replacing ***// |
|
138 |
|
139 |
|
140 /* |
|
141 * Insert text type item into the new brand |
|
142 * @param aId ID of the item |
|
143 * @param aText the text item |
|
144 */ |
|
145 virtual void ReplaceTextL( const TDesC8& aId, const TDesC& aText ) = 0; |
|
146 |
|
147 /* |
|
148 * Insert 8-bit data type item into the new brand |
|
149 * @param aId ID of the item |
|
150 * @param aBuffer the data item |
|
151 */ |
|
152 virtual void ReplaceBufferL( const TDesC8& aId, const TDesC8& aBuffer ) = 0; |
|
153 |
|
154 /* |
|
155 * Insert integer type item into the new brand |
|
156 * @param aId ID of the item |
|
157 * @param aInt the integer item |
|
158 */ |
|
159 virtual void ReplaceIntL( const TDesC8& aId, TInt aInt ) = 0; |
|
160 |
|
161 /* |
|
162 * Insert a file type item into the new brand. |
|
163 * Note that the this is only the id and file name pair, |
|
164 * the file itself has to be imported separately. |
|
165 * @param aId ID of the item |
|
166 * @param aFile the integer item |
|
167 */ |
|
168 virtual void ReplaceFileL( const TDesC8& aId, |
|
169 const TDesC& aFileName ) = 0; |
|
170 |
|
171 /* |
|
172 * Inserts an element into the brand that is being installed. |
|
173 * @param aElement the element |
|
174 */ |
|
175 virtual void ReplaceElementL( MBSElement* aElement ) = 0; |
|
176 |
|
177 |
|
178 |
|
179 //*** BRAND UPDATING - appending ***// |
|
180 |
|
181 |
|
182 /* |
|
183 * Insert text type item into the new brand |
|
184 * @param aId ID of the item |
|
185 * @param aText the text item |
|
186 */ |
|
187 virtual void AppendTextL( const TDesC8& aId, const TDesC& aText ) = 0; |
|
188 |
|
189 /* |
|
190 * Insert 8-bit data type item into the new brand |
|
191 * @param aId ID of the item |
|
192 * @param aBuffer the data item |
|
193 */ |
|
194 virtual void AppendBufferL( const TDesC8& aId, const TDesC8& aBuffer ) = 0; |
|
195 |
|
196 /* |
|
197 * Insert integer type item into the new brand |
|
198 * @param aId ID of the item |
|
199 * @param aInt the integer item |
|
200 */ |
|
201 virtual void AppendIntL( const TDesC8& aId, TInt aInt ) = 0; |
|
202 |
|
203 /* |
|
204 * Insert a file type item into the new brand. |
|
205 * Note that the this is only the id and file name pair, |
|
206 * the file itself has to be imported separately. |
|
207 * @param aId ID of the item |
|
208 * @param aFile the integer item |
|
209 */ |
|
210 virtual void AppendFileL( const TDesC8& aId, |
|
211 const TDesC& aFileName ) = 0; |
|
212 |
|
213 /* |
|
214 * Inserts an element into the brand that is being installed. |
|
215 * @param aElement the element |
|
216 */ |
|
217 virtual void AppendElementL( MBSElement* aElement ) = 0; |
|
218 |
|
219 |
|
220 /* |
|
221 * Closes the handle to server and deletes the object. |
|
222 */ |
|
223 virtual void Close() = 0; |
|
224 |
|
225 /* |
|
226 * Register to observer backup restore state change |
|
227 * @param aObserver the observer interface |
|
228 */ |
|
229 virtual void RegisterObserverL( MBSBackupRestoreStateObserver* aBackupObserver ) = 0; |
|
230 |
|
231 /* |
|
232 * Unregister a backup restore state change observer |
|
233 * @param aObserver the observer interface |
|
234 */ |
|
235 virtual void UnRegisterObserverL( MBSBackupRestoreStateObserver* aObserver ) = 0; |
|
236 |
|
237 |
|
238 protected: |
|
239 /* |
|
240 * Destructor |
|
241 */ |
|
242 virtual ~MBSUpdater() {}; |
|
243 }; |
|
244 |
|
245 #endif //__MBSUPDATER_H |