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.
|