gSAFE  1.3.8
docgen.h
1 /* gSAFE - LIB
2  general Sql dAtabase FrontEnd
3  http://hyperprog.com/gsafe/
4 
5  (C) 2005-2013 Peter Deak (hyper80@gmail.com)
6 
7  License: GPLv2 http://www.gnu.org/licenses/gpl-2.0.html
8 
9  docgen.h
10 */
11 
12 #ifndef GSAFE__DOCGEN_HEADER_FILE_X_
13 #define GSAFE__DOCGEN_HEADER_FILE_X_
14 
15 #include <QtCore>
16 #include <QtXml>
17 
19 /* @{ */
20 
21 #include "res_p.h"
22 
23 class HTable;
24 class HFloatTables;
25 
41 class HyperDoc : public QObject , QXmlDefaultHandler
42 {
43  Q_OBJECT
44 
45 public:
48  HyperDoc(QString n);
50  ~HyperDoc();
51 
53  void clear();
55  void set(QString docstr);
57  void add(QString docstr);
58 
61  void clearResources();
62 
68  void addDataSource(HTable *ht,QString redefinedName = "");
77 
78 
80  QString getRawDoc();
82  QString generateDoc();
83 
85  QString getName(void) { return name; }
87  void setName(QString n) { name=n; }
88 
89 private:
90  bool startDocument(void);
91  bool endDocument(void);
92  bool startElement( const QString& ns, const QString& ln, const QString& name,
93  const QXmlAttributes& atts);
94  bool endElement( const QString& ns, const QString& ln, const QString& name);
95  bool processingInstruction(const QString &target,const QString &data);
96  bool skippedEntity(const QString &name);
97  bool characters(const QString& ch);
98  bool warning(const QXmlParseException& exception);
99  bool error(const QXmlParseException& exception);
100  bool fatalError(const QXmlParseException& exception);
101  QString errorString(void) { return errstr; }
102 
103  HTable* getDataTable(QString data);
104  HFloatTables* getFloatDataTable(QString data) { return getHFT(data); }
105 
106 protected:
107  void clearBuffer();
108 
109  QString getData(QString data);
110 
111  QString getRes(QString res);
112  HFloatTables* getHFT(QString res);
113 
114  void out(QString o);
115 
116 protected:
117  QString name;
118  QString body; //Base text body
119  QString preprocessed;
120  QString errstr;
121 
122  bool ignore;
123  bool itermode;
124  QString buffer,iterbuffer,iter_hft_name,iter_notfound;
125 
126  QString att_begin,att_end,att_notfound;
127  HTable *insideIter;
128  int skip_cond_deep;
129 
130 public:
131  QList<HResourceProvider *> *resourceProviders;
132  QList<HTable *> *dtsp;
133  QList<QString> *dtsn;
134  QList<HFloatTables *> *fts;
135 
136 signals:
138  void errorSignal(QString err);
139 
140 };
141 
142 /* @} */
143 
144 #endif
void clear()
Definition: docgen.cpp:50
~HyperDoc()
Definition: docgen.cpp:38
void add(QString docstr)
Definition: docgen.cpp:60
void addDataSource(HTable *ht, QString redefinedName="")
Definition: docgen.cpp:73
void setName(QString n)
Definition: docgen.h:87
QString getName(void)
Definition: docgen.h:85
void addIterDataTables(HFloatTables *ft)
Definition: docgen.cpp:89
void addResourceProvider(HResourceProvider *rp)
Definition: docgen.cpp:84
void clearResources()
Definition: docgen.cpp:65
HyperDoc(QString n)
Definition: docgen.cpp:19
void set(QString docstr)
Definition: docgen.cpp:55
void errorSignal(QString err)
QString getRawDoc()
Definition: docgen.cpp:94
QString generateDoc()
Definition: docgen.cpp:200