|
HTMEngine
HTMEngine Component
v. 2.0
API specification. Notification messages.
1. Generic notification messages
1.1. NM_CLICK
Notifies a control's parent window that the user has clicked the left mouse button within the control. NM_CLICK is sent in the form of a WM_NOTIFY message.
|
NM_CLICK
lpnm = (LPHEN_MOUSE) lParam; |
Parameters
lpnm
Address of an HEN_MOUSE structure that contains additional information about this notification message.
|
{
NMHDR hdr;
DWORD hitCode; // one of HEHitCodes
DWORD hitId; // internal dom element id
POINT pt; // cursor position
LPARAM lParam; // lParam of original message
WPARAM wParam; // wParam of original message
LPCWSTR hyperlinkUri; // uri of hyperlink or zero, zero terminated wide string
LPCWSTR hyperlinkName; // name of hyperlink or zero, zero terminated string
RECT hyperlinkPlace; // outline of hyperlink
DWORD reserved1;
DWORD reserved2;
} NMHE_MOUSE, FAR *LPNMHE_MOUSE;
// hitCode values.
enum HEHitCodes
{
HEHC_NONE = 0,
HEHC_TEXT = 1,
HEHC_HYPERLINK = 2,
HEHC_SELECTION = 3,
HEHC_TEXT_DRAG = 0x10
};
|
Return Values
The return value is ignored by the control.
Notifies a control's parent window that the user has double-clicked the left mouse button within the control. NM_DBLCLK is sent in the form of a WM_NOTIFY message.
|
NM_DBLCLK
lpnm = (LPHEN_MOUSE) lParam; |
Parameters
lpnm
Address of an HEN_MOUSE structure that contains additional information about this notification message.
Return Values
The return value is ignored by the control.
Notifies a control's parent window that the control has received the input focus. NM_SETFOCUS is sent in the form of a WM_NOTIFY message.
|
NM_SETFOCUS
lpnm = (LPNMHDR) lParam; |
Parameters
lpnm
Address of an NMHDR structure that contains additional information about this notification message.
Return Values
The return value is ignored by the control.
Notifies a control's parent window that the control has lost the input focus. NM_KILLFOCUS is sent in the form of a WM_NOTIFY message.
|
NM_KILLFOCUS
lpnm = (LPNMHDR) lParam; |
Parameters
lpnm
Address of an NMHDR structure that contains additional information about this notification message.
Return Values
The return value is ignored by the control.
Sent by a control when the control receives a WM_NCHITTEST message. This notification is sent in the form of a WM_NOTIFY message.
|
NM_NCHITTEST
lpnm = (LPHEN_MOUSE) lParam; |
Parameters
lpnm
Address of an HEN_MOUSE structure that contains additional information about this notification message.
Return Values
The return value is ignored by the control.
Notifies a control's parent window that the control is setting the cursor in response to a WM_SETCURSOR message. This notification is sent in the form of a WM_NOTIFY message.
|
NM_SETCURSOR
lpnm = (LPHEN_MOUSE) lParam; |
Parameters
lpnm
Address of an HEN_MOUSE structure that contains additional information about this notification message.
Return Values
Returns nonzero to allow the control to set the cursor or zero to prevent the control from setting the cursor, unless otherwise specified.
Sent by a control when the control has the keyboard focus and the user presses a key. This notification is sent in the form of a WM_NOTIFY message.
|
NM_KEYDOWN
lpnmk = (LPNMKEY) lParam; |
Parameters
lpnmk
Address of an NMKEY structure that contains additional information about the key that caused the notification message.
Return Values
Return nonzero to prevent the control from processing the key, or zero otherwise.
The NM_CHAR notification message is sent by a control when a character key is processed. This notification is sent in the form of a WM_NOTIFY message.
|
NM_CHAR
lpnmk = (LPNMKEY) lParam; |
Parameters
lpnmk
Address of an NMKEY structure that contains additional information about the key that caused the notification message.
Return Values
Return nonzero to prevent the control from processing the key, or zero otherwise.
Notifies a control's parent window that the control is releasing mouse capture. This notification is sent in the form of a WM_NOTIFY message.
|
NM_RELEASEDCAPTURE
lpnmh = (LPNMHDR) lParam; |
Parameters
lpnmh
Address of an NMHDR structure that contains additional information about this notification message.
Return Values
The control ignores the return value from this notification.
2. HTMEngine specific notification messages
2.1. HEN_CREATE_CONTROL
Notifies HtmLayout control's parent window that 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.
This notification message is sent in the form of a WM_NOTIFY message.
|
HLN_CREATE_CONTROL
phlcc = (LPNMHL_CREATE_CONTROL) lParam; |
Return Values
No return value.
Parameters
phlcc
Address of a NMHL_CREATE_CONTROL structure:
struct NMHL_CREATE_CONTROL
{
| NMHDR |
hdr; |
|
| // some frequently used attributes: |
| LPCWSTR |
type; |
//zero terminated string, type attribute value, e.g. "text","textarea","checkbox" |
| LPCWSTR |
name; |
//zero terminated string, name attribute value |
| LPCWSTR |
id; |
//zero terminated string, id attribute value |
| int |
tagType; |
// 0-input, 1-textarea, 2-select, 3-widget |
| // full set of attributes: |
| LPCSTR* |
attributeNames; |
// vector of pointers to attribute names (zero terminated char strings) |
| LPCWSTR* |
attributeValues; |
// vector of pointers to attribute values (zero terminated wchar_t strings) |
| int |
attributeCount; |
// size of attribute names and values vectors |
| //<SELECT> and <WIDGET> collection of <OPTION>'s or <PARAM>'s: |
| LPCWSTR* |
optionNames; |
// vector of pointers to param names (wchar_t strings) |
| LPCWSTR* |
optionValues; |
// vector of pointers to param values (wchar_t strings) |
| int |
optionCount; |
// size of option names and values vectors |
| //output parameter |
| HWND |
outControlHwnd; |
// HWND of created control or HWND_TRY_DEFAULT or HWND_DISCARD_CREATION |
}
Notifies HtmLayout control's parent window that control has been created either by HtmLayout or by host application.
This notification message is sent in the form of a WM_NOTIFY message.
|
HEN_CONTROL_CREATED
phlcc = (LPNMHL_CREATE_CONTROL) lParam; |
Return Values
No return value.
Parameters
phlcc
Address of a NMHL_CREATE_CONTROL structure:
NMHL_CREATE_CONTROL.outControlHwnd field contains valid window handler.
Notifies HtmLayout control's parent window that HtmLayout is about to download a referred resource. Currently, only images are classified as such, but in later versions other referred resources will be supported. The application can override this built-in loader and implement loading of resources in its own way (e.g. images may be loaded from database or other resource).
This notification message is sent in the form of a WM_NOTIFY message.
HEN_LOAD_DATA
phlld = (LPNMHL_LOAD_DATA) lParam;
|
Return Values
No return value.
Parameters
phlld
Address of a NMHL_LOAD_DATA structure:
struct NMHL_LOAD_DATA
{
| NMHDR |
hdr; |
|
| //input parameter: |
| LPCWSTR |
uri; |
//zero terminated string, fully qualified uri, e.g. "http://server/folder/file.ext" |
| //output parameters: |
| LPVOID |
outData; |
// out, pointer to loaded data. HtmLayout will not store outData pointer internally |
| DWORD |
outDataSize; |
// out, loaded data size |
}
Notifies HtmLayout control's parent window about "hyperlink events" : mouse enter, leave or click on the hyperlink.
This notification message is sent in the form of a WM_NOTIFY message.
HEN_HYPERLINK
phlh = (LPNMHL_HYPERLINK) lParam;
|
Return Values
No return value.
Parameters
phlld
Address of a NMHL_HYPERLINK structure:
struct NMHL_HYPERLNK
{
| NMHDR |
hdr; |
|
| //input parameters: |
| LPCWSTR |
name; |
//value of name attribute of <A> tag. Zero terminated wchar_t string |
| LPCWSTR |
href; |
//value of href attribute of <A> tag, URI. Zero terminated wchar_t string |
| LPCWSTR |
target; |
//value of target attribute of <A> tag. Zero terminated wchar_t string |
| DWORD |
status; |
//subtype of event, one of HL_HYPERLINK_LEAVE, HL_HYPERLINK_ENTER, HL_HYPERLINK_CLICK values |
}
Notifies HtmLayout control's parent window that HtmLayout finished loading all resources associated with the loaded document. There are four methods which will trigger this notification:
- WM_HE_LOAD_FILE,
- WM_HE_LOAD_HTML,
- WM_HE_INSERT_HTML,
- WM_HE_PASTE
If document or document fragment to be loaded has no external (with URIs start with http: https: ftp:) resources HTMEngine will send this notification "inside" a call of these methods. If document contains at least one external resource HTMEngine will send this notification asynchronously after loading of all such resources.
This notification message is sent in the form of a WM_NOTIFY message.
|
HEN_DOCUMENT_COMPLETE
lpnm = (LPNMHDR) lParam; |
Parameters
lpnm
Address of an NMHDR structure that contains additional information about this notification message.
Return Values
The return value is ignored by the control.
Notifies HtmLayout control's parent window that caret position, selection or status of formatting registers has been changed. This notification message is sent in the form of a WM_NOTIFY message.
|
HEN_UPDATE_UI
lpnm = (LPNMHE_UPDATE_UI) lParam; |
Parameters
lpnm
Address of an NMHE_UPDATE_UI structure that contains additional information about this notification message:
|
struct NMHE_UPDATE_UI
{
NMHDR hdr;
RECT coorAnchor; // coordinates of anchor rectangle
RECT coorCaret; // coordinates of caret rectangle
DWORD reserved1;
DWORD reserved2;
DWORD reserved3;
DWORD reserved4;
DWORD reserved5;
}; |
Return Values
The return value is ignored by the control.
|