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