wxhtmlwinparserthis class is derived from wxhtmlparser and its main goal is to parse html input so that it can be displayed in wxhtmlwindow. it uses a special wxhtmlwintaghandler. notes the product of parsing is a wxhtmlcell (resp. wxhtmlcontainer) object. derived from include files <wx/html/winpars.h> see also members
wxhtmlwinparser::wxhtmlwinparser
wxhtmlwinparser::wxhtmlwinparserwxhtmlwinparser() wxhtmlwinparser(wxhtmlwindowinterface *wndiface) constructor. don't use the default one, use constructor with wndiface parameter (wndiface is a pointer to interface object for the associated wxhtmlwindow or other html rendering window such as wxhtmllistbox).
wxhtmlwinparser::addmodulestatic void addmodule(wxhtmltagsmodule *module) adds module to the list of wxhtmlwinparser tag handler.
wxhtmlwinparser::closecontainerwxhtmlcontainercell* closecontainer() closes the container, sets actual container to the parent one and returns pointer to it (see overview).
wxhtmlwinparser::createcurrentfontvirtual wxfont* createcurrentfont() creates font based on current setting (see setfontsize, setfontbold, setfontitalic, setfontfixed, setfontunderlined) and returns pointer to it. if the font was already created only a pointer is returned.
wxhtmlwinparser::getactualcolorconst wxcolour& getactualcolor() const returns actual text colour.
wxhtmlwinparser::getalignint getalign() const returns default horizontal alignment.
wxhtmlwinparser::getcharheightint getcharheight() const returns (average) char height in standard font. it is used as dc-independent metrics. note: this function doesn't return the actual height. if you want to know the height of the current font, call getdc -> getcharheight().
wxhtmlwinparser::getcharwidthint getcharwidth() const returns average char width in standard font. it is used as dc-independent metrics. note: this function doesn't return the actual width. if you want to know the height of the current font, call getdc -> getcharwidth()
wxhtmlwinparser::getcontainerwxhtmlcontainercell* getcontainer() const returns pointer to the currently opened container (see overview). common use:
m_wparser -> getcontainer() -> insertcell(new ...); wxhtmlwinparser::getdcwxdc* getdc() returns pointer to the dc used during parsing.
wxhtmlwinparser::getencodingconverterwxencodingconverter * getencodingconverter() const returns wxencodingconverter class used to do conversion between input encoding and output encoding.
wxhtmlwinparser::getfontboldint getfontbold() const returns true if actual font is bold, false otherwise.
wxhtmlwinparser::getfontfacewxstring getfontface() const returns actual font face name.
wxhtmlwinparser::getfontfixedint getfontfixed() const returns true if actual font is fixed face, false otherwise.
wxhtmlwinparser::getfontitalicint getfontitalic() const returns true if actual font is italic, false otherwise.
wxhtmlwinparser::getfontsizeint getfontsize() const returns actual font size (html size varies from -2 to +4)
wxhtmlwinparser::getfontunderlinedint getfontunderlined() const returns true if actual font is underlined, false otherwise.
wxhtmlwinparser::getinputencodingwxfontencoding getinputencoding() const returns input encoding.
wxhtmlwinparser::getlinkconst wxhtmllinkinfo& getlink() const returns actual hypertext link. (this value has a non-empty href string if the parser is between <a> and </a> tags, wxemptystring otherwise.)
wxhtmlwinparser::getlinkcolorconst wxcolour& getlinkcolor() const returns the colour of hypertext link text.
wxhtmlwinparser::getoutputencodingwxfontencoding getoutputencoding() const returns output encoding, i.e. closest match to document's input encoding that is supported by operating system.
wxhtmlwinparser::getwindowwxhtmlwindow* getwindow() returns associated window (wxhtmlwindow). this may be null! (you should always test if it is non-null. for example title handler sets window title only if some window is associated, otherwise it does nothing)
wxhtmlwinparser::opencontainerwxhtmlcontainercell* opencontainer() opens new container and returns pointer to it (see overview).
wxhtmlwinparser::setactualcolorvoid setactualcolor(const wxcolour& clr) sets actual text colour. note: this doesn't change the colour! you must create wxhtmlcolourcell yourself.
wxhtmlwinparser::setalignvoid setalign(int a) sets default horizontal alignment (see wxhtmlcontainercell::setalignhor.) alignment of newly opened container is set to this value.
wxhtmlwinparser::setcontainerwxhtmlcontainercell* setcontainer(wxhtmlcontainercell *c) allows you to directly set opened container. this is not recommended - you should use opencontainer wherever possible.
wxhtmlwinparser::setdcvirtual void setdc(wxdc *dc, double pixel_scale = 1.0) sets the dc. this must be called before parse! pixel_scale can be used when rendering to high-resolution dcs (e.g. printer) to adjust size of pixel metrics. (many dimensions in html are given in pixels -- e.g. image sizes. 300x300 image would be only one inch wide on typical printer. with pixel_scale = 3.0 it would be 3 inches.)
wxhtmlwinparser::setfontboldvoid setfontbold(int x) sets bold flag of actualfont. x is either true of false.
wxhtmlwinparser::setfontfacevoid setfontface(const wxstring& face) sets current font face to face. this affects either fixed size font or proportional, depending on context (whether the parser is inside <tt> tag or not).
wxhtmlwinparser::setfontfixedvoid setfontfixed(int x) sets fixed face flag of actualfont. x is either true of false.
wxhtmlwinparser::setfontitalicvoid setfontitalic(int x) sets italic flag of actualfont. x is either true of false.
wxhtmlwinparser::setfontsizevoid setfontsize(int s) sets actual font size (html size varies from 1 to 7)
wxhtmlwinparser::setfontunderlinedvoid setfontunderlined(int x) sets underlined flag of actualfont. x is either true of false.
wxhtmlwinparser::setfontsvoid setfonts(const wxstring& normal_face, const wxstring& fixed_face, const int *sizes = null) sets fonts. see wxhtmlwindow::setfonts for detailed description.
wxhtmlwinparser::setinputencodingvoid setinputencoding(wxfontencoding enc) sets input encoding. the parser uses this information to build conversion tables from document's encoding to some encoding supported by operating system.
wxhtmlwinparser::setlinkvoid setlink(const wxhtmllinkinfo& link) sets actual hypertext link. empty link is represented by wxhtmllinkinfo with href equal to wxemptystring.
wxhtmlwinparser::setlinkcolorvoid setlinkcolor(const wxcolour& clr) sets colour of hypertext link.
|