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



wxHtmlWinParser::wxHtmlWinParser



wxHtmlWinParser(void)



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

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



wxHtmlWinParser::CreateCurrentFont



virtual wxFont* CreateCurrentFont(void)

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(void) const

Returns actual text colour.



wxHtmlWinParser::GetAlign

int GetAlign(void) const

Returns default horizontal alignment.



wxHtmlWinParser::GetCharHeight

int GetCharHeight(void) 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(void) 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(void) const

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

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



wxHtmlWinParser::GetDC



wxDC* GetDC(void)

Returns pointer to the DC used during parsing.



wxHtmlWinParser::GetEncodingConverter

wxEncodingConverter * GetEncodingConverter(void) const

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



wxHtmlWinParser::GetFontBold

int GetFontBold(void) const

Returns true if actual font is bold, false otherwise.



wxHtmlWinParser::GetFontFace

wxString GetFontFace(void) const

Returns actual font face name.



wxHtmlWinParser::GetFontFixed

int GetFontFixed(void) const

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



wxHtmlWinParser::GetFontItalic

int GetFontItalic(void) const

Returns true if actual font is italic, false otherwise.



wxHtmlWinParser::GetFontSize

int GetFontSize(void) const

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



wxHtmlWinParser::GetFontUnderlined

int GetFontUnderlined(void) const

Returns true if actual font is underlined, false otherwise.



wxHtmlWinParser::GetInputEncoding

wxFontEncoding GetInputEncoding(void) const

Returns input encoding.



wxHtmlWinParser::GetLink

const wxHtmlLinkInfo& GetLink(void) 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(void) const

Returns the colour of hypertext link text.



wxHtmlWinParser::GetOutputEncoding

wxFontEncoding GetOutputEncoding(void) const

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



wxHtmlWinParser::GetWindow



wxHtmlWindow* GetWindow(void)

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

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.

ymasuda 平成17年11月19日