Commit f63da13c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLWindow2::onhelp property implementation.

parent 4ff0a824
......@@ -673,17 +673,15 @@ static HRESULT HTMLAnchorElement_handle_event(HTMLDOMNode *iface, eventid_t eid,
}
}
return S_OK;
return HTMLElement_handle_event(&This->element.node, eid, event, prevent_default);
}
static const NodeImplVtbl HTMLAnchorElementImplVtbl = {
HTMLAnchorElement_QI,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_get_attr_col,
NULL,
NULL,
HTMLAnchorElement_handle_event
HTMLAnchorElement_handle_event,
HTMLElement_get_attr_col
};
static const tid_t HTMLAnchorElement_iface_tids[] = {
......
......@@ -769,6 +769,7 @@ static const NodeImplVtbl HTMLBodyElementImplVtbl = {
HTMLBodyElement_QI,
HTMLBodyElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
HTMLBodyElement_get_event_target
};
......
......@@ -173,6 +173,7 @@ static const NodeImplVtbl HTMLCommentElementImplVtbl = {
HTMLCommentElement_QI,
HTMLCommentElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
......
......@@ -1604,10 +1604,41 @@ HRESULT HTMLElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **
return S_OK;
}
HRESULT HTMLElement_handle_event(HTMLDOMNode *iface, DWORD eid, nsIDOMEvent *event, BOOL *prevent_default)
{
HTMLElement *This = impl_from_HTMLDOMNode(iface);
switch(eid) {
case EVENTID_KEYDOWN: {
nsIDOMKeyEvent *key_event;
nsresult nsres;
nsres = nsIDOMEvent_QueryInterface(event, &IID_nsIDOMKeyEvent, (void**)&key_event);
if(NS_SUCCEEDED(nsres)) {
PRUint32 code = 0;
nsIDOMKeyEvent_GetKeyCode(key_event, &code);
switch(code) {
case VK_F1: /* DOM_VK_F1 */
TRACE("F1 pressed\n");
fire_event(This->node.doc, EVENTID_HELP, TRUE, This->node.nsnode, NULL);
*prevent_default = TRUE;
}
nsIDOMKeyEvent_Release(key_event);
}
}
}
return S_OK;
}
static const NodeImplVtbl HTMLElementImplVtbl = {
HTMLElement_QI,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
......
......@@ -255,6 +255,7 @@ static const NodeImplVtbl HTMLEmbedElementImplVtbl = {
HTMLEmbedElement_QI,
HTMLEmbedElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
......
......@@ -74,6 +74,9 @@ static const WCHAR onerrorW[] = {'o','n','e','r','r','o','r',0};
static const WCHAR focusW[] = {'f','o','c','u','s',0};
static const WCHAR onfocusW[] = {'o','n','f','o','c','u','s',0};
static const WCHAR helpW[] = {'h','e','l','p',0};
static const WCHAR onhelpW[] = {'o','n','h','e','l','p',0};
static const WCHAR keydownW[] = {'k','e','y','d','o','w','n',0};
static const WCHAR onkeydownW[] = {'o','n','k','e','y','d','o','w','n',0};
......@@ -170,8 +173,10 @@ static const event_info_t event_info[] = {
EVENT_NODEHANDLER},
{focusW, onfocusW, EVENTT_HTML, DISPID_EVMETH_ONFOCUS,
EVENT_DEFAULTLISTENER},
{helpW, onhelpW, EVENTT_KEY, DISPID_EVMETH_ONHELP,
EVENT_BUBBLE|EVENT_CANCELABLE},
{keydownW, onkeydownW, EVENTT_KEY, DISPID_EVMETH_ONKEYDOWN,
EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
EVENT_DEFAULTLISTENER|EVENT_BUBBLE|EVENT_HASDEFAULTHANDLERS},
{keypressW, onkeypressW, EVENTT_KEY, DISPID_EVMETH_ONKEYPRESS,
EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{keyupW, onkeyupW, EVENTT_KEY, DISPID_EVMETH_ONKEYUP,
......
......@@ -27,6 +27,7 @@ typedef enum {
EVENTID_DRAGSTART,
EVENTID_ERROR,
EVENTID_FOCUS,
EVENTID_HELP,
EVENTID_KEYDOWN,
EVENTID_KEYPRESS,
EVENTID_KEYUP,
......
......@@ -632,6 +632,7 @@ static const NodeImplVtbl HTMLFormElementImplVtbl = {
HTMLFormElement_QI,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
NULL,
NULL,
......@@ -639,7 +640,6 @@ static const NodeImplVtbl HTMLFormElementImplVtbl = {
NULL,
NULL,
NULL,
NULL,
HTMLFormElement_get_dispid,
HTMLFormElement_invoke
};
......
......@@ -270,12 +270,12 @@ static const NodeImplVtbl HTMLFrameElementImplVtbl = {
HTMLFrameElement_QI,
HTMLFrameElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
NULL,
NULL,
NULL,
NULL,
NULL,
HTMLFrameElement_get_document,
HTMLFrameElement_get_readystate,
HTMLFrameElement_get_dispid,
......
......@@ -155,6 +155,7 @@ static const NodeImplVtbl HTMLGenericElementImplVtbl = {
HTMLGenericElement_QI,
HTMLGenericElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
......
......@@ -156,6 +156,7 @@ static const NodeImplVtbl HTMLTitleElementImplVtbl = {
HTMLTitleElement_QI,
HTMLTitleElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
......@@ -314,6 +315,7 @@ static const NodeImplVtbl HTMLHeadElementImplVtbl = {
HTMLHeadElement_QI,
HTMLHeadElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
......
......@@ -482,12 +482,12 @@ static const NodeImplVtbl HTMLIFrameImplVtbl = {
HTMLIFrame_QI,
HTMLIFrame_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
NULL,
NULL,
NULL,
NULL,
NULL,
HTMLIFrame_get_document,
HTMLIFrame_get_readystate,
HTMLIFrame_get_dispid,
......
......@@ -633,13 +633,13 @@ static const NodeImplVtbl HTMLImgElementImplVtbl = {
HTMLImgElement_QI,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
HTMLImgElement_get_readystate
};
......
......@@ -1177,10 +1177,10 @@ static const NodeImplVtbl HTMLInputElementImplVtbl = {
HTMLInputElement_QI,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
NULL,
HTMLInputElementImpl_fire_event,
NULL,
HTMLInputElementImpl_put_disabled,
HTMLInputElementImpl_get_disabled,
};
......
......@@ -254,6 +254,7 @@ static const NodeImplVtbl HTMLMetaElementImplVtbl = {
HTMLMetaElement_QI,
HTMLMetaElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
......
......@@ -697,13 +697,13 @@ static const NodeImplVtbl HTMLObjectElementImplVtbl = {
HTMLObjectElement_QI,
HTMLObjectElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
HTMLObjectElement_get_readystate,
HTMLObjectElement_get_dispid,
HTMLObjectElement_invoke
......
......@@ -315,6 +315,7 @@ static const NodeImplVtbl HTMLOptionElementImplVtbl = {
HTMLOptionElement_QI,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
......
......@@ -317,13 +317,13 @@ static const NodeImplVtbl HTMLScriptElementImplVtbl = {
HTMLScriptElement_QI,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
HTMLScriptElement_get_readystate
};
......
......@@ -600,10 +600,10 @@ static const NodeImplVtbl HTMLSelectElementImplVtbl = {
HTMLSelectElement_QI,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
NULL,
NULL,
NULL,
HTMLSelectElementImpl_put_disabled,
HTMLSelectElementImpl_get_disabled,
NULL,
......
......@@ -287,6 +287,7 @@ static const NodeImplVtbl HTMLStyleElementImplVtbl = {
HTMLStyleElement_QI,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
......
......@@ -746,6 +746,7 @@ static const NodeImplVtbl HTMLTableImplVtbl = {
HTMLTable_QI,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
......
......@@ -341,6 +341,7 @@ static const NodeImplVtbl HTMLTableCellImplVtbl = {
HTMLTableCell_QI,
HTMLTableCell_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
......
......@@ -292,6 +292,7 @@ static const NodeImplVtbl HTMLTableRowImplVtbl = {
HTMLTableRow_QI,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};
......
......@@ -415,10 +415,10 @@ static const NodeImplVtbl HTMLTextAreaElementImplVtbl = {
HTMLTextAreaElement_QI,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
NULL,
NULL,
NULL,
HTMLTextAreaElementImpl_put_disabled,
HTMLTextAreaElementImpl_get_disabled
};
......
......@@ -1021,15 +1021,19 @@ static HRESULT WINAPI HTMLWindow2_get_onunload(IHTMLWindow2 *iface, VARIANT *p)
static HRESULT WINAPI HTMLWindow2_put_onhelp(IHTMLWindow2 *iface, VARIANT v)
{
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
return set_window_event(This, EVENTID_HELP, &v);
}
static HRESULT WINAPI HTMLWindow2_get_onhelp(IHTMLWindow2 *iface, VARIANT *p)
{
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_window_event(This, EVENTID_HELP, p);
}
static HRESULT WINAPI HTMLWindow2_put_onerror(IHTMLWindow2 *iface, VARIANT v)
......
......@@ -592,10 +592,10 @@ typedef struct {
HRESULT (*qi)(HTMLDOMNode*,REFIID,void**);
void (*destructor)(HTMLDOMNode*);
HRESULT (*clone)(HTMLDOMNode*,nsIDOMNode*,HTMLDOMNode**);
HRESULT (*handle_event)(HTMLDOMNode*,DWORD,nsIDOMEvent*,BOOL*);
HRESULT (*get_attr_col)(HTMLDOMNode*,HTMLAttributeCollection**);
event_target_t **(*get_event_target)(HTMLDOMNode*);
HRESULT (*fire_event)(HTMLDOMNode*,DWORD,BOOL*);
HRESULT (*handle_event)(HTMLDOMNode*,DWORD,nsIDOMEvent*,BOOL*);
HRESULT (*put_disabled)(HTMLDOMNode*,VARIANT_BOOL);
HRESULT (*get_disabled)(HTMLDOMNode*,VARIANT_BOOL*);
HRESULT (*get_document)(HTMLDOMNode*,IDispatch**);
......@@ -892,6 +892,7 @@ HRESULT HTMLElement_QI(HTMLDOMNode*,REFIID,void**) DECLSPEC_HIDDEN;
void HTMLElement_destructor(HTMLDOMNode*) DECLSPEC_HIDDEN;
HRESULT HTMLElement_clone(HTMLDOMNode*,nsIDOMNode*,HTMLDOMNode**) DECLSPEC_HIDDEN;
HRESULT HTMLElement_get_attr_col(HTMLDOMNode*,HTMLAttributeCollection**) DECLSPEC_HIDDEN;
HRESULT HTMLElement_handle_event(HTMLDOMNode*,DWORD,nsIDOMEvent*,BOOL*) DECLSPEC_HIDDEN;
HRESULT HTMLFrameBase_QI(HTMLFrameBase*,REFIID,void**) DECLSPEC_HIDDEN;
void HTMLFrameBase_destructor(HTMLFrameBase*) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment