htmlayout.h File Reference

Main include file. More...

#include <windows.h>
#include "htmlayout_dom.h"
#include "htmlayout_behavior.h"

Data Structures

struct  tagNMHL_CREATE_CONTROL
 This structure is used by HLN_CREATE_CONTROL and HLN_CONTROL_CREATED notifications. More...
struct  tagNMHL_DESTROY_CONTROL
 This structure is used by HLN_DESTROY_CONTROL notification. More...
struct  tagNMHL_LOAD_DATA
 This structure is used by HLN_LOAD_DATA notification. More...
struct  tagNMHL_DATA_LOADED
 This structure is used by HLN_DATA_LOADED notification. More...
struct  tagNMHL_ATTACH_BEHAVIOR
 This structure is used by HLN_ATTACH_BEHAVIOR notification. More...
struct  tagNMHL_DIALOG_CLOSE_RQ
 This structure is used by HLN_DIALOG_CLOSE_RQ notification. More...

Defines

#define HTMLayoutClassNameT   HTMLayoutClassNameA
 Returns name of HTMLayout window class.
#define HLN_CREATE_CONTROL   0xAFF + 0x01
 This notification is sent on parsing the document and while handling <INPUT>, <TEXTAREA>, <SELECT> and <WIDGET> tags.
#define HLN_LOAD_DATA   0xAFF + 0x02
 Notifies that HtmLayout is about to download a referred resource.
#define HLN_CONTROL_CREATED   0xAFF + 0x03
 This notification is sent when control creation process has completed.
#define HLN_DATA_LOADED   0xAFF + 0x04
 This notification indicates that external data (for example image) download process completed.
#define HLN_DOCUMENT_COMPLETE   0xAFF + 0x05
 This notification is sent when all external data (for example image) has been downloaded.
#define HLN_UPDATE_UI   0xAFF + 0x06
 This notification instructs host application to update its UI.
#define HLN_DESTROY_CONTROL   0xAFF + 0x07
 This notification is sent when HTMLayout destroys its controls.
#define HLN_ATTACH_BEHAVIOR   0xAFF + 0x08
 This notification is sent on parsing the document and while processing elements having non empty style.behavior attribute value.
#define HLN_DIALOG_CREATED   0xAFF + 0x10
 This notification is sent when dialog window created but document is not loaded.
#define HLN_DIALOG_CLOSE_RQ   0xAFF + 0x11
 This notification is sent when dialog window is about to be closed
  • happens while handling WM_CLOSE in dialog.

#define HWND_TRY_DEFAULT   ((HWND)0)
 Create "default HTML control", used by HLN_CREATE_CONTROL notification as value for NMHL_CREATE_CONTROL::outControlHwnd.
#define HWND_DISCARD_CREATION   ((HWND)1)
 Do not create any controls, used by HLN_CREATE_CONTROL notification as value for NMHL_CREATE_CONTROL::outControlHwnd.
#define LOAD_OK   0
 Use default loader or outData/outDataSize if they are set, used as return value for HLN_CREATE_CONTROL notification.
#define LOAD_DISCARD   1
 Do not load resource at all, Used as return value for HLN_CREATE_CONTROL notification.

Typedefs

typedef LRESULT CALLBACK HTMLAYOUT_NOTIFY (UINT uMsg, WPARAM wParam, LPARAM lParam, LPVOID vParam)
 Notification callback function.
typedef tagNMHL_CREATE_CONTROL NMHL_CREATE_CONTROL
 This structure is used by HLN_CREATE_CONTROL and HLN_CONTROL_CREATED notifications.
typedef tagNMHL_CREATE_CONTROLLPNMHL_CREATE_CONTROL
 This structure is used by HLN_CREATE_CONTROL and HLN_CONTROL_CREATED notifications.
typedef tagNMHL_DESTROY_CONTROL NMHL_DESTROY_CONTROL
 This structure is used by HLN_DESTROY_CONTROL notification.
typedef tagNMHL_DESTROY_CONTROLLPNMHL_DESTROY_CONTROL
 This structure is used by HLN_DESTROY_CONTROL notification.
typedef tagNMHL_LOAD_DATA NMHL_LOAD_DATA
 This structure is used by HLN_LOAD_DATA notification.
typedef tagNMHL_LOAD_DATALPNMHL_LOAD_DATA
 This structure is used by HLN_LOAD_DATA notification.
typedef tagNMHL_DATA_LOADED NMHL_DATA_LOADED
 This structure is used by HLN_DATA_LOADED notification.
typedef tagNMHL_DATA_LOADEDLPNMHL_DATA_LOADED
 This structure is used by HLN_DATA_LOADED notification.
typedef tagNMHL_ATTACH_BEHAVIOR NMHL_ATTACH_BEHAVIOR
 This structure is used by HLN_ATTACH_BEHAVIOR notification.
typedef tagNMHL_ATTACH_BEHAVIORLPNMHL_ATTACH_BEHAVIOR
 This structure is used by HLN_ATTACH_BEHAVIOR notification.
typedef tagNMHL_DIALOG_CLOSE_RQ NMHL_DIALOG_CLOSE_RQ
 This structure is used by HLN_DIALOG_CLOSE_RQ notification.
typedef tagNMHL_DIALOG_CLOSE_RQLPNMHL_DIALOG_CLOSE_RQ
 This structure is used by HLN_DIALOG_CLOSE_RQ notification.
typedef BOOL CALLBACK HTMLAYOUT_CALLBACK_RES (LPCWSTR resourceUri, LPCSTR resourceType, LPCBYTE imageData, DWORD imageDataSize)
 Callback function used with HTMLayoutEnumResources().
typedef VOID(CALLBACK *) DEBUG_OUTPUT_PROC (LPVOID param, INT character)
 HTMLayoutSetupDebugOutput - setup debug output function.

Enumerations

enum  HTMLayoutResourceType
 Resource data type. More...
enum  HTMLayoutModes { HLM_LAYOUT_ONLY = 0, HLM_SHOW_SELECTION = 1 }
 HTMLayout operational modes. More...
enum  HTMLAYOUT_OPTIONS
 Set various options. More...

Functions

EXTERN_C LPCSTR HLAPI HTMLayoutClassNameA ()
 Get name of HTMLayout window class.
EXTERN_C LPCWSTR HLAPI HTMLayoutClassNameW ()
 Get name of HTMLayout window class.
EXTERN_C BOOL HLAPI HTMLayoutDataReady (HWND hwnd, LPCWSTR uri, LPBYTE data, DWORD dataLength)
 This function is used in response to HLN_LOAD_DATA request.
EXTERN_C BOOL HLAPI HTMLayoutDataReadyAsync (HWND hwnd, LPCWSTR uri, LPBYTE data, DWORD dataLength, UINT dataType)
 Use this function outside of HLN_LOAD_DATA request.
EXTERN_C LRESULT HLAPI HTMLayoutProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 HTMLayout Window Proc.
EXTERN_C LRESULT HLAPI HTMLayoutProcND (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL *pbHandled)
 HTMLayout Window Proc without call of DefWindowProc.
EXTERN_C UINT HLAPI HTMLayoutGetMinWidth (HWND hWndHTMLayout)
 Returns minimal width of the document.
EXTERN_C UINT HLAPI HTMLayoutGetMinHeight (HWND hWndHTMLayout, UINT width)
 Returns minimal height of the document.
EXTERN_C BOOL HLAPI HTMLayoutLoadFile (HWND hWndHTMLayout, LPCWSTR filename)
 Load HTML file.
EXTERN_C BOOL HLAPI HTMLayoutLoadHtml (HWND hWndHTMLayout, LPCBYTE html, UINT htmlSize)
 Load HTML from in memory buffer.
EXTERN_C BOOL HLAPI HTMLayoutLoadHtmlEx (HWND hWndHTMLayout, LPCBYTE html, UINT htmlSize, LPCWSTR baseUrl)
 Load HTML from in memory buffer with base.
EXTERN_C VOID HLAPI HTMLayoutSetMode (HWND hWndHTMLayout, int HTMLayoutMode)
 Sets the HTMLayout operational mode .
EXTERN_C VOID HLAPI HTMLayoutSetCallback (HWND hWndHTMLayout, LPHTMLAYOUT_NOTIFY cb, LPVOID cbParam)
 Set notification callback function .
EXTERN_C BOOL HLAPI HTMLayoutSelectionExist (HWND hWndHTMLayout)
 Query whether user have selected some HTML text.
EXTERN_C LPCBYTE HLAPI HTMLayoutGetSelectedHTML (HWND hWndHTMLayout, LPUINT pSize)
 Get selected HTML.
EXTERN_C BOOL HLAPI HTMLayoutClipboardCopy (HWND hWndHTMLayout)
 Copies selection to clipboard.
EXTERN_C UINT HLAPI HTMLayoutEnumResources (HWND hWndHTMLayout, HTMLAYOUT_CALLBACK_RES *cb)
 Enumerates resources loaded with current document.
EXTERN_C BOOL HLAPI HTMLayoutSetMasterCSS (LPCBYTE utf8, UINT numBytes)
 Set Master style sheet.
EXTERN_C BOOL HLAPI HTMLayoutSetCSS (HWND hWndHTMLayout, LPCBYTE utf8, UINT numBytes, LPCWSTR baseUrl, LPCWSTR mediaType)
 Set (reset) style sheet of current document.
EXTERN_C BOOL HLAPI HTMLayoutSetMediaType (HWND hWndHTMLayout, LPCWSTR mediaType)
 Set media type of this htmlayout instance.
EXTERN_C BOOL HLAPI HTMLayoutSetHttpHeaders (HWND hWndHTMLayout, LPCSTR httpHeaders, UINT httpHeadersLength)
 Set additional http headers that will be sent with each http request by this instance of the engine.
EXTERN_C BOOL HLAPI HTMLayoutRender (HWND hWndHTMLayout, HBITMAP hBmp, RECT area)
 Render document to 24bpp or 32bpp bitmap (with alpha).
EXTERN_C INT_PTR HLAPI HTMLayoutDialog (HWND hWndParent, POINT position, INT alignment, UINT style, UINT styleEx, LPHTMLAYOUT_NOTIFY notificationCallback, LPELEMENT_EVENT_PROC eventsCallback, LPVOID callbackParam, LPCBYTE html, UINT htmlLength)
 Show HTML based dialog.


Detailed Description

Main include file.


Define Documentation

#define HLN_ATTACH_BEHAVIOR   0xAFF + 0x08

This notification is sent on parsing the document and while processing elements having non empty style.behavior attribute value.

Parameters:
lParam LPNMHL_ATTACH_BEHAVIOR
Application has to provide implementation of htmlayout::behavior interface. Set NMHL_ATTACH_BEHAVIOR::impl to address of this implementation.

#define HLN_CONTROL_CREATED   0xAFF + 0x03

This notification is sent when control creation process has completed.

Parameters:
lParam LPNMHL_CREATE_CONTROL.
While processing this notification application can modify control settings or store information about the created control. For example it can use SetWindowLong() function, to set control's id:
 SetWindowLong(((LPNMHL_CREATECONTROL)lParam)->outControlHwnd, GWL_ID, controlId)

#define HLN_CREATE_CONTROL   0xAFF + 0x01

This notification is sent on parsing the document and while handling <INPUT>, <TEXTAREA>, <SELECT> and <WIDGET> tags.

Parameters:
lParam LPNMHL_CREATE_CONTROL.
Returns:
HWND of the control or HWND_TRY_DEFAULT or HWND_DISCARD_CREATION.
This notification is sent when HtmLayout is about to create a child control. The application can override the creation of "standard HTML controls" or implement the creation of other application specific controls. To do this assign HWND of newly created control to NMHL_CREATE_CONTROL::outControlHwnd member of NMHL_CREATE_CONTROL.

#define HLN_DATA_LOADED   0xAFF + 0x04

This notification indicates that external data (for example image) download process completed.

Parameters:
lParam LPNMHL_DATA_LOADED
This notifiaction is sent for each external resource used by document when this resource has been completely downloaded. HTMLayout will send this notification asynchronously.

#define HLN_DESTROY_CONTROL   0xAFF + 0x07

This notification is sent when HTMLayout destroys its controls.

Parameters:
lParam LPNMHL_DESTROY_CONTROL Before loading new document HTMLayout destroys all controls belonging to previous document. Host application can reject deletion of the control by setting NMHL_DESTROY_CONTROL::inoutControlHwnd to zero.
Handling of this notification makes sence when you need for example reload HTML without destroying set of controls on HTML form. But you still need to handle NMHL_CREATE_CONTROL notification to bind existing controls with their HTML "places"

Attention:
HTMLayouts sends this notifiation only while loading new or empty document.

#define HLN_DIALOG_CLOSE_RQ   0xAFF + 0x11

This notification is sent when dialog window is about to be closed

Parameters:
lParam LPNMHL_DIALOG_CLOSE_RQ
ATTN: Will be sent ONLY by HTMLayoutDialog API function.

#define HLN_DIALOG_CREATED   0xAFF + 0x10

This notification is sent when dialog window created but document is not loaded.

Parameters:
lParam is a pointer to statndard NMHDR
ATTN: Will be sent ONLY by HTMLayoutDialog API function.

#define HLN_DOCUMENT_COMPLETE   0xAFF + 0x05

This notification is sent when all external data (for example image) has been downloaded.

This notification is sent when all external resources required by document have been completely downloaded. HTMLayout will send this notification asynchronously.

#define HLN_LOAD_DATA   0xAFF + 0x02

Notifies that HtmLayout is about to download a referred resource.

Parameters:
lParam LPNMHL_LOAD_DATA.
Returns:
LOAD_OK or LOAD_DISCARD
This notification gives application a chance to override built-in loader and implement loading of resources in its own way (for example images may be loaded from database or other resource). To do this set NMHL_LOAD_DATA::outData and NMHL_LOAD_DATA::outDataSize members of NMHL_LOAD_DATA. HTMLayout does not store pointer to this data. You can call HTMLayoutDataReady() function instead of filling these fields. This allows you to free your outData buffer immediately.

#define HLN_UPDATE_UI   0xAFF + 0x06

This notification instructs host application to update its UI.

This notification is sent on changes in HTMLayout formatting registers. If application indicates their state on toolbars or using other controls it should update them.

#define HTMLayoutClassNameT   HTMLayoutClassNameA

Returns name of HTMLayout window class.

Returns:
LPCTSTR, name of HTMLayout window class.
This macro is used to select between HTMLayoutClassNameW() and HTMLayoutClassNameA() functions depending on whether UNICODE macro symbol is defined.


Typedef Documentation

typedef VOID(CALLBACK*) DEBUG_OUTPUT_PROC(LPVOID param, INT character)

HTMLayoutSetupDebugOutput - setup debug output function.

This output function will be used for reprting problems found while loading html and css documents.

typedef BOOL CALLBACK HTMLAYOUT_CALLBACK_RES(LPCWSTR resourceUri, LPCSTR resourceType, LPCBYTE imageData, DWORD imageDataSize)

Callback function used with HTMLayoutEnumResources().

Parameters:
[in] resourceUri LPCWSTR, uri used to download resource.
[in] resourceType LPCSTR, type of the resources.
[in] imageData LPCBYTE, address of resource data.
[in] imageDataSize DWORD, resource data size.
Returns:
BOOL, TRUE - continue enumeration, FALSE - stop
This function recieves information on all resources loaded with the currend document.

typedef LRESULT CALLBACK HTMLAYOUT_NOTIFY(UINT uMsg, WPARAM wParam, LPARAM lParam, LPVOID vParam)

Notification callback function.

Parameters:
uMsg UINT, WM_NOTIFY.
wParam WPARAM, control Id.
lParam LPARAM, depends on notification.
vParam LPVOID, value of cbParam parameter passed to HTMLayoutSetCallback function.
Returns:
LRESULT, depends on notification.
If set, HTMLayout will send all HLN_*** notifications to this function. To set notification callback use HTMLayoutSetCallback() function. By default (if callback is not set) HTMLayout will send HLN_*** notifications as WM_NOTIFY messages to its parent window.

typedef struct tagNMHL_ATTACH_BEHAVIOR* LPNMHL_ATTACH_BEHAVIOR

This structure is used by HLN_ATTACH_BEHAVIOR notification.

This notification is sent on parsing the document and while processing elements having non empty style.behavior attribute value.

Parameters:
lParam LPNMHL_ATTACH_BEHAVIOR
Application has to provide implementation of htmlayout::behavior interface. Set NMHL_ATTACH_BEHAVIOR::impl to address of this implementation.

typedef struct tagNMHL_CREATE_CONTROL* LPNMHL_CREATE_CONTROL

This structure is used by HLN_CREATE_CONTROL and HLN_CONTROL_CREATED notifications.

typedef struct tagNMHL_DATA_LOADED* LPNMHL_DATA_LOADED

This structure is used by HLN_DATA_LOADED notification.

This notification indicates that external data (for example image) download process completed.

Parameters:
lParam LPNMHL_DATA_LOADED
This notifiaction is sent for each external resource used by document when this resource has been completely downloaded. HTMLayout will send this notification asynchronously.

typedef struct tagNMHL_DESTROY_CONTROL* LPNMHL_DESTROY_CONTROL

This structure is used by HLN_DESTROY_CONTROL notification.

This notification is sent when HTMLayout destroys its controls.

Parameters:
lParam LPNMHL_DESTROY_CONTROL Before loading new document HTMLayout destroys all controls belonging to previous document. Host application can reject deletion of the control by setting NMHL_DESTROY_CONTROL::inoutControlHwnd to zero.
Handling of this notification makes sence when you need for example reload HTML without destroying set of controls on HTML form. But you still need to handle NMHL_CREATE_CONTROL notification to bind existing controls with their HTML "places"

Attention:
HTMLayouts sends this notifiation only while loading new or empty document.

typedef struct tagNMHL_DIALOG_CLOSE_RQ* LPNMHL_DIALOG_CLOSE_RQ

This structure is used by HLN_DIALOG_CLOSE_RQ notification.

Notifies that HtmLayout is about to download a referred resource.

Parameters:
lParam LPNMHL_LOAD_DATA.
Returns:
LOAD_OK or LOAD_DISCARD
This notification gives application a chance to override built-in loader and implement loading of resources in its own way (for example images may be loaded from database or other resource). To do this set NMHL_LOAD_DATA::outData and NMHL_LOAD_DATA::outDataSize members of NMHL_LOAD_DATA. HTMLayout does not store pointer to this data. You can call HTMLayoutDataReady() function instead of filling these fields. This allows you to free your outData buffer immediately.

typedef struct tagNMHL_LOAD_DATA* LPNMHL_LOAD_DATA

This structure is used by HLN_LOAD_DATA notification.

Notifies that HtmLayout is about to download a referred resource.

Parameters:
lParam LPNMHL_LOAD_DATA.
Returns:
LOAD_OK or LOAD_DISCARD
This notification gives application a chance to override built-in loader and implement loading of resources in its own way (for example images may be loaded from database or other resource). To do this set NMHL_LOAD_DATA::outData and NMHL_LOAD_DATA::outDataSize members of NMHL_LOAD_DATA. HTMLayout does not store pointer to this data. You can call HTMLayoutDataReady() function instead of filling these fields. This allows you to free your outData buffer immediately.

typedef struct tagNMHL_ATTACH_BEHAVIOR NMHL_ATTACH_BEHAVIOR

This structure is used by HLN_ATTACH_BEHAVIOR notification.

This notification is sent on parsing the document and while processing elements having non empty style.behavior attribute value.

Parameters:
lParam LPNMHL_ATTACH_BEHAVIOR
Application has to provide implementation of htmlayout::behavior interface. Set NMHL_ATTACH_BEHAVIOR::impl to address of this implementation.

typedef struct tagNMHL_CREATE_CONTROL NMHL_CREATE_CONTROL

This structure is used by HLN_CREATE_CONTROL and HLN_CONTROL_CREATED notifications.

typedef struct tagNMHL_DATA_LOADED NMHL_DATA_LOADED

This structure is used by HLN_DATA_LOADED notification.

This notification indicates that external data (for example image) download process completed.

Parameters:
lParam LPNMHL_DATA_LOADED
This notifiaction is sent for each external resource used by document when this resource has been completely downloaded. HTMLayout will send this notification asynchronously.

typedef struct tagNMHL_DESTROY_CONTROL NMHL_DESTROY_CONTROL

This structure is used by HLN_DESTROY_CONTROL notification.

This notification is sent when HTMLayout destroys its controls.

Parameters:
lParam LPNMHL_DESTROY_CONTROL Before loading new document HTMLayout destroys all controls belonging to previous document. Host application can reject deletion of the control by setting NMHL_DESTROY_CONTROL::inoutControlHwnd to zero.
Handling of this notification makes sence when you need for example reload HTML without destroying set of controls on HTML form. But you still need to handle NMHL_CREATE_CONTROL notification to bind existing controls with their HTML "places"

Attention:
HTMLayouts sends this notifiation only while loading new or empty document.

typedef struct tagNMHL_DIALOG_CLOSE_RQ NMHL_DIALOG_CLOSE_RQ

This structure is used by HLN_DIALOG_CLOSE_RQ notification.

Notifies that HtmLayout is about to download a referred resource.

Parameters:
lParam LPNMHL_LOAD_DATA.
Returns:
LOAD_OK or LOAD_DISCARD
This notification gives application a chance to override built-in loader and implement loading of resources in its own way (for example images may be loaded from database or other resource). To do this set NMHL_LOAD_DATA::outData and NMHL_LOAD_DATA::outDataSize members of NMHL_LOAD_DATA. HTMLayout does not store pointer to this data. You can call HTMLayoutDataReady() function instead of filling these fields. This allows you to free your outData buffer immediately.

typedef struct tagNMHL_LOAD_DATA NMHL_LOAD_DATA

This structure is used by HLN_LOAD_DATA notification.

Notifies that HtmLayout is about to download a referred resource.

Parameters:
lParam LPNMHL_LOAD_DATA.
Returns:
LOAD_OK or LOAD_DISCARD
This notification gives application a chance to override built-in loader and implement loading of resources in its own way (for example images may be loaded from database or other resource). To do this set NMHL_LOAD_DATA::outData and NMHL_LOAD_DATA::outDataSize members of NMHL_LOAD_DATA. HTMLayout does not store pointer to this data. You can call HTMLayoutDataReady() function instead of filling these fields. This allows you to free your outData buffer immediately.


Enumeration Type Documentation

enum HTMLAYOUT_OPTIONS

Set various options.

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
[in] option UINT, id of the option, one of HTMLAYOUT_OPTIONS
[in] option UINT, value of the option.

enum HTMLayoutModes

HTMLayout operational modes.

Used by HTMLayoutSetMode() function.

Enumerator:
HLM_LAYOUT_ONLY  layout manager and renderer.

HLM_SHOW_SELECTION  layout manager and renderer + text selection and WM_COPY.

enum HTMLayoutResourceType

Resource data type.

Used by HTMLayoutDataReadyAsync() function.


Function Documentation

EXTERN_C LPCSTR HLAPI HTMLayoutClassNameA (  ) 

Get name of HTMLayout window class.

Returns:
LPCSTR, name of HTMLayout window class.
Use this function if you wish to create ansi version of HTMLayout. The returned name can be used in CreateWindow(Ex)A function. You can use HTMLayoutClassNameT macro.

EXTERN_C LPCWSTR HLAPI HTMLayoutClassNameW (  ) 

Get name of HTMLayout window class.

Returns:
LPCWSTR, name of HTMLayout window class.
Use this function if you wish to create unicode version of HTMLayout. The returned name can be used in CreateWindow(Ex)W function. You can use HTMLayoutClassNameT macro.

EXTERN_C BOOL HLAPI HTMLayoutClipboardCopy ( HWND  hWndHTMLayout  ) 

Copies selection to clipboard.

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
Returns:
BOOL, TRUE if selected HTML text has been copied to clipboard, FALSE otherwise.

EXTERN_C BOOL HLAPI HTMLayoutDataReady ( HWND  hwnd,
LPCWSTR  uri,
LPBYTE  data,
DWORD  dataLength 
)

This function is used in response to HLN_LOAD_DATA request.

Parameters:
[in] hwnd HWND, HTMLayout window handle.
[in] uri LPCWSTR, URI of the data requested by HTMLayout.
[in] data LPBYTE, pointer to data buffer.
[in] dataLength DWORD, length of the data in bytes.
Returns:
BOOL, TRUE if HTMLayout accepts the data or FALSE if error occured (for example this function was called outside of HLN_LOAD_DATA request).
Warning:
If used, call of this function MUST be done ONLY while handling HLN_LOAD_DATA request and in the same thread. For asynchronous resource loading use HTMLayoutDataReadyAsync

EXTERN_C BOOL HLAPI HTMLayoutDataReadyAsync ( HWND  hwnd,
LPCWSTR  uri,
LPBYTE  data,
DWORD  dataLength,
UINT  dataType 
)

Use this function outside of HLN_LOAD_DATA request.

This function is needed when you you have your own http client implemented in your application.

Parameters:
[in] hwnd HWND, HTMLayout window handle.
[in] uri LPCWSTR, URI of the data requested by HTMLayout.
[in] data LPBYTE, pointer to data buffer.
[in] dataLength DWORD, length of the data in bytes.
[in] dataType UINT, type of resource to load. See HTMLayoutResourceType.
Returns:
BOOL, TRUE if HTMLayout accepts the data or FALSE if error occured

EXTERN_C INT_PTR HLAPI HTMLayoutDialog ( HWND  hWndParent,
POINT  position,
INT  alignment,
UINT  style,
UINT  styleEx,
LPHTMLAYOUT_NOTIFY  notificationCallback,
LPELEMENT_EVENT_PROC  eventsCallback,
LPVOID  callbackParam,
LPCBYTE  html,
UINT  htmlLength 
)

Show HTML based dialog.

Parameters:
[in] hWndParent HWND, parent window, can be NULL.
[in] position POINT, anchor point.
[in] alignment UINT, alignment of the window, defines corner of the dialog window 'position' points to: Values: 0 - center of the dialog in the center of the screen 1-9 - see NUMPAD digits for what 'position' defines. -1..-9 correspondent corner of the dilaog will be placed to the correspondent corner of window rectangle of hWndParent. Example: -9 dialog will be aligned to top/right corner of the parent window.
[in] style UINT, style of the dialog window. WS_***.
[in] styleEx UINT, extended style of the dialog window, WS_EX_***.
[in] notificationCallback LPHTMLAYOUT_NOTIFY, notifaction callback function, see HTMLayoutSetCallback.
[in] eventsCallback LPELEMENT_EVENT_PROC, event callback function, see HTMLayoutAttachEventHandler.
[in] callbackParam LPVOID, notifaction callback function, see HTMLayoutSetCallback.
[in] html either file name or pointer to buffer containing HTML
[in] htmlLength UINT, number of bytes in 'html'. If it is zero then 'html' points to LPCWSTR string - URL of the document to load. If it is not zero than it shall contain number of bytes in 'html' buffer.

EXTERN_C UINT HLAPI HTMLayoutEnumResources ( HWND  hWndHTMLayout,
HTMLAYOUT_CALLBACK_RES cb 
)

Enumerates resources loaded with current document.

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
[in] cb HTMLAYOUT_CALLBACK_RES*, callback function.

EXTERN_C UINT HLAPI HTMLayoutGetMinHeight ( HWND  hWndHTMLayout,
UINT  width 
)

Returns minimal height of the document.

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
[in] width UINT, desired width of the document.
Returns:
UINT, Minimal height needed to render the document without scrollbar.

EXTERN_C UINT HLAPI HTMLayoutGetMinWidth ( HWND  hWndHTMLayout  ) 

Returns minimal width of the document.

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
Returns:
UINT, Minimal width needed to render the document without scrollbar.

EXTERN_C LPCBYTE HLAPI HTMLayoutGetSelectedHTML ( HWND  hWndHTMLayout,
LPUINT  pSize 
)

Get selected HTML.

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
[out] pSize LPUINT*, variable to recieve size of the returned buffer.
Returns:
LPCBYTE, pointer to buffer containing selected HTML. It is HTMLayout's responsibility to free this buffer.

EXTERN_C BOOL HLAPI HTMLayoutLoadFile ( HWND  hWndHTMLayout,
LPCWSTR  filename 
)

Load HTML file.

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
[in] filename LPCWSTR, File name of an HTML file.
Returns:
BOOL, TRUE if the text was parsed and loaded successfully, FALSE otherwise.

EXTERN_C BOOL HLAPI HTMLayoutLoadHtml ( HWND  hWndHTMLayout,
LPCBYTE  html,
UINT  htmlSize 
)

Load HTML from in memory buffer.

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
[in] html LPCBYTE, Address of HTML to load.
[in] htmlSize UINT, Length of the array pointed by html parameter.
Returns:
BOOL, TRUE if the text was parsed and loaded successfully, FALSE otherwise.

EXTERN_C BOOL HLAPI HTMLayoutLoadHtmlEx ( HWND  hWndHTMLayout,
LPCBYTE  html,
UINT  htmlSize,
LPCWSTR  baseUrl 
)

Load HTML from in memory buffer with base.

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
[in] html LPCBYTE, Address of HTML to load.
[in] htmlSize UINT, Length of the array pointed by html parameter.
[in] baseUrl LPCWSTR, base URL. All relative links will be resolved against this URL.
Returns:
BOOL, TRUE if the text was parsed and loaded successfully, FALSE otherwise.

EXTERN_C LRESULT HLAPI HTMLayoutProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

HTMLayout Window Proc.

EXTERN_C LRESULT HLAPI HTMLayoutProcND ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
BOOL *  pbHandled 
)

HTMLayout Window Proc without call of DefWindowProc.

EXTERN_C BOOL HLAPI HTMLayoutRender ( HWND  hWndHTMLayout,
HBITMAP  hBmp,
RECT  area 
)

Render document to 24bpp or 32bpp bitmap (with alpha).

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
[in] hBmp hBmp, handle of DIB where to render HTML. DIB expected to be 24bpp or 32bpp
[in] area RECT, area on the bitmap to update.
Returns:
BOOL, TRUE if hBmp is 24bpp or 32bpp, FALSE otherwise.
In case of 32bpp destination BMP will have color with premultiplied alpha.

EXTERN_C BOOL HLAPI HTMLayoutSelectionExist ( HWND  hWndHTMLayout  ) 

Query whether user have selected some HTML text.

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.

EXTERN_C VOID HLAPI HTMLayoutSetCallback ( HWND  hWndHTMLayout,
LPHTMLAYOUT_NOTIFY  cb,
LPVOID  cbParam 
)

Set notification callback function .

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
[in] cb HTMLAYOUT_NOTIFY*, callback function .
[in] cbParam LPVOID, parameter that will be passed to callback function as vParam paramter.

EXTERN_C BOOL HLAPI HTMLayoutSetCSS ( HWND  hWndHTMLayout,
LPCBYTE  utf8,
UINT  numBytes,
LPCWSTR  baseUrl,
LPCWSTR  mediaType 
)

Set (reset) style sheet of current document.

Will reset styles for all elements according to given CSS (utf8)

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
[in] utf8 LPCBYTE, start of CSS buffer.
[in] numBytes UINT, number of bytes in utf8.

EXTERN_C BOOL HLAPI HTMLayoutSetHttpHeaders ( HWND  hWndHTMLayout,
LPCSTR  httpHeaders,
UINT  httpHeadersLength 
)

Set additional http headers that will be sent with each http request by this instance of the engine.

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
[in] httpHeaders LPCSTR, headers.
Returns:
BOOL, TRUE if headers were set successfully, FALSE otherwise - e.g. if hWndHTMLayout is not valid htmlayout window.
Example of header, you may wish to provide:
   Accept-Language: en

Multiple headers must be separated by CRLF pairs.

EXTERN_C BOOL HLAPI HTMLayoutSetMasterCSS ( LPCBYTE  utf8,
UINT  numBytes 
)

Set Master style sheet.

See: http://www.terrainformatica.com/htmlayout/master_ss.css.txt Or resource section of the library for "master-css" HTML resource.

Parameters:
[in] utf8 LPCBYTE, start of CSS buffer.
[in] numBytes UINT, number of bytes in utf8.

EXTERN_C BOOL HLAPI HTMLayoutSetMediaType ( HWND  hWndHTMLayout,
LPCWSTR  mediaType 
)

Set media type of this htmlayout instance.

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
[in] mediaType LPCWSTR, media type name.
For example media type can be "handheld", "projection", "screen", "screen-hires", etc. By default htmlayout window has "screen" media type.

Media type name is used while loading and parsing style sheets in the engine so you should call this function *before* loading document in it.

EXTERN_C VOID HLAPI HTMLayoutSetMode ( HWND  hWndHTMLayout,
int  HTMLayoutMode 
)

Sets the HTMLayout operational mode .

Parameters:
[in] hWndHTMLayout HWND, HTMLayout window handle.
[in] HTMLayoutMode int, desired operational mode .


Generated on Fri May 18 22:05:11 2007 for HTMLayout by  doxygen 1.5.1-p1