#include <mi32/htmldoc.h>

Public Types | |
| typedef fastdelegate::FastDelegate < void(const DRECT2D &clip)> | DELEGATE_REDRAW |
Public Member Functions | |
| HTMLDOC () | |
| virtual | ~HTMLDOC () |
| void | AddInlineImage (const MISTRING &key, MGD::DEVICE *Device, bool bTakeOwnership) |
| void | DoLayout (MGD::CONTEXT *context, double MaxWidth) |
| void | Draw (MGD::CONTEXT *context, const DPOINT2D *offset=0, const DRECT2D *cliprect=0, bool bDrawAll=true) |
| ELEMENT * | FindElement (const DPOINT2D &pt) |
| const ELEMENT * | FindElement (const DPOINT2D &pt) const |
| bool | GetAccurateZoom () const |
| void | GetDirtyRegion (REGION2D ®ion) |
| bool | GetFullRedraw () const |
| double | GetHeight () const |
| bool | GetLink (const DPOINT2D &pt, MISTRING &href) const |
| void | GetTitleOrFirstLine (MISTRING &string, int maxlen=80) const |
| bool | GetTooltip (const DPOINT2D &pt, MISTRING &tooltip) const |
| double | GetWidth () const |
| double | GetZoom () const |
| ERRVALUE | Parse (const UINT8 *buffer) |
| ERRVALUE | Read (const FILEPATH &filepath) |
| void | SetAccurateZoom (bool val=true) |
| void | SetDefaultTextStyle (const TEXTSTYLE &Style) |
| void | SetDelegateRedraw (DELEGATE_REDRAW delegate) |
| void | SetSourceFile (const FILEPATH &url) |
| void | SetSourceURL (const MISTRING &url) |
| void | SetTransAffine (const TRANS2D_AFFINE &trans) |
| void | SetZoom (double zoom) |
| typedef fastdelegate::FastDelegate<void(const DRECT2D& clip)> HTML::HTMLDOC::DELEGATE_REDRAW |
| HTML::HTMLDOC::HTMLDOC | ( | ) |
| virtual HTML::HTMLDOC::~HTMLDOC | ( | ) | [virtual] |
| void HTML::HTMLDOC::AddInlineImage | ( | const MISTRING & | key, | |
| MGD::DEVICE * | Device, | |||
| bool | bTakeOwnership | |||
| ) |
| void HTML::HTMLDOC::DoLayout | ( | MGD::CONTEXT * | context, | |
| double | MaxWidth | |||
| ) |
Compute the size of the HTML document.
Call GetHeight()/GetWidth() after computing the size.
| context | MGD context -- needed for size calculations | |
| MaxWidth | Maximum width in pixels |
| void HTML::HTMLDOC::Draw | ( | MGD::CONTEXT * | context, | |
| const DPOINT2D * | offset = 0, |
|||
| const DRECT2D * | cliprect = 0, |
|||
| bool | bDrawAll = true | |||
| ) |
Draws the document in the given MGD context.
| offset | If not NULL, the coordinate of the upper-left corner of the document | |
| cliprect | If not NULL, the portion of the document to draw | |
| bDrawAll | If false, only draw elements marked as needing to be redrawn |
Find an element at a given point (non-const).
Find an element at a given point (const).
| bool HTML::HTMLDOC::GetAccurateZoom | ( | ) | const |
Determine if the document requires accurate zooming.
The default is false unless SetAccurateZoom() has been called.
| void HTML::HTMLDOC::GetDirtyRegion | ( | REGION2D & | region | ) |
| bool HTML::HTMLDOC::GetFullRedraw | ( | ) | const |
Get the value of the bFullRedraw parameter to the last Draw call Used by elements during a redraw.
| double HTML::HTMLDOC::GetHeight | ( | ) | const [inline] |
Get the height of the document in pixels Note: you must call DoLayout() after parsing before calling GetHeight().
If the affine transformation includes rotation, the height is of the unrotated content.
Check to see if there is a hyper link at a given point.
Returns true if the point is a hyper link and returns the URL in the href parameter.
| void HTML::HTMLDOC::GetTitleOrFirstLine | ( | MISTRING & | string, | |
| int | maxlen = 80 | |||
| ) | const |
Gets the contents of the <title> tag (if any) or the first line of text.
The maxlen parameter controls how much of the body text to get if there is no title tag.
Check to see if there is a tooltip for a given point.
Returns true if the point is over an element with a title attribute or an image with an alt attribute. Returns the tooltip text in the tooltip parameter.
| double HTML::HTMLDOC::GetWidth | ( | ) | const [inline] |
Get the width of the document in pixels Note: you must call DoLayout() after parsing before calling GetWidth(); If the affine transformation includes rotation, the width is of the unrotated content.
| double HTML::HTMLDOC::GetZoom | ( | ) | const [inline] |
| void HTML::HTMLDOC::SetAccurateZoom | ( | bool | val = true |
) |
Set accurate zooming.
If set, the CSS measurement 1px will be assumed to be approx 1/100th of an inch regardless of the actual device resolution. If not set, 1px == 1 device pixel. This must be called BEFORE DoLayout()
| void HTML::HTMLDOC::SetDefaultTextStyle | ( | const TEXTSTYLE & | Style | ) |
Set the default text style for the body.
| void HTML::HTMLDOC::SetDelegateRedraw | ( | DELEGATE_REDRAW | delegate | ) | [inline] |
Set a delegate to call when things need to be redrawn.
The delegate will be given a DRECT2D with the absolute extents of the area to be redrawn
| void HTML::HTMLDOC::SetSourceFile | ( | const FILEPATH & | url | ) |
| void HTML::HTMLDOC::SetSourceURL | ( | const MISTRING & | url | ) |
Set the source URL The source URL is used if the HTML refers to other files using relative paths.
| void HTML::HTMLDOC::SetTransAffine | ( | const TRANS2D_AFFINE & | trans | ) |
Set an affine transformation for rendering the output.
NOTE: Currently the only transformation supported is scale, and it assumes that xscale == yscale All scaling is applied when doing the layout. Offset and Rotation are only applied on Draw() Note: calling this method forces accurate zooming (See SetAccurateZoom() for details)
| void HTML::HTMLDOC::SetZoom | ( | double | zoom | ) |
Set the zoom factor of the document Default zoom is 1.0.
This forces offset and rotation to 0. Note: setting zoom forces accurate zooming (See SetAccurateZoom() for details)
1.6.1