27 const char ICONURI[] = "iconuri"; |
27 const char ICONURI[] = "iconuri"; |
28 const char ICON[] = "icon"; |
28 const char ICON[] = "icon"; |
29 const char DESCRIPTION[] = "description"; |
29 const char DESCRIPTION[] = "description"; |
30 const char HIDDEN[] = "hidden"; |
30 const char HIDDEN[] = "hidden"; |
31 const char SERVICEXML[] = "servicexml"; |
31 const char SERVICEXML[] = "servicexml"; |
|
32 const char PREVIEWIAMGE[] = "previewimage"; |
32 const char VERSION[] = "version"; |
33 const char VERSION[] = "version"; |
33 const char VERSION_1_0[] = "1.0"; |
34 const char VERSION_1_0[] = "1.0"; |
|
35 const char TRANSLATIONFILENAME[] = "translationfile"; |
34 |
36 |
35 |
37 |
36 |
38 |
37 HsWidgetComponentParser::HsWidgetComponentParser(const QString &aComponentManifest, QObject *parent) |
39 HsWidgetComponentParser::HsWidgetComponentParser(const QString &aComponentManifest, QObject *parent) |
38 : QObject(parent),mError(false) |
40 : QObject(parent),mError(false) |
158 if(mParser.tokenType() != QXmlStreamReader::Characters) { |
164 if(mParser.tokenType() != QXmlStreamReader::Characters) { |
159 return; |
165 return; |
160 } |
166 } |
161 mComponentDescriptor.uri = mParser.text().toString(); |
167 mComponentDescriptor.uri = mParser.text().toString(); |
162 } |
168 } |
|
169 |
163 void HsWidgetComponentParser::parseIcon() |
170 void HsWidgetComponentParser::parseIcon() |
164 { |
171 { |
165 mParser.readNext(); |
172 mParser.readNext(); |
166 if(mParser.tokenType() != QXmlStreamReader::Characters) { |
173 if(mParser.tokenType() != QXmlStreamReader::Characters) { |
167 return; |
174 return; |
168 } |
175 } |
169 mComponentDescriptor.iconUri = mParser.text().toString(); |
176 mComponentDescriptor.iconUri = mParser.text().toString(); |
170 } |
177 } |
|
178 |
171 void HsWidgetComponentParser::parseTitle() |
179 void HsWidgetComponentParser::parseTitle() |
172 { |
180 { |
173 mParser.readNext(); |
181 mParser.readNext(); |
174 if(mParser.tokenType() != QXmlStreamReader::Characters) { |
182 if(mParser.tokenType() != QXmlStreamReader::Characters) { |
175 return; |
183 return; |
176 } |
184 } |
177 mComponentDescriptor.title = mParser.text().toString(); |
185 mComponentDescriptor.title = mParser.text().toString(); |
178 } |
186 } |
|
187 |
179 void HsWidgetComponentParser::parseDescription() |
188 void HsWidgetComponentParser::parseDescription() |
180 { |
189 { |
181 mParser.readNext(); |
190 mParser.readNext(); |
182 if(mParser.tokenType() != QXmlStreamReader::Characters) { |
191 if(mParser.tokenType() != QXmlStreamReader::Characters) { |
183 return; |
192 return; |
184 } |
193 } |
185 mComponentDescriptor.description = mParser.text().toString(); |
194 mComponentDescriptor.description = mParser.text().toString(); |
186 } |
195 } |
|
196 |
187 void HsWidgetComponentParser::parseHidden() |
197 void HsWidgetComponentParser::parseHidden() |
188 { |
198 { |
189 mParser.readNext(); |
199 mParser.readNext(); |
190 if(mParser.tokenType() != QXmlStreamReader::Characters) { |
200 if(mParser.tokenType() != QXmlStreamReader::Characters) { |
191 return; |
201 return; |
192 } |
202 } |
193 mComponentDescriptor.hidden = mParser.text().toString(); |
203 mComponentDescriptor.hidden = mParser.text().toString(); |
194 } |
204 } |
|
205 |
195 void HsWidgetComponentParser::parseServiceXml() |
206 void HsWidgetComponentParser::parseServiceXml() |
196 { |
207 { |
197 mParser.readNext(); |
208 mParser.readNext(); |
198 if(mParser.tokenType() != QXmlStreamReader::Characters) { |
209 if(mParser.tokenType() != QXmlStreamReader::Characters) { |
199 return; |
210 return; |
200 } |
211 } |
201 mComponentDescriptor.serviceXml = mParser.text().toString(); |
212 mComponentDescriptor.serviceXml = mParser.text().toString(); |
202 } |
213 } |
203 |
214 |
|
215 void HsWidgetComponentParser::parsePreviewImage() |
|
216 { |
|
217 mParser.readNext(); |
|
218 if(mParser.tokenType() != QXmlStreamReader::Characters) { |
|
219 return; |
|
220 } |
|
221 mComponentDescriptor.previewImage = mParser.text().toString(); |
|
222 } |
|
223 |
|
224 void HsWidgetComponentParser::parseTranslationFileName() |
|
225 { |
|
226 mParser.readNext(); |
|
227 if (mParser.tokenType() != QXmlStreamReader::Characters) { |
|
228 return; |
|
229 } |
|
230 mComponentDescriptor.translationFilename = mParser.text().toString(); |
|
231 } |
|
232 |
204 bool HsWidgetComponentParser::isWidgetTagValid() |
233 bool HsWidgetComponentParser::isWidgetTagValid() |
205 { |
234 { |
206 return true; |
235 return true; |
207 } |
236 } |