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