Contents Up Previous Next

wxHtmlWinParser

This class is derived from wxHtmlParser and its mail goal is to parse HTML input so that it can be displayed in wxHtmlWindow. It uses special wxHtmlWinTagHandler.

Notes

  1. Product of parsing is wxHtmlCell (resp. wxHtmlContainer) object.
  2. This parser produces temporary data! You should call delete GetTempData()!

Derived from

wxHtmlParser

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::GetFontBold
wxHtmlWinParser::GetFontFixed
wxHtmlWinParser::GetFontItalic
wxHtmlWinParser::GetFontSize
wxHtmlWinParser::GetFontUnderlined
wxHtmlWinParser::GetLink
wxHtmlWinParser::GetLinkColor
wxHtmlWinParser::GetWindow
wxHtmlWinParser::OpenContainer
wxHtmlWinParser::SetActualColor
wxHtmlWinParser::SetAlign
wxHtmlWinParser::SetDC
wxHtmlWinParser::SetFontBold
wxHtmlWinParser::SetFontFixed
wxHtmlWinParser::SetFontItalic
wxHtmlWinParser::SetFontSize
wxHtmlWinParser::SetFontUnderlined
wxHtmlWinParser::SetFonts
wxHtmlWinParser::SetLink
wxHtmlWinParser::SetLinkColor


wxHtmlWinParser::wxHtmlWinParser

wxHtmlWinParser()

wxHtmlWinParser(wxWindow *wnd)

Constructor. Don't use the default one, use constructor with wnd paremeter (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.)

Fonts created during parsing are temporary data and are not freed on DoneParser. You must call delete myparser->GetTempData(); to free the memory!


wxHtmlWinParser::GetActualColor

const wxColour& GetActualColor() const

Returns actual text color.


wxHtmlWinParser::GetAlign

int GetAlign() const

Returns default horizontal alignment.


wxHtmlWinParser::GetCharHeight

int GetCharHeight() const

Returns (average) char height in standard font. It's used as DC-independent metrics.

Note: This function doesn't return 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's used as DC-independent metrics.

Note: This function doesn't return 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 currectly opened container (see Overview). Common use:

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

wxHtmlWinParser::GetDC

wxDC* GetDC()

Returns pointer to the DC used during parsing.


wxHtmlWinParser::GetFontBold

int GetFontBold() const

Returns TRUE if actual font is bold, FALSE otherwise.


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::GetLink

const wxString& GetLink() const

Returns actual hypertext link. (This value is non-empty string if the parser is between <A> and </A> tags, wxEmptyString otherwise.


wxHtmlWinParser::GetLinkColor

const wxColour& GetLinkColor() const

Returns color of hypertext link text.


wxHtmlWinParser::GetWindow

wxWindow* 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 color. Note: this DOESN'T change the color! 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::SetDC

virtual void SetDC(wxDC *dc)

Sets the DC. This must be called before Parse!


wxHtmlWinParser::SetFontBold

void SetFontBold(int x)

Sets bold flag of actualfont. x is either TRUE of FALSE.


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 -2 to +4)


wxHtmlWinParser::SetFontUnderlined

void SetFontUnderlined(int x)

Sets underlined flag of actualfont. x is either TRUE of FALSE.


wxHtmlWinParser::SetFonts

void SetFonts(wxString normal_face, int normal_italic_mode, wxString fixed_face, int fixed_italic_mode, const int *sizes)

Sets fonts. This method is identical to wxHtmlWindow::SetFonts


wxHtmlWinParser::SetLink

void SetLink(const wxString& link)

Sets actual hypertext link. wxEmptyString means no link.


wxHtmlWinParser::SetLinkColor

void SetLinkColor(const wxColour& clr)

Sets color of hypertext link.