filters
khtmlreader.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KHTMLREADER_H
00020 #define KHTMLREADER_H
00021
00022 #include <khtml_part.h>
00023 #include <qdom.h>
00024 #include <qptrstack.h>
00025 #include <kwdwriter.h>
00026
00027
00028
00033 namespace DOM {
00034 class Node;
00035 class Element;
00036 }
00037
00038 struct HTMLReader_state {
00039 QDomElement format;
00040 QDomElement frameset;
00041 QDomElement paragraph;
00042 QDomElement layout;
00043 bool in_pre_mode;
00044 };
00045
00046 class KHTMLReader: public QObject {
00047
00048 Q_OBJECT
00049
00050 public:
00051 KHTMLReader(KWDWriter *writer);
00052 ~KHTMLReader();
00053
00054 bool filter(KURL url);
00055
00056 private slots:
00057 void completed();
00058
00059 private:
00060 void parseNode(DOM::Node n);
00061 bool parseTag(DOM::Element e);
00062 void parseStyle(DOM::Element e);
00063 void parse_head(DOM::Element e);
00064 HTMLReader_state *state();
00065 HTMLReader_state *pushNewState();
00066 void popState();
00067
00068
00069
00070
00071
00072
00073
00074 QPtrStack<HTMLReader_state> _state;
00075 KHTMLPart *_html;
00076 KWDWriter *_writer;
00077
00078 void startNewLayout(bool startNewFormat=false);
00079 void startNewLayout(bool startNewFormat, QDomElement layout);
00080 void startNewParagraph(bool startnewformat=true, bool startnewlayout=true);
00081 bool _it_worked;
00082
00083 int _list_depth;
00084
00085 bool parse_CommonAttributes(DOM::Element e);
00086 bool parse_a(DOM::Element e);
00087 bool parse_p(DOM::Element e);
00088 bool parse_br(DOM::Element e);
00089 bool parse_table(DOM::Element e);
00090 bool parse_pre(DOM::Element e);
00091 bool parse_font(DOM::Element e);
00092 bool parse_ol(DOM::Element e);
00093 bool parse_ul(DOM::Element e);
00094 bool parse_hr(DOM::Element e);
00095 bool parse_img(DOM::Element e);
00096
00097
00098
00099
00100 };
00101
00102 #endif
|