filters
FilterPage.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef FILTERPAGE_H
00021 #define FILTERPAGE_H
00022
00023 #include "TextOutputDev.h"
00024
00025 #include <qdatetime.h>
00026 #include <qptrlist.h>
00027
00028 #include "fstring.h"
00029
00030
00031 namespace PDFImport
00032 {
00033
00034 class Paragraph;
00035 class Data;
00036
00037 class Page : public TextPage
00038 {
00039 public:
00040 Page(Data &data);
00041
00042 QValueVector<DRect> &rects() { return _rects; }
00043 bool hasHeader() const;
00044 bool hasFooter() const;
00045
00046 void clear();
00047
00048
00049 void beginString(GfxState *, double x0, double y0);
00050 void addString(TextString *);
00051 void endString();
00052 void addLink(Link *link) { _links.append(link); }
00053 void endPage();
00054
00055
00056 void dump();
00057
00058 public:
00059 QValueList<QDomElement> pictures;
00060
00061 private:
00062 FontFamily checkSpecial(QChar &, const Font &) const;
00063 static TextBlock *block(TextLine *, int index);
00064 static bool isLastParagraphLine(TextLine *, const Paragraph &);
00065
00066
00067 void createParagraphs();
00068 void checkHeader();
00069 void checkFooter();
00070
00071
00072 void initParagraph(Paragraph &) const;
00073 void fillParagraph(Paragraph &, double &offset) const;
00074 void checkSpecialChars(Paragraph &) const;
00075 void coalesce(Paragraph &) const;
00076 void prepare();
00077 void dump(const Paragraph &);
00078
00079 private:
00080 Data &_data;
00081 QValueList<Paragraph> _pars;
00082 QPtrList<Link> _links;
00083 String *_lastStr;
00084 QTime _time;
00085 QValueVector<DRect> _rects;
00086 };
00087
00088 }
00089
00090 #endif
|