1 /* |
1 /* |
2 * Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
8 * |
8 * |
9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: Import reader opens and reads the XML file to CMDXMLDocument |
14 * Description: Import reader opens and reads the XML file to CMDXMLDocument |
|
15 |
15 * object |
16 * object |
|
17 |
16 * |
18 * |
17 */ |
19 */ |
18 |
20 |
19 |
21 |
|
22 |
20 #ifndef CBSIMPORTFILEREADER_H |
23 #ifndef CBSIMPORTFILEREADER_H |
|
24 |
21 #define CBSIMPORTFILEREADER_H |
25 #define CBSIMPORTFILEREADER_H |
22 |
26 |
|
27 |
|
28 |
23 #include <e32base.h> |
29 #include <e32base.h> |
|
30 |
24 #include <gmxmlparser.h> |
31 #include <gmxmlparser.h> |
25 |
32 |
|
33 |
|
34 |
26 class CMDXMLDocument; |
35 class CMDXMLDocument; |
|
36 |
27 class CActiveScheduler; |
37 class CActiveScheduler; |
28 |
38 |
|
39 |
|
40 |
29 /** |
41 /** |
|
42 |
30 * Import reader opens and reads the XML file to CMDXMLDocument object |
43 * Import reader opens and reads the XML file to CMDXMLDocument object |
|
44 |
31 * |
45 * |
|
46 |
32 * @lib brandimporter.exe |
47 * @lib brandimporter.exe |
|
48 |
33 * @since S60 v3.2 |
49 * @since S60 v3.2 |
|
50 |
34 */ |
51 */ |
|
52 |
35 class CBSImportFileReader : public CBase, |
53 class CBSImportFileReader : public CBase, |
|
54 |
36 public MMDXMLParserObserver |
55 public MMDXMLParserObserver |
|
56 |
37 { |
57 { |
|
58 |
38 public: |
59 public: |
39 |
60 |
|
61 |
|
62 |
40 static CBSImportFileReader* NewL( TBool aUseScheduler ); |
63 static CBSImportFileReader* NewL( TBool aUseScheduler ); |
|
64 |
41 |
65 |
|
66 |
42 static CBSImportFileReader* NewLC( TBool aUseScheduler ); |
67 static CBSImportFileReader* NewLC( TBool aUseScheduler ); |
|
68 |
43 |
69 |
|
70 |
44 ~CBSImportFileReader(); |
71 ~CBSImportFileReader(); |
45 |
72 |
|
73 |
|
74 |
46 /** |
75 /** |
|
76 |
47 * Reads XML file to CMDXMLDocument object |
77 * Reads XML file to CMDXMLDocument object |
|
78 |
48 * |
79 * |
|
80 |
49 * @since S60 v3.2 |
81 * @since S60 v3.2 |
|
82 |
50 * @param aFs file system handle |
83 * @param aFs file system handle |
|
84 |
51 * @param aFileName XML file to read |
85 * @param aFileName XML file to read |
|
86 |
52 */ |
87 */ |
|
88 |
53 CMDXMLDocument* ReadXMLFileL( RFs& aFs, const TDesC& aFileName ); |
89 CMDXMLDocument* ReadXMLFileL( RFs& aFs, const TDesC& aFileName ); |
|
90 |
54 |
91 |
|
92 |
55 private: |
93 private: |
|
94 |
|
95 |
56 |
96 |
57 void ConstructL(); |
97 void ConstructL(); |
58 |
98 |
|
99 |
|
100 |
59 CBSImportFileReader( TBool aUseScheduler ); |
101 CBSImportFileReader( TBool aUseScheduler ); |
|
102 |
|
103 |
60 |
104 |
61 // from base class MMDXMLParserObserver |
105 // from base class MMDXMLParserObserver |
62 |
106 |
|
107 |
|
108 |
63 /** |
109 /** |
|
110 |
64 * From MMDXMLParserObserver. |
111 * From MMDXMLParserObserver. |
|
112 |
65 * Writes text to log |
113 * Writes text to log |
|
114 |
66 * |
115 * |
|
116 |
67 * @since S60 v3.2 |
117 * @since S60 v3.2 |
|
118 |
68 * @param aText text to write |
119 * @param aText text to write |
|
120 |
69 */ |
121 */ |
|
122 |
70 void ParseFileCompleteL(); |
123 void ParseFileCompleteL(); |
|
124 |
71 |
125 |
|
126 |
72 private: // Data |
127 private: // Data |
|
128 |
73 |
129 |
|
130 |
74 // Own. XML parser |
131 // Own. XML parser |
|
132 |
75 CMDXMLParser* iParser; |
133 CMDXMLParser* iParser; |
|
134 |
76 |
135 |
|
136 |
77 // Own. XML document from parser |
137 // Own. XML document from parser |
|
138 |
78 CMDXMLDocument* iDocument; |
139 CMDXMLDocument* iDocument; |
79 |
140 |
|
141 |
|
142 |
80 // Own. ActiveScheduler |
143 // Own. ActiveScheduler |
|
144 |
81 CActiveScheduler* iScheduler; |
145 CActiveScheduler* iScheduler; |
82 |
146 |
|
147 |
|
148 |
83 // Own. Scheduler waiter. Used when we can't use scheduler directly. |
149 // Own. Scheduler waiter. Used when we can't use scheduler directly. |
|
150 |
84 CActiveSchedulerWait* iWaiter; |
151 CActiveSchedulerWait* iWaiter; |
|
152 |
85 |
153 |
|
154 |
86 // Wheter we use CActiveScheduler or CActiveSchedulerWait |
155 // Wheter we use CActiveScheduler or CActiveSchedulerWait |
|
156 |
87 TBool iUseScheduler; |
157 TBool iUseScheduler; |
|
158 |
88 }; |
159 }; |
89 |
160 |
|
161 |
|
162 |
90 #endif //CBSIMPORTFILEREADER_H |
163 #endif //CBSIMPORTFILEREADER_H |
|
164 |