This 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::AddModule
wxHtmlWinParser::CloseContainer
wxHtmlWinParser::CreateCurrentFont
wxHtmlWinParser::GetActualColor
wxHtmlWinParser::GetAlign
wxHtmlWinParser::GetCharHeight
wxHtmlWinParser::GetCharWidth
wxHtmlWinParser::GetContainer
wxHtmlWinParser::GetDC
wxHtmlWinParser::GetEncodingConverter
wxHtmlWinParser::GetFontBold
wxHtmlWinParser::GetFontFace
wxHtmlWinParser::GetFontFixed
wxHtmlWinParser::GetFontItalic
wxHtmlWinParser::GetFontSize
wxHtmlWinParser::GetFontUnderlined
wxHtmlWinParser::GetInputEncoding
wxHtmlWinParser::GetLink
wxHtmlWinParser::GetLinkColor
wxHtmlWinParser::GetOutputEncoding
wxHtmlWinParser::GetWindow
wxHtmlWinParser::OpenContainer
wxHtmlWinParser::SetActualColor
wxHtmlWinParser::SetAlign
wxHtmlWinParser::SetContainer
wxHtmlWinParser::SetDC
wxHtmlWinParser::SetFontBold
wxHtmlWinParser::SetFontFace
wxHtmlWinParser::SetFontFixed
wxHtmlWinParser::SetFontItalic
wxHtmlWinParser::SetFontSize
wxHtmlWinParser::SetFontUnderlined
wxHtmlWinParser::SetFonts
wxHtmlWinParser::SetInputEncoding
wxHtmlWinParser::SetLink
wxHtmlWinParser::SetLinkColor
wxHtmlWinParser()
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).
static void AddModule(wxHtmlTagsModule *module)
Adds module to the list of wxHtmlWinParser tag handler.
wxHtmlContainerCell* CloseContainer()
Closes the container, sets actual container to the parent one and returns pointer to it (see Overview).
virtual 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.
const wxColour& GetActualColor() const
Returns actual text colour.
int GetAlign() const
Returns default horizontal alignment.
int 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().
int 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()
wxHtmlContainerCell* GetContainer() const
Returns pointer to the currently opened container (see Overview). Common use:
m_WParser -> GetContainer() -> InsertCell(new ...);
wxDC* GetDC()
Returns pointer to the DC used during parsing.
wxEncodingConverter * GetEncodingConverter() const
Returns wxEncodingConverter class used to do conversion between input encoding and output encoding.
int GetFontBold() const
Returns true if actual font is bold, false otherwise.
wxString GetFontFace() const
Returns actual font face name.
int GetFontFixed() const
Returns true if actual font is fixed face, false otherwise.
int GetFontItalic() const
Returns true if actual font is italic, false otherwise.
int GetFontSize() const
Returns actual font size (HTML size varies from -2 to +4)
int GetFontUnderlined() const
Returns true if actual font is underlined, false otherwise.
wxFontEncoding GetInputEncoding() const
Returns input encoding.
const 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.)
const wxColour& GetLinkColor() const
Returns the colour of hypertext link text.
wxFontEncoding GetOutputEncoding() const
Returns output encoding, i.e. closest match to document's input encoding that is supported by operating system.
wxHtmlWindow* 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)
wxHtmlContainerCell* OpenContainer()
Opens new container and returns pointer to it (see Overview).
void SetActualColor(const wxColour& clr)
Sets actual text colour. Note: this DOESN'T change the colour! You must create wxHtmlColourCell yourself.
void SetAlign(int a)
Sets default horizontal alignment (see wxHtmlContainerCell::SetAlignHor.) Alignment of newly opened container is set to this value.
wxHtmlContainerCell* SetContainer(wxHtmlContainerCell *c)
Allows you to directly set opened container. This is not recommended - you should use OpenContainer wherever possible.
virtual 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.)
void SetFontBold(int x)
Sets bold flag of actualfont. x is either true of false.
void 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).
void SetFontFixed(int x)
Sets fixed face flag of actualfont. x is either true of false.
void SetFontItalic(int x)
Sets italic flag of actualfont. x is either true of false.
void SetFontSize(int s)
Sets actual font size (HTML size varies from 1 to 7)
void SetFontUnderlined(int x)
Sets underlined flag of actualfont. x is either true of false.
void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = NULL)
Sets fonts. See wxHtmlWindow::SetFonts for detailed description.
void 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.
void SetLink(const wxHtmlLinkInfo& link)
Sets actual hypertext link. Empty link is represented by wxHtmlLinkInfo with Href equal to wxEmptyString.
void SetLinkColor(const wxColour& clr)
Sets colour of hypertext link.