|
1 /* |
|
2 * Copyright (c) 2005-2009 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 "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: CSConSBEClient header file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _SCONSBECLIENT_H_ |
|
20 #define _SCONSBECLIENT_H_ |
|
21 |
|
22 // INCLUDES |
|
23 #include <connect/sbeclient.h> |
|
24 #include "sconconmltask.h" |
|
25 |
|
26 using namespace conn; |
|
27 |
|
28 //============================================================ |
|
29 // Class CSConSBEClient declaration |
|
30 //============================================================ |
|
31 NONSHARABLE_CLASS ( CSConSBEClient ) : public CActive |
|
32 { |
|
33 public: |
|
34 /** |
|
35 * Two-phase constructor |
|
36 * @param aMaxObjectSize Max object size |
|
37 * @param aFs aReference to RFs connection. |
|
38 * @return CSConSBEClient instance |
|
39 */ |
|
40 static CSConSBEClient* NewL( const TInt aMaxObjectSize, RFs& aFs ); |
|
41 /** |
|
42 * Destructor |
|
43 * @return none |
|
44 */ |
|
45 ~CSConSBEClient(); |
|
46 /** |
|
47 * Set backup/restore mode |
|
48 * @param aStatus TRequestStatus of the request |
|
49 * @param aTask Task parameters |
|
50 * @return none |
|
51 */ |
|
52 void SetBURMode( TRequestStatus& aStatus, CSConTask*& aTask ); |
|
53 /** |
|
54 * Lists public files from data owners |
|
55 * @param aStatus TRequestStatus of the request |
|
56 * @param aTask Task parameters |
|
57 * @return none |
|
58 */ |
|
59 void ListPublicFiles( TRequestStatus& aStatus, CSConTask*& aTask ); |
|
60 /** |
|
61 * Lists participant data owners |
|
62 * @param aStatus TRequestStatus of the request |
|
63 * @param aTask Task parameters |
|
64 * @return none |
|
65 */ |
|
66 void ListDataOwners( TRequestStatus& aStatus, CSConTask*& aTask ); |
|
67 /** |
|
68 * Lists data sizes from data owners |
|
69 * @param aStatus TRequestStatus of the request |
|
70 * @param aTask Task parameters |
|
71 * @return none |
|
72 */ |
|
73 void GetDataSize( TRequestStatus& aStatus, CSConTask*& aTask ); |
|
74 /** |
|
75 * Request a data from a data owner |
|
76 * @param aStatus TRequestStatus of the request |
|
77 * @param aTask Task parameters |
|
78 * @return none |
|
79 */ |
|
80 void RequestData( TRequestStatus& aStatus, CSConTask*& aTask ); |
|
81 /** |
|
82 * Lists the status of data owners |
|
83 * @param aStatus TRequestStatus of the request |
|
84 * @param aTask Task parameters |
|
85 * @return none |
|
86 */ |
|
87 void GetDataOwnerStatus( TRequestStatus& aStatus, CSConTask*& aTask ); |
|
88 /** |
|
89 * Supplies a data to a data owner |
|
90 * @param aStatus TRequestStatus of the request |
|
91 * @param aTask Task parameters |
|
92 * @return none |
|
93 */ |
|
94 void SupplyData( TRequestStatus& aStatus, CSConTask*& aTask ); |
|
95 |
|
96 private: |
|
97 /** |
|
98 * Constructor |
|
99 * @paran aMaxObjectSize Max object size |
|
100 * @param aFs aReference to RFs connection. |
|
101 * @return none |
|
102 */ |
|
103 CSConSBEClient( const TInt aMaxObjectSize, RFs& aFs ); |
|
104 |
|
105 /** |
|
106 * Implementation of CActive::DoCancel() |
|
107 * @return none |
|
108 */ |
|
109 void DoCancel(); |
|
110 /** |
|
111 * Implementation of CActive::RunL() |
|
112 * @return none |
|
113 */ |
|
114 void RunL(); |
|
115 |
|
116 /** |
|
117 * Executes SetBURMode task |
|
118 * @return none |
|
119 */ |
|
120 void ProcessSetBURModeL(); |
|
121 /** |
|
122 * Executes ListPublicFiles task |
|
123 * @return none |
|
124 */ |
|
125 void ProcessListPublicFilesL(); |
|
126 /** |
|
127 * Executes ListDataOwners task |
|
128 * @return none |
|
129 */ |
|
130 void ProcessListDataOwnersL(); |
|
131 /** |
|
132 * Executes GetDataSize task |
|
133 * @return none |
|
134 */ |
|
135 void ProcessGetDataSizeL(); |
|
136 /** |
|
137 * Executes RequestData task |
|
138 * @return KErrNone if no erros. Else system wide error codes. |
|
139 */ |
|
140 TInt ProcessRequestDataL(); |
|
141 /** |
|
142 * Executes GetDataOwnerStatus task |
|
143 * @return none |
|
144 */ |
|
145 void ProcessGetDataOwnerStatusL(); |
|
146 /** |
|
147 * Executes SupplyData task |
|
148 * @return KErrNone if no errors. Else system wide error codes. |
|
149 */ |
|
150 TInt ProcessSupplyDataL(); |
|
151 /** |
|
152 * Maps TInt drive number to TDriveNumber |
|
153 * @param aDrive Drive number as TInt |
|
154 * @return drive number as TDriveNumber |
|
155 */ |
|
156 TDriveNumber GetDriveNumber( const TInt& aDrive ) const; |
|
157 /** |
|
158 * Filters the drive list |
|
159 * @param aDriveList Drive list to be filtered |
|
160 * @return none |
|
161 */ |
|
162 void FilterDriveList( TDriveList& aDriveList ) const; |
|
163 /** |
|
164 * Matches the uids |
|
165 * @param aFirst The first uid |
|
166 * @param aSecon The second uid |
|
167 * @return ETrue if uids match, else EFalse |
|
168 */ |
|
169 static TBool Match( const TUid& aFirst, |
|
170 const TUid& aSecond ); |
|
171 /** |
|
172 * Handle error received from Secure Backup Engine |
|
173 * @param aErr Error code from Secure Backup Engine |
|
174 * @return none |
|
175 */ |
|
176 void HandleSBEErrorL( TInt& aErr ); |
|
177 |
|
178 /** |
|
179 * Appends public files to CSConFile array. |
|
180 * @param aFiles source files to append |
|
181 * @param aSconFiles dataowner list where to add |
|
182 * @return none |
|
183 */ |
|
184 void AppendFilesToFilelistL( const RFileArray& aFiles, RPointerArray<CSConFile>& aSconFiles ); |
|
185 |
|
186 /** |
|
187 * Gets Package dataowner size |
|
188 * @param aPackageId dataowner |
|
189 * @param TDriveList drives to include |
|
190 * @param TPackageDataType package data type |
|
191 * @return dataowner data size in specified drives |
|
192 */ |
|
193 TUint PackageDataSizeL( TUid aPackageId, const TDriveList& aDriveList, |
|
194 TPackageDataType aPackageDataType ) const; |
|
195 |
|
196 /** |
|
197 * Gets Sid dataowner size |
|
198 * @param aSid dataowner |
|
199 * @param TDriveList drives to include |
|
200 * @param TTransferDataType transfer data type |
|
201 * @return dataowner data size in specified drives |
|
202 */ |
|
203 TUint SidDataSizeL( TUid aSid, const TDriveList& aDriveList, |
|
204 TTransferDataType aTransferDataType ) const; |
|
205 |
|
206 /** |
|
207 * Gets Java dataowner size |
|
208 * @param aJavaHash Java hash value |
|
209 * @param TDriveList drives to include |
|
210 * @return dataowner data size in specified drives |
|
211 */ |
|
212 TUint JavaDataSizeL( const TDesC& aJavaHash, const TDriveList& aDriveList ) const; |
|
213 |
|
214 private: |
|
215 CSBEClient* iSBEClient; |
|
216 TRequestStatus* iCallerStatus; |
|
217 TBool iProcessComplete; |
|
218 TInt iProcessIndex; |
|
219 TInt iMaxObjectSize; |
|
220 |
|
221 CSConTask* iCurrentTask; |
|
222 TInt iDataPos; |
|
223 TBool iDataLeft; |
|
224 TPtrC8 iDataPtr; |
|
225 TBool iLastChunk; |
|
226 TBool iBURModeNormal; |
|
227 TBool iRestoreMode; |
|
228 RFs& iFs; |
|
229 TBool iAllSnapshotsSuppliedCalled; |
|
230 }; |
|
231 |
|
232 #endif |
|
233 |
|
234 // End of file |