This class is derived from HtmlParser and its main goal is to parse HTML input so that it can be displayed in HtmlWindow. It uses a special HtmlWinTagHandler.
The product of parsing is a HtmlCell (resp. HtmlContainer) object.
HtmlWinParser.new(HtmlWindow wnd)
Constructor. Don’t use the default one, use constructor with wnd parameter (wnd is pointer to associated HtmlWindow)
add_module(HtmlTagsModule module)
Adds module to the list of HtmlWinParser tag handler.
HtmlContainerCell close_container()
Closes the container, sets actual container to the parent one and returns pointer to it (see Overview).
Font create_current_font()
Creates font based on current setting (see set_font_size, set_font_bold, set_font_italic, set_font_fixed, set_font_underlined) and returns pointer to it. If the font was already created only a pointer is returned.
Colour get_actual_color()
Returns actual text colour.
Integer get_align()
Returns default horizontal alignment.
Integer get_char_height()
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().
Integer get_char_width()
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()
HtmlContainerCell get_container()
Returns pointer to the currently opened container (see Overview). Common use:
m_WParser -> GetContainer() -> InsertCell(new ...);
DC get_dc()
Returns pointer to the DC used during parsing.
EncodingConverter get_encoding_converter()
Returns EncodingConverter class used to do conversion between input encoding and output encoding.
Integer get_font_bold()
Returns true if actual font is bold, false otherwise.
String get_font_face()
Returns actual font face name.
Integer get_font_fixed()
Returns true if actual font is fixed face, false otherwise.
Integer get_font_italic()
Returns true if actual font is italic, false otherwise.
Integer get_font_size()
Returns actual font size (HTML size varies from -2 to +4)
Integer get_font_underlined()
Returns true if actual font is underlined, false otherwise.
FontEncoding get_input_encoding()
Returns input encoding.
HtmlLinkInfo get_link()
Returns actual hypertext link. (This value has a non-empty
Href string
if the parser is between <A> and </A> tags,
EmptyString otherwise.)
Colour get_link_color()
Returns the colour of hypertext link text.
FontEncoding get_output_encoding()
Returns output encoding, i.e. closest match to document’s input encoding that is supported by operating system.
HtmlWindow get_window()
Returns associated window (HtmlWindow). 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)
HtmlContainerCell open_container()
Opens new container and returns pointer to it (see Overview).
set_actual_color(Colour clr)
Sets actual text colour. Note: this DOESN’T change the colour! You must create HtmlColourCell yourself.
set_align(Integer a)
Sets default horizontal alignment (see HtmlContainerCell#set_align_hor.) Alignment of newly opened container is set to this value.
HtmlContainerCell set_container(HtmlContainerCell c)
Allows you to directly set opened container. This is not recommended – you should use OpenContainer wherever possible.
set_dc(DC dc, Float 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. 300×300 image would be only one inch wide on typical printer. With pixel_scale = 3.0 it would be 3 inches.)
set_font_bold(Integer x)
Sets bold flag of actualfont. x is either true of false.
set_font_face(String 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).
set_font_fixed(Integer x)
Sets fixed face flag of actualfont. x is either true of false.
set_font_italic(Integer x)
Sets italic flag of actualfont. x is either true of false.
set_font_size(Integer s)
Sets actual font size (HTML size varies from 1 to 7)
set_font_underlined(Integer x)
Sets underlined flag of actualfont. x is either true of false.
set_fonts(String normal_face, String fixed_face,
Integer sizes = nil)
Sets fonts. See HtmlWindow#set_fonts for detailed description.
set_input_encoding(FontEncoding enc)
Sets input encoding. The parser uses this information to build conversion tables from document’s encoding to some encoding supported by operating system.
set_link(HtmlLinkInfo link)
Sets actual hypertext link. Empty link is represented by HtmlLinkInfo with Href equal to EmptyString.
set_link_color(Colour clr)
Sets colour of hypertext link.
[This page automatically generated from the Textile source at Fri Oct 31 16:06:44 +0000 2008]