2008-10-09 20:36:01 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2008 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef enum {
|
2012-10-17 10:18:30 +00:00
|
|
|
EVENTID_ABORT,
|
2009-09-08 20:30:14 +00:00
|
|
|
EVENTID_BEFOREUNLOAD,
|
2008-10-10 20:49:09 +00:00
|
|
|
EVENTID_BLUR,
|
2008-10-09 20:36:01 +00:00
|
|
|
EVENTID_CHANGE,
|
|
|
|
EVENTID_CLICK,
|
2010-05-07 13:20:33 +00:00
|
|
|
EVENTID_CONTEXTMENU,
|
2012-09-13 10:27:43 +00:00
|
|
|
EVENTID_DATAAVAILABLE,
|
2009-09-08 20:32:47 +00:00
|
|
|
EVENTID_DBLCLICK,
|
2008-10-10 20:49:09 +00:00
|
|
|
EVENTID_DRAG,
|
2008-10-10 20:49:25 +00:00
|
|
|
EVENTID_DRAGSTART,
|
2012-04-04 13:08:38 +00:00
|
|
|
EVENTID_ERROR,
|
2008-10-10 20:49:09 +00:00
|
|
|
EVENTID_FOCUS,
|
2012-09-04 11:58:58 +00:00
|
|
|
EVENTID_HELP,
|
2008-10-10 20:49:16 +00:00
|
|
|
EVENTID_KEYDOWN,
|
2012-04-10 10:53:12 +00:00
|
|
|
EVENTID_KEYPRESS,
|
2008-10-09 20:36:01 +00:00
|
|
|
EVENTID_KEYUP,
|
|
|
|
EVENTID_LOAD,
|
2008-10-10 20:49:16 +00:00
|
|
|
EVENTID_MOUSEDOWN,
|
2011-02-21 09:23:48 +00:00
|
|
|
EVENTID_MOUSEMOVE,
|
2008-10-10 20:49:33 +00:00
|
|
|
EVENTID_MOUSEOUT,
|
2008-10-10 20:46:08 +00:00
|
|
|
EVENTID_MOUSEOVER,
|
2008-10-10 20:49:16 +00:00
|
|
|
EVENTID_MOUSEUP,
|
2008-10-10 20:49:09 +00:00
|
|
|
EVENTID_PASTE,
|
2009-09-13 22:35:40 +00:00
|
|
|
EVENTID_READYSTATECHANGE,
|
2009-12-07 22:28:10 +00:00
|
|
|
EVENTID_RESIZE,
|
2012-09-10 12:41:28 +00:00
|
|
|
EVENTID_SCROLL,
|
2008-10-10 20:49:25 +00:00
|
|
|
EVENTID_SELECTSTART,
|
2011-02-28 12:13:49 +00:00
|
|
|
EVENTID_SUBMIT,
|
2008-10-09 20:36:01 +00:00
|
|
|
EVENTID_LAST
|
|
|
|
} eventid_t;
|
|
|
|
|
2011-05-01 18:27:06 +00:00
|
|
|
eventid_t str_to_eid(LPCWSTR) DECLSPEC_HIDDEN;
|
|
|
|
void check_event_attr(HTMLDocumentNode*,nsIDOMElement*) DECLSPEC_HIDDEN;
|
|
|
|
void release_event_target(event_target_t*) DECLSPEC_HIDDEN;
|
2012-10-22 09:59:45 +00:00
|
|
|
void fire_event(HTMLDocumentNode*,eventid_t,BOOL,nsIDOMNode*,nsIDOMEvent*,IDispatch*) DECLSPEC_HIDDEN;
|
2011-05-01 18:27:06 +00:00
|
|
|
HRESULT set_event_handler(event_target_t**,nsIDOMNode*,HTMLDocumentNode*,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT get_event_handler(event_target_t**,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT attach_event(event_target_t**,nsIDOMNode*,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT detach_event(event_target_t*,HTMLDocument*,BSTR,IDispatch*) DECLSPEC_HIDDEN;
|
|
|
|
HRESULT dispatch_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*) DECLSPEC_HIDDEN;
|
2011-08-02 09:07:12 +00:00
|
|
|
HRESULT call_fire_event(HTMLDOMNode*,eventid_t) DECLSPEC_HIDDEN;
|
2012-06-25 12:05:17 +00:00
|
|
|
void update_cp_events(HTMLInnerWindow*,event_target_t**,cp_static_data_t*,nsIDOMNode*) DECLSPEC_HIDDEN;
|
2011-08-02 09:08:32 +00:00
|
|
|
HRESULT doc_init_events(HTMLDocumentNode*) DECLSPEC_HIDDEN;
|
2011-11-24 11:48:31 +00:00
|
|
|
void detach_events(HTMLDocumentNode *doc) DECLSPEC_HIDDEN;
|
2012-09-13 10:27:56 +00:00
|
|
|
HRESULT create_event_obj(IHTMLEventObj**) DECLSPEC_HIDDEN;
|
2013-10-01 13:43:52 +00:00
|
|
|
void bind_node_event(HTMLDocumentNode*,event_target_t**,HTMLDOMNode*,const WCHAR*,IDispatch*) DECLSPEC_HIDDEN;
|
2008-10-10 20:46:20 +00:00
|
|
|
|
2011-08-02 09:08:12 +00:00
|
|
|
void init_nsevents(HTMLDocumentNode*) DECLSPEC_HIDDEN;
|
|
|
|
void release_nsevents(HTMLDocumentNode*) DECLSPEC_HIDDEN;
|
|
|
|
void add_nsevent_listener(HTMLDocumentNode*,nsIDOMNode*,LPCWSTR) DECLSPEC_HIDDEN;
|
2011-11-24 11:48:31 +00:00
|
|
|
void detach_nsevent(HTMLDocumentNode*,const WCHAR*) DECLSPEC_HIDDEN;
|
2011-08-02 09:08:12 +00:00
|
|
|
|
2009-09-08 20:29:39 +00:00
|
|
|
static inline event_target_t **get_node_event_target(HTMLDOMNode *node)
|
|
|
|
{
|
|
|
|
return node->vtbl->get_event_target ? node->vtbl->get_event_target(node) : &node->event_target;
|
|
|
|
}
|
|
|
|
|
2008-10-10 20:46:20 +00:00
|
|
|
static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
|
|
|
|
{
|
2010-03-18 00:05:38 +00:00
|
|
|
return set_event_handler(get_node_event_target(node), node->nsnode, node->doc, eid, var);
|
2008-10-10 20:46:20 +00:00
|
|
|
}
|
|
|
|
|
2008-10-10 20:46:32 +00:00
|
|
|
static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
|
|
|
|
{
|
2009-09-08 20:29:39 +00:00
|
|
|
return get_event_handler(get_node_event_target(node), eid, var);
|
2008-10-10 20:46:32 +00:00
|
|
|
}
|
|
|
|
|
2008-10-10 20:46:20 +00:00
|
|
|
static inline HRESULT set_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *var)
|
|
|
|
{
|
2009-09-16 20:14:55 +00:00
|
|
|
return set_node_event(&doc->doc_node->node, eid, var);
|
2008-10-10 20:46:20 +00:00
|
|
|
}
|
2008-10-10 20:46:32 +00:00
|
|
|
|
|
|
|
static inline HRESULT get_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *var)
|
|
|
|
{
|
2009-09-16 20:14:55 +00:00
|
|
|
return get_node_event(&doc->doc_node->node, eid, var);
|
2008-10-10 20:46:32 +00:00
|
|
|
}
|