#include "wine/unicode.h"
#include "mshtml_private.h"
+#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static HRESULT WINAPI HTMLElement2_put_ondrag(IHTMLElement2 *iface, VARIANT v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+
+ return set_node_event(&This->node, EVENTID_DRAG, &v);
}
static HRESULT WINAPI HTMLElement2_get_ondrag(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return get_node_event(&This->node, EVENTID_DRAG, p);
}
static HRESULT WINAPI HTMLElement2_put_ondragend(IHTMLElement2 *iface, VARIANT v)
static HRESULT WINAPI HTMLElement2_put_onpaste(IHTMLElement2 *iface, VARIANT v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+
+ return set_node_event(&This->node, EVENTID_PASTE, &v);
}
static HRESULT WINAPI HTMLElement2_get_onpaste(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return get_node_event(&This->node, EVENTID_PASTE, p);
}
static HRESULT WINAPI HTMLElement2_get_currentStyle(IHTMLElement2 *iface, IHTMLCurrentStyle **p)
static HRESULT WINAPI HTMLElement2_put_onblur(IHTMLElement2 *iface, VARIANT v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+
+ return set_node_event(&This->node, EVENTID_BLUR, &v);
}
static HRESULT WINAPI HTMLElement2_get_onblur(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return get_node_event(&This->node, EVENTID_BLUR, p);
}
static HRESULT WINAPI HTMLElement2_put_onfocus(IHTMLElement2 *iface, VARIANT v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+
+ return set_node_event(&This->node, EVENTID_FOCUS, &v);
}
static HRESULT WINAPI HTMLElement2_get_onfocus(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return get_node_event(&This->node, EVENTID_FOCUS, p);
}
static HRESULT WINAPI HTMLElement2_put_onresize(IHTMLElement2 *iface, VARIANT v)
IDispatch *event_table[EVENTID_LAST];
};
+static const WCHAR blurW[] = {'b','l','u','r',0};
+static const WCHAR onblurW[] = {'o','n','b','l','u','r',0};
+
static const WCHAR changeW[] = {'c','h','a','n','g','e',0};
static const WCHAR onchangeW[] = {'o','n','c','h','a','n','g','e',0};
static const WCHAR clickW[] = {'c','l','i','c','k',0};
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 focusW[] = {'f','o','c','u','s',0};
+static const WCHAR onfocusW[] = {'o','n','f','o','c','u','s',0};
+
static const WCHAR keyupW[] = {'k','e','y','u','p',0};
static const WCHAR onkeyupW[] = {'o','n','k','e','y','u','p',0};
static const WCHAR mouseoverW[] = {'m','o','u','s','e','o','v','e','r',0};
static const WCHAR onmouseoverW[] = {'o','n','m','o','u','s','e','o','v','e','r',0};
+static const WCHAR pasteW[] = {'p','a','s','t','e',0};
+static const WCHAR onpasteW[] = {'o','n','p','a','s','t','e',0};
+
typedef struct {
LPCWSTR name;
LPCWSTR attr_name;
#define EVENT_BUBBLE 0x0002
static const event_info_t event_info[] = {
+ {blurW, onblurW, EVENT_DEFAULTLISTENER},
{changeW, onchangeW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{clickW, onclickW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
+ {dragW, ondragW, 0},
+ {focusW, onfocusW, EVENT_DEFAULTLISTENER},
{keyupW, onkeyupW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{loadW, onloadW, 0},
- {mouseoverW, onmouseoverW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE}
+ {mouseoverW, onmouseoverW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
+ {pasteW, onpasteW, 0}
};
eventid_t str_to_eid(LPCWSTR str)