## wxHtmlWinParser

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

wxHtmlParser

Include files

<wx/html/winpars.h>

See Also

Handlers overview

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

wxHtmlWinParser()

wxHtmlWinParser(wxHtmlWindow *wnd)

Constructor. Don't use the default one, use constructor with wnd parameter (wnd is pointer to associated wxHtmlWindow)

### wxHtmlWinParser::AddModule

static void AddModule(wxHtmlTagsModule *module)

Adds module to the list of wxHtmlWinParser tag handler.

### wxHtmlWinParser::CloseContainer

wxHtmlContainerCell* CloseContainer()

Closes the container, sets actual container to the parent one and returns pointer to it (see Overview).

### wxHtmlWinParser::CreateCurrentFont

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.

### wxHtmlWinParser::GetActualColor

const wxColour& GetActualColor() const

Returns actual text colour.

### wxHtmlWinParser::GetAlign

int GetAlign() const

Returns default horizontal alignment.

### wxHtmlWinParser::GetCharHeight

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()`.

### wxHtmlWinParser::GetCharWidth

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()`

### wxHtmlWinParser::GetContainer

wxHtmlContainerCell* GetContainer() const

Returns pointer to the currently opened container (see Overview). Common use:

    m_WParser -> GetContainer() -> InsertCell(new ...);

### wxHtmlWinParser::GetDC

wxDC* GetDC()

Returns pointer to the DC used during parsing.

### wxHtmlWinParser::GetEncodingConverter

wxEncodingConverter * GetEncodingConverter() const

Returns wxEncodingConverter class used to do conversion between input encoding and output encoding.

### wxHtmlWinParser::GetFontBold

int GetFontBold() const

Returns true if actual font is bold, false otherwise.

### wxHtmlWinParser::GetFontFace

wxString GetFontFace() const

Returns actual font face name.

### wxHtmlWinParser::GetFontFixed

int GetFontFixed() const

Returns true if actual font is fixed face, false otherwise.

### wxHtmlWinParser::GetFontItalic

int GetFontItalic() const

Returns true if actual font is italic, false otherwise.

### wxHtmlWinParser::GetFontSize

int GetFontSize() const

Returns actual font size (HTML size varies from -2 to +4)

### wxHtmlWinParser::GetFontUnderlined

int GetFontUnderlined() const

Returns true if actual font is underlined, false otherwise.

### wxHtmlWinParser::GetInputEncoding

wxFontEncoding GetInputEncoding() const

Returns input encoding.

### wxHtmlWinParser::GetLink

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

### wxHtmlWinParser::GetLinkColor

const wxColour& GetLinkColor() const

Returns the colour of hypertext link text.

### wxHtmlWinParser::GetOutputEncoding

wxFontEncoding GetOutputEncoding() const

Returns output encoding, i.e. closest match to document's input encoding that is supported by operating system.

### wxHtmlWinParser::GetWindow

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)

### wxHtmlWinParser::OpenContainer

wxHtmlContainerCell* OpenContainer()

Opens new container and returns pointer to it (see Overview).

### wxHtmlWinParser::SetActualColor

void SetActualColor(const wxColour& clr)

Sets actual text colour. Note: this DOESN'T change the colour! You must create wxHtmlColourCell yourself.

### wxHtmlWinParser::SetAlign

void SetAlign(int a)

Sets default horizontal alignment (see wxHtmlContainerCell::SetAlignHor.) Alignment of newly opened container is set to this value.

### wxHtmlWinParser::SetContainer

wxHtmlContainerCell* SetContainer(wxHtmlContainerCell *c)

Allows you to directly set opened container. This is not recommended - you should use OpenContainer wherever possible.

### wxHtmlWinParser::SetDC

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

### wxHtmlWinParser::SetFontBold

void SetFontBold(int x)

Sets bold flag of actualfont. x is either true of false.

### wxHtmlWinParser::SetFontFace

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

### wxHtmlWinParser::SetFontFixed

void SetFontFixed(int x)

Sets fixed face flag of actualfont. x is either true of false.

### wxHtmlWinParser::SetFontItalic

void SetFontItalic(int x)

Sets italic flag of actualfont. x is either true of false.

### wxHtmlWinParser::SetFontSize

void SetFontSize(int s)

Sets actual font size (HTML size varies from 1 to 7)

### wxHtmlWinParser::SetFontUnderlined

void SetFontUnderlined(int x)

Sets underlined flag of actualfont. x is either true of false.

### wxHtmlWinParser::SetFonts

void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = NULL)

Sets fonts. See wxHtmlWindow::SetFonts for detailed description.

### wxHtmlWinParser::SetInputEncoding

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.

### wxHtmlWinParser::SetLink

void SetLink(const wxHtmlLinkInfo& link)

Sets actual hypertext link. Empty link is represented by wxHtmlLinkInfo with Href equal to wxEmptyString.

### wxHtmlWinParser::SetLinkColor

void SetLinkColor(const wxColour& clr)

Sets colour of hypertext link.