mshtml: Added document keydown, keyup, dragstart and selectstart event implementation.

This commit is contained in:
Jacek Caban 2008-10-10 15:49:25 -05:00 committed by Alexandre Julliard
parent 36fa704444
commit b21e90ee8a
3 changed files with 43 additions and 17 deletions

View File

@ -1011,29 +1011,37 @@ static HRESULT WINAPI HTMLDocument_get_ondblclick(IHTMLDocument2 *iface, VARIANT
static HRESULT WINAPI HTMLDocument_put_onkeyup(IHTMLDocument2 *iface, VARIANT v)
{
HTMLDocument *This = HTMLDOC_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
return set_doc_event(This, EVENTID_KEYUP, &v);
}
static HRESULT WINAPI HTMLDocument_get_onkeyup(IHTMLDocument2 *iface, VARIANT *p)
{
HTMLDocument *This = HTMLDOC_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_doc_event(This, EVENTID_KEYUP, p);
}
static HRESULT WINAPI HTMLDocument_put_onkeydown(IHTMLDocument2 *iface, VARIANT v)
{
HTMLDocument *This = HTMLDOC_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
return set_doc_event(This, EVENTID_KEYDOWN, &v);
}
static HRESULT WINAPI HTMLDocument_get_onkeydown(IHTMLDocument2 *iface, VARIANT *p)
{
HTMLDocument *This = HTMLDOC_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_doc_event(This, EVENTID_KEYDOWN, p);
}
static HRESULT WINAPI HTMLDocument_put_onkeypress(IHTMLDocument2 *iface, VARIANT v)
@ -1183,29 +1191,37 @@ static HRESULT WINAPI HTMLDocument_get_onrowenter(IHTMLDocument2 *iface, VARIANT
static HRESULT WINAPI HTMLDocument_put_ondragstart(IHTMLDocument2 *iface, VARIANT v)
{
HTMLDocument *This = HTMLDOC_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
return set_doc_event(This, EVENTID_DRAGSTART, &v);
}
static HRESULT WINAPI HTMLDocument_get_ondragstart(IHTMLDocument2 *iface, VARIANT *p)
{
HTMLDocument *This = HTMLDOC_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_doc_event(This, EVENTID_DRAGSTART, p);
}
static HRESULT WINAPI HTMLDocument_put_onselectstart(IHTMLDocument2 *iface, VARIANT v)
{
HTMLDocument *This = HTMLDOC_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
return set_doc_event(This, EVENTID_SELECTSTART, &v);
}
static HRESULT WINAPI HTMLDocument_get_onselectstart(IHTMLDocument2 *iface, VARIANT *p)
{
HTMLDocument *This = HTMLDOC_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_doc_event(This, EVENTID_SELECTSTART, p);
}
static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, long x, long y,

View File

@ -48,6 +48,9 @@ static const WCHAR onclickW[] = {'o','n','c','l','i','c','k',0};
static const WCHAR dragW[] = {'d','r','a','g',0};
static const WCHAR ondragW[] = {'o','n','d','r','a','g',0};
static const WCHAR dragstartW[] = {'d','r','a','g','s','t','a','r','t',0};
static const WCHAR ondragstartW[] = {'o','n','d','r','a','g','s','t','a','r','t',0};
static const WCHAR focusW[] = {'f','o','c','u','s',0};
static const WCHAR onfocusW[] = {'o','n','f','o','c','u','s',0};
@ -72,6 +75,9 @@ static const WCHAR onmouseupW[] = {'o','n','m','o','u','s','e','u','p',0};
static const WCHAR pasteW[] = {'p','a','s','t','e',0};
static const WCHAR onpasteW[] = {'o','n','p','a','s','t','e',0};
static const WCHAR selectstartW[] = {'s','e','l','e','c','t','s','t','a','r','t',0};
static const WCHAR onselectstartW[] = {'o','n','s','e','l','e','c','t','s','t','a','r','t',0};
typedef struct {
LPCWSTR name;
LPCWSTR attr_name;
@ -86,6 +92,7 @@ static const event_info_t event_info[] = {
{changeW, onchangeW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{clickW, onclickW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{dragW, ondragW, 0},
{dragstartW, ondragstartW, 0},
{focusW, onfocusW, EVENT_DEFAULTLISTENER},
{keydownW, onkeydownW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{keyupW, onkeyupW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
@ -93,7 +100,8 @@ static const event_info_t event_info[] = {
{mousedownW, onmousedownW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{mouseoverW, onmouseoverW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{mouseupW, onmouseupW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{pasteW, onpasteW, 0}
{pasteW, onpasteW, 0},
{selectstartW, onselectstartW, 0}
};
eventid_t str_to_eid(LPCWSTR str)

View File

@ -21,6 +21,7 @@ typedef enum {
EVENTID_CHANGE,
EVENTID_CLICK,
EVENTID_DRAG,
EVENTID_DRAGSTART,
EVENTID_FOCUS,
EVENTID_KEYDOWN,
EVENTID_KEYUP,
@ -29,6 +30,7 @@ typedef enum {
EVENTID_MOUSEOVER,
EVENTID_MOUSEUP,
EVENTID_PASTE,
EVENTID_SELECTSTART,
EVENTID_LAST
} eventid_t;