Scribus
Open source desktop publishing at your fingertips
scxmlstreamreader.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 #ifndef SCXMLSTREAMREADER_H
8 #define SCXMLSTREAMREADER_H
9 
10 #include <QXmlStreamAttributes>
11 #include <QXmlStreamReader>
12 
13 #include "scribusapi.h"
14 
15 class SCRIBUS_API ScXmlStreamAttributes : public QXmlStreamAttributes
16 {
17 public:
18 
20  ScXmlStreamAttributes(const QXmlStreamAttributes& attrs);
21 
22  bool valueAsBool (const char* attrName, bool def = false) const;
23  bool valueAsBool (const QString& attrName, bool def = false) const;
24  int valueAsInt (const char* attrName, int def = 0) const;
25  int valueAsInt (const QString& attrName, int def = 0) const;
26  int valueAsInt (const char* attrName, int min, int max, int def = 0) const;
27  int valueAsInt (const QString& attrName, int min, int max, int def = 0) const;
28  uint valueAsUInt (const char* attrName, uint def = 0) const;
29  uint valueAsUInt (const QString& attrName, uint def = 0) const;
30  double valueAsDouble (const char* attrName, double def = 0.0) const;
31  double valueAsDouble (const QString& attrName, double def = 0.0) const;
32  QString valueAsString (const char* attrName, const QString def = QString()) const;
33  QString valueAsString (const QString& attrName, const QString def = QString()) const;
34 };
35 
36 class SCRIBUS_API ScXmlStreamReader : public QXmlStreamReader
37 {
38 public:
39  ScXmlStreamReader(const QString& string) : QXmlStreamReader(string) {};
40  ScXmlStreamReader(QIODevice* device) : QXmlStreamReader(device) {};
41  ScXmlStreamAttributes scAttributes(void) const;
42 
43  void readToElementEnd(void);
44 };
45 
46 #endif
Definition: scxmlstreamreader.h:36
Definition: scxmlstreamreader.h:15