|
1 /* |
|
2 * Copyright (c) 2005-2008 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: Declaration of CMMCScBkupDataOwnerInfo |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef __CMMCSCBKUPDATAOWNERINFO_H__ |
|
20 #define __CMMCSCBKUPDATAOWNERINFO_H__ |
|
21 |
|
22 // System includes |
|
23 #include <e32std.h> |
|
24 #include <s32strm.h> |
|
25 #include <connect/sbtypes.h> |
|
26 |
|
27 // User includes |
|
28 #include "TMMCScBkupOwnerDataType.h" |
|
29 |
|
30 // Classes referenced |
|
31 class TMMCScBkupDriveAndSize; |
|
32 class CMMCScBkupDataTypeSizer; |
|
33 class MMMCScBkupArchiveDataInterface; |
|
34 |
|
35 // Namespaces |
|
36 using namespace conn; |
|
37 |
|
38 |
|
39 /** |
|
40 * |
|
41 * |
|
42 * @since 3.0 |
|
43 */ |
|
44 NONSHARABLE_CLASS(CMMCScBkupDataOwnerInfo) : public CBase |
|
45 { |
|
46 public: |
|
47 |
|
48 /** |
|
49 * Static constructor |
|
50 */ |
|
51 static CMMCScBkupDataOwnerInfo* NewLC( CDataOwnerInfo* aOwner ); |
|
52 |
|
53 /** |
|
54 * Static constructor |
|
55 */ |
|
56 static CMMCScBkupDataOwnerInfo* NewLC( RReadStream& aStream ); |
|
57 |
|
58 /** |
|
59 * Static constructor |
|
60 */ |
|
61 static CMMCScBkupDataOwnerInfo* New( TSecureId aSecureId ); |
|
62 |
|
63 /** |
|
64 * C++ destructor |
|
65 */ |
|
66 ~CMMCScBkupDataOwnerInfo(); |
|
67 |
|
68 private: |
|
69 |
|
70 /** |
|
71 * C++ default constructor |
|
72 */ |
|
73 CMMCScBkupDataOwnerInfo( CDataOwnerInfo* aOwner = NULL ); |
|
74 |
|
75 /** |
|
76 * |
|
77 */ |
|
78 void ConstructL(); |
|
79 |
|
80 public: // API |
|
81 |
|
82 /** |
|
83 * |
|
84 */ |
|
85 CDataOwnerInfo& Owner(); |
|
86 |
|
87 /** |
|
88 * |
|
89 */ |
|
90 const CDataOwnerInfo& Owner() const; |
|
91 |
|
92 /** |
|
93 * |
|
94 */ |
|
95 TDataOwnerStatus Status() const; |
|
96 |
|
97 /** |
|
98 * |
|
99 */ |
|
100 void SetStatus( TDataOwnerStatus aStatus ); |
|
101 |
|
102 /** |
|
103 * |
|
104 */ |
|
105 void AddToOperationalSizeL( TMMCScBkupOwnerDataType aType, TDriveNumber aDrive, TInt64 aSize ); |
|
106 |
|
107 /** |
|
108 * |
|
109 */ |
|
110 void SetOperationalSizeL( TMMCScBkupOwnerDataType aType, TDriveNumber aDrive, TInt64 aSize ); |
|
111 |
|
112 /** |
|
113 * |
|
114 */ |
|
115 void ResetOperationalSize( TMMCScBkupOwnerDataType aType ); |
|
116 |
|
117 /** |
|
118 * |
|
119 */ |
|
120 TInt64 OperationalSize( TMMCScBkupOwnerDataType aType ) const; |
|
121 |
|
122 /** |
|
123 * |
|
124 */ |
|
125 TInt64 OperationalSize( TMMCScBkupOwnerDataType aType, TDriveNumber aDrive ) const; |
|
126 |
|
127 /** |
|
128 * |
|
129 */ |
|
130 TInt64 OperationalSize( TDriveNumber aDrive ) const; |
|
131 |
|
132 /** |
|
133 * |
|
134 */ |
|
135 void OperationalSizesL( RArray<TMMCScBkupDriveAndSize>& aSizes ) const; |
|
136 |
|
137 /** |
|
138 * |
|
139 */ |
|
140 inline TSecureId SecureId() const { return iSecureId; } |
|
141 |
|
142 /** |
|
143 * |
|
144 */ |
|
145 TInt NumberOfOperationsRequiredL() const; |
|
146 |
|
147 /** |
|
148 * |
|
149 */ |
|
150 void SetCompletionStatus( TMMCScBkupOwnerDataType aType, TBool aCompleted ); |
|
151 |
|
152 /** |
|
153 * |
|
154 */ |
|
155 TBool CompletionStatus( TMMCScBkupOwnerDataType aType ) const; |
|
156 |
|
157 /** |
|
158 * |
|
159 */ |
|
160 TInt ActiveDataRetryCount() const; |
|
161 |
|
162 /** |
|
163 * |
|
164 */ |
|
165 void SetActiveDataRetryCount( TInt aCount ); |
|
166 |
|
167 /** |
|
168 * |
|
169 */ |
|
170 inline TInt Version() const { return iVersion; } |
|
171 |
|
172 public: // Store/Restore |
|
173 |
|
174 /** |
|
175 * |
|
176 */ |
|
177 void InternalizeL( RReadStream& aStream ); |
|
178 |
|
179 /** |
|
180 * |
|
181 */ |
|
182 void ExternalizeL( RWriteStream& aStream ) const; |
|
183 |
|
184 public: // Comparison support |
|
185 |
|
186 /** |
|
187 * |
|
188 */ |
|
189 static TBool CompareDataOwnerBySIDL( const CMMCScBkupDataOwnerInfo& aLeft, const CMMCScBkupDataOwnerInfo& aRight ); |
|
190 |
|
191 /** |
|
192 * |
|
193 */ |
|
194 TBool HasJavaDataL() const; |
|
195 |
|
196 /** |
|
197 * |
|
198 */ |
|
199 TBool HasActiveDataL() const; |
|
200 |
|
201 /** |
|
202 * |
|
203 */ |
|
204 TBool HasPassiveDataL() const; |
|
205 |
|
206 /** |
|
207 * |
|
208 */ |
|
209 TBool HasPublicDataL() const; |
|
210 |
|
211 /** |
|
212 * |
|
213 */ |
|
214 TBool HasSystemDataL() const; |
|
215 |
|
216 private: // Internal enumerations |
|
217 enum |
|
218 { |
|
219 EStreamFormatVersion1 = 1, |
|
220 EStreamFormatVersion2, |
|
221 EStreamFormatVersionLatest |
|
222 }; |
|
223 |
|
224 public: // Public enumerations |
|
225 enum |
|
226 { |
|
227 EStreamFormatVersionFirst = EStreamFormatVersion1 |
|
228 }; |
|
229 |
|
230 private: // Member data |
|
231 |
|
232 // Underlying data owner - owned by this object |
|
233 CDataOwnerInfo* iDataOwner; |
|
234 // Associated secure id of the data owner (if it has one) |
|
235 TSecureId iSecureId; |
|
236 // Ready status of the data owner |
|
237 TDataOwnerStatus iStatus; |
|
238 // Size of data that the owner has to backup/restore |
|
239 CMMCScBkupDataTypeSizer* iOperationalSize; |
|
240 // The completion status of each individual element |
|
241 TFixedArray<TBool, EMMCScBkupOwnerDataTypeCount> iCompletionStatus; |
|
242 // For active data, we record how many times the SID has returned "not ready" |
|
243 TInt iActiveDataRetryCount; |
|
244 // Version information |
|
245 TInt iVersion; |
|
246 }; |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 #endif // __CMMCSCBKUPDATAOWNERINFO_H__ |
|
252 |
|
253 //End of File |