|
1 /* |
|
2 * Copyright (c) 2007-2007 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: CIAUpdaterResultsFile |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef IA_UPDATER_RESULTS_FILE_H |
|
22 #define IA_UPDATER_RESULTS_FILE_H |
|
23 |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <s32strm.h> |
|
27 #include <e32cmn.h> |
|
28 #include <f32file.h> |
|
29 |
|
30 class CIAUpdaterResult; |
|
31 |
|
32 |
|
33 /** |
|
34 * |
|
35 * |
|
36 * @since S60 v3.2 |
|
37 */ |
|
38 class CIAUpdaterResultsFile : public CBase |
|
39 { |
|
40 |
|
41 public: |
|
42 |
|
43 /** |
|
44 * @note ReadDataL should be called to get the values from the file. |
|
45 * Otherwise, default values are used. |
|
46 * |
|
47 * @note The default path to the file where ReadDataL gets its data |
|
48 * is set to the private directory file of the UI and the default |
|
49 * name of the file is used. If the file path should be changed, |
|
50 * then use SetFilePathL for this. |
|
51 * |
|
52 * @since S60 v3.2 |
|
53 */ |
|
54 IMPORT_C static CIAUpdaterResultsFile* NewL(); |
|
55 |
|
56 IMPORT_C static CIAUpdaterResultsFile* NewLC(); |
|
57 |
|
58 |
|
59 IMPORT_C virtual ~CIAUpdaterResultsFile(); |
|
60 |
|
61 |
|
62 /** |
|
63 * Convenience method to get the count instead of |
|
64 * checking the array and its content values by hand. |
|
65 * |
|
66 * @since S60 v3.2 |
|
67 */ |
|
68 IMPORT_C TInt SuccessCount() const; |
|
69 |
|
70 /** |
|
71 * Convenience method to get the count instead of |
|
72 * checking the array and its content values by hand. |
|
73 * |
|
74 * @since S60 v3.2 |
|
75 */ |
|
76 IMPORT_C TInt FailCount() const; |
|
77 |
|
78 /** |
|
79 * Convenience method to get the count instead of |
|
80 * checking the array and its content values by hand. |
|
81 * |
|
82 * @since S60 v3.2 |
|
83 */ |
|
84 IMPORT_C TInt CancelCount() const; |
|
85 |
|
86 |
|
87 /** |
|
88 * |
|
89 * @note FilePath is not set to a default value when Reset is called. |
|
90 * The current value will remain after this function call. SetFilePathL function |
|
91 * can be used to set values for the file path. |
|
92 * |
|
93 */ |
|
94 IMPORT_C void Reset(); |
|
95 |
|
96 |
|
97 IMPORT_C TInt PckgStartIndex() const; |
|
98 |
|
99 IMPORT_C void SetPckgStartIndex( const TInt& aIndex ); |
|
100 |
|
101 /** |
|
102 * @note This is not the count of Results-list but this is the |
|
103 * count of all the items that should be installed and shown |
|
104 * in the UI dialog. |
|
105 */ |
|
106 IMPORT_C TInt TotalPckgCount() const; |
|
107 |
|
108 IMPORT_C void SetTotalPckgCount( const TInt& aCount ); |
|
109 |
|
110 |
|
111 |
|
112 IMPORT_C RPointerArray< CIAUpdaterResult >& Results(); |
|
113 |
|
114 |
|
115 /** |
|
116 * @return const TDesC& File path that is used for ReadDataL, WriteDataL |
|
117 * and RemoveFile. |
|
118 * |
|
119 * @since S60 v3.2 |
|
120 */ |
|
121 IMPORT_C const TDesC& FilePath() const; |
|
122 |
|
123 /** |
|
124 * @param aPath The full path of the data file that is used when |
|
125 * ReadDataL, WriteDataL and RemoveFile are used. |
|
126 * |
|
127 * @since S60 v3.2 |
|
128 */ |
|
129 IMPORT_C void SetFilePathL( const TDesC& aPath ); |
|
130 |
|
131 |
|
132 /** |
|
133 * @exception Leaves with KErrNotFound if the file was not found. |
|
134 * Otherwise system wide error code. |
|
135 * |
|
136 * @since S60 v3.2 |
|
137 */ |
|
138 IMPORT_C TBool ReadDataL(); |
|
139 |
|
140 IMPORT_C void WriteDataL(); |
|
141 |
|
142 |
|
143 IMPORT_C TInt RemoveFile(); |
|
144 |
|
145 |
|
146 private: |
|
147 |
|
148 // Prevent these if not implemented |
|
149 CIAUpdaterResultsFile( const CIAUpdaterResultsFile& aObject ); |
|
150 CIAUpdaterResultsFile& operator =( const CIAUpdaterResultsFile& aObject ); |
|
151 |
|
152 |
|
153 CIAUpdaterResultsFile(); |
|
154 |
|
155 void ConstructL(); |
|
156 |
|
157 |
|
158 void InternalizeL( RReadStream& aStream ); |
|
159 |
|
160 void ExternalizeL( RWriteStream& aStream ); |
|
161 |
|
162 |
|
163 private: // data |
|
164 |
|
165 // file server session |
|
166 RFs iFsSession; |
|
167 |
|
168 // controller data file path |
|
169 TFileName iPath; |
|
170 |
|
171 |
|
172 // This informs how many packages have already been handled. |
|
173 // This way the UI can show correct information in its dialogs. |
|
174 TInt iPckgStartIndex; |
|
175 |
|
176 // This counter informs how many packages will be totally installed. |
|
177 // Used in the dialog. |
|
178 TInt iTotalPckgCount; |
|
179 |
|
180 |
|
181 RPointerArray< CIAUpdaterResult > iResults; |
|
182 |
|
183 }; |
|
184 |
|
185 #endif // IA_UPDATER_RESULTS_FILE_H |
|
186 |