mshtml: Stub out HTMLAreaElement.
[wine.git] / dlls / mshtml / mshtml_private.h
blob43fa2a7a0e1e60b9387c9262ab25e34de4bf2be6
1 /*
2 * Copyright 2005-2009 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "wingdi.h"
20 #include "docobj.h"
21 #include "docobjectservice.h"
22 #include "comcat.h"
23 #include "mshtml.h"
24 #include "mshtmhst.h"
25 #include "hlink.h"
26 #include "perhist.h"
27 #include "dispex.h"
28 #include "objsafe.h"
29 #include "htiframe.h"
30 #include "tlogstg.h"
31 #include "shdeprecated.h"
33 #include "wine/list.h"
34 #include "wine/unicode.h"
36 #ifdef INIT_GUID
37 #include "initguid.h"
38 #endif
40 #include "nsiface.h"
42 #define NS_ERROR_GENERATE_FAILURE(module,code) \
43 ((nsresult) (((UINT32)(1<<31)) | ((UINT32)(module+0x45)<<16) | ((UINT32)(code))))
45 #define NS_OK ((nsresult)0x00000000L)
46 #define NS_ERROR_FAILURE ((nsresult)0x80004005L)
47 #define NS_ERROR_OUT_OF_MEMORY ((nsresult)0x8007000EL)
48 #define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L)
49 #define NS_NOINTERFACE ((nsresult)0x80004002L)
50 #define NS_ERROR_INVALID_POINTER ((nsresult)0x80004003L)
51 #define NS_ERROR_NULL_POINTER NS_ERROR_INVALID_POINTER
52 #define NS_ERROR_NOT_AVAILABLE ((nsresult)0x80040111L)
53 #define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L)
54 #define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL)
56 #define NS_ERROR_MODULE_NETWORK 6
58 #define NS_BINDING_ABORTED NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 2)
59 #define NS_ERROR_UNKNOWN_PROTOCOL NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 18)
61 #define NS_FAILED(res) ((res) & 0x80000000)
62 #define NS_SUCCEEDED(res) (!NS_FAILED(res))
64 #define NSAPI WINAPI
66 #define MSHTML_E_NODOC 0x800a025c
68 typedef struct HTMLDOMNode HTMLDOMNode;
69 typedef struct ConnectionPoint ConnectionPoint;
70 typedef struct BSCallback BSCallback;
71 typedef struct event_target_t event_target_t;
73 #define TID_LIST \
74 XIID(NULL) \
75 XDIID(DispCEventObj) \
76 XDIID(DispCPlugins) \
77 XDIID(DispDOMChildrenCollection) \
78 XDIID(DispHTMLAnchorElement) \
79 XDIID(DispHTMLAreaElement) \
80 XDIID(DispHTMLAttributeCollection) \
81 XDIID(DispHTMLBody) \
82 XDIID(DispHTMLButtonElement) \
83 XDIID(DispHTMLCommentElement) \
84 XDIID(DispHTMLCurrentStyle) \
85 XDIID(DispHTMLDocument) \
86 XDIID(DispHTMLDOMAttribute) \
87 XDIID(DispHTMLDOMTextNode) \
88 XDIID(DispHTMLElementCollection) \
89 XDIID(DispHTMLEmbed) \
90 XDIID(DispHTMLFormElement) \
91 XDIID(DispHTMLGenericElement) \
92 XDIID(DispHTMLFrameElement) \
93 XDIID(DispHTMLHeadElement) \
94 XDIID(DispHTMLHistory) \
95 XDIID(DispHTMLIFrame) \
96 XDIID(DispHTMLImg) \
97 XDIID(DispHTMLInputElement) \
98 XDIID(DispHTMLLabelElement) \
99 XDIID(DispHTMLLinkElement) \
100 XDIID(DispHTMLLocation) \
101 XDIID(DispHTMLMetaElement) \
102 XDIID(DispHTMLNavigator) \
103 XDIID(DispHTMLObjectElement) \
104 XDIID(DispHTMLOptionElement) \
105 XDIID(DispHTMLScreen) \
106 XDIID(DispHTMLScriptElement) \
107 XDIID(DispHTMLSelectElement) \
108 XDIID(DispHTMLStyle) \
109 XDIID(DispHTMLStyleElement) \
110 XDIID(DispHTMLStyleSheet) \
111 XDIID(DispHTMLStyleSheetRulesCollection) \
112 XDIID(DispHTMLStyleSheetsCollection) \
113 XDIID(DispHTMLTable) \
114 XDIID(DispHTMLTableCell) \
115 XDIID(DispHTMLTableRow) \
116 XDIID(DispHTMLTextAreaElement) \
117 XDIID(DispHTMLTitleElement) \
118 XDIID(DispHTMLUnknownElement) \
119 XDIID(DispHTMLWindow2) \
120 XDIID(DispHTMLXMLHttpRequest) \
121 XDIID(HTMLDocumentEvents) \
122 XDIID(HTMLElementEvents2) \
123 XIID(IHTMLAnchorElement) \
124 XIID(IHTMLAreaElement) \
125 XIID(IHTMLAttributeCollection) \
126 XIID(IHTMLAttributeCollection2) \
127 XIID(IHTMLAttributeCollection3) \
128 XIID(IHTMLBodyElement) \
129 XIID(IHTMLBodyElement2) \
130 XIID(IHTMLButtonElement) \
131 XIID(IHTMLCommentElement) \
132 XIID(IHTMLCurrentStyle) \
133 XIID(IHTMLCurrentStyle2) \
134 XIID(IHTMLCurrentStyle3) \
135 XIID(IHTMLCurrentStyle4) \
136 XIID(IHTMLDocument2) \
137 XIID(IHTMLDocument3) \
138 XIID(IHTMLDocument4) \
139 XIID(IHTMLDocument5) \
140 XIID(IHTMLDOMAttribute) \
141 XIID(IHTMLDOMAttribute2) \
142 XIID(IHTMLDOMChildrenCollection) \
143 XIID(IHTMLDOMImplementation) \
144 XIID(IHTMLDOMNode) \
145 XIID(IHTMLDOMNode2) \
146 XIID(IHTMLDOMTextNode) \
147 XIID(IHTMLDOMTextNode2) \
148 XIID(IHTMLElement) \
149 XIID(IHTMLElement2) \
150 XIID(IHTMLElement3) \
151 XIID(IHTMLElement4) \
152 XIID(IHTMLElementCollection) \
153 XIID(IHTMLEmbedElement) \
154 XIID(IHTMLEventObj) \
155 XIID(IHTMLFiltersCollection) \
156 XIID(IHTMLFormElement) \
157 XIID(IHTMLFrameBase) \
158 XIID(IHTMLFrameBase2) \
159 XIID(IHTMLFrameElement3) \
160 XIID(IHTMLGenericElement) \
161 XIID(IHTMLHeadElement) \
162 XIID(IHTMLIFrameElement) \
163 XIID(IHTMLIFrameElement2) \
164 XIID(IHTMLIFrameElement3) \
165 XIID(IHTMLImageElementFactory) \
166 XIID(IHTMLImgElement) \
167 XIID(IHTMLInputElement) \
168 XIID(IHTMLLabelElement) \
169 XIID(IHTMLLinkElement) \
170 XIID(IHTMLLocation) \
171 XIID(IHTMLMetaElement) \
172 XIID(IHTMLMimeTypesCollection) \
173 XIID(IHTMLObjectElement) \
174 XIID(IHTMLObjectElement2) \
175 XIID(IHTMLOptionElement) \
176 XIID(IHTMLOptionElementFactory) \
177 XIID(IHTMLPluginsCollection) \
178 XIID(IHTMLRect) \
179 XIID(IHTMLScreen) \
180 XIID(IHTMLScriptElement) \
181 XIID(IHTMLSelectElement) \
182 XIID(IHTMLSelectionObject) \
183 XIID(IHTMLSelectionObject2) \
184 XIID(IHTMLStorage) \
185 XIID(IHTMLStyle) \
186 XIID(IHTMLStyle2) \
187 XIID(IHTMLStyle3) \
188 XIID(IHTMLStyle4) \
189 XIID(IHTMLStyle5) \
190 XIID(IHTMLStyle6) \
191 XIID(IHTMLStyleElement) \
192 XIID(IHTMLStyleSheet) \
193 XIID(IHTMLStyleSheetRulesCollection) \
194 XIID(IHTMLStyleSheetsCollection) \
195 XIID(IHTMLTable) \
196 XIID(IHTMLTable2) \
197 XIID(IHTMLTable3) \
198 XIID(IHTMLTableCell) \
199 XIID(IHTMLTableRow) \
200 XIID(IHTMLTextAreaElement) \
201 XIID(IHTMLTextContainer) \
202 XIID(IHTMLTitleElement) \
203 XIID(IHTMLTxtRange) \
204 XIID(IHTMLUniqueName) \
205 XIID(IHTMLWindow2) \
206 XIID(IHTMLWindow3) \
207 XIID(IHTMLWindow4) \
208 XIID(IHTMLWindow5) \
209 XIID(IHTMLWindow6) \
210 XIID(IHTMLXMLHttpRequest) \
211 XIID(IHTMLXMLHttpRequestFactory) \
212 XIID(IOmHistory) \
213 XIID(IOmNavigator)
215 typedef enum {
216 #define XIID(iface) iface ## _tid,
217 #define XDIID(iface) iface ## _tid,
218 TID_LIST
219 #undef XIID
220 #undef XDIID
221 LAST_tid
222 } tid_t;
224 typedef struct dispex_data_t dispex_data_t;
225 typedef struct dispex_dynamic_data_t dispex_dynamic_data_t;
227 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
228 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
229 #define MSHTML_CUSTOM_DISPID_CNT (MSHTML_DISPID_CUSTOM_MAX-MSHTML_DISPID_CUSTOM_MIN)
231 typedef struct DispatchEx DispatchEx;
233 typedef struct {
234 HRESULT (*value)(DispatchEx*,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
235 HRESULT (*get_dispid)(DispatchEx*,BSTR,DWORD,DISPID*);
236 HRESULT (*invoke)(DispatchEx*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
237 HRESULT (*populate_props)(DispatchEx*);
238 /* We abuse this vtbl for EventTarget functions to avoid separated vtbl. */
239 event_target_t **(*get_event_target_ptr)(DispatchEx*);
240 void (*bind_event)(DispatchEx*,int);
241 } dispex_static_data_vtbl_t;
243 typedef struct {
244 const dispex_static_data_vtbl_t *vtbl;
245 const tid_t disp_tid;
246 dispex_data_t *data;
247 const tid_t* const iface_tids;
248 } dispex_static_data_t;
250 struct DispatchEx {
251 IDispatchEx IDispatchEx_iface;
253 IUnknown *outer;
255 dispex_static_data_t *data;
256 dispex_dynamic_data_t *dynamic_data;
259 typedef struct {
260 UINT_PTR x;
261 } nsCycleCollectingAutoRefCnt;
263 typedef struct {
264 void *vtbl;
265 int ref_flags;
266 void *callbacks;
267 } ExternalCycleCollectionParticipant;
269 typedef struct nsCycleCollectionTraversalCallback nsCycleCollectionTraversalCallback;
271 typedef struct {
272 nsresult (NSAPI *traverse)(void*,void*,nsCycleCollectionTraversalCallback*);
273 nsresult (NSAPI *unlink)(void*);
274 void (NSAPI *delete_cycle_collectable)(void*);
275 } CCObjCallback;
277 DEFINE_GUID(IID_nsXPCOMCycleCollectionParticipant, 0x9674489b,0x1f6f,0x4550,0xa7,0x30, 0xcc,0xae,0xdd,0x10,0x4c,0xf9);
279 nsrefcnt (__cdecl *ccref_incr)(nsCycleCollectingAutoRefCnt*,nsISupports*) DECLSPEC_HIDDEN;
280 nsrefcnt (__cdecl *ccref_decr)(nsCycleCollectingAutoRefCnt*,nsISupports*,ExternalCycleCollectionParticipant*) DECLSPEC_HIDDEN;
281 void (__cdecl *ccref_init)(nsCycleCollectingAutoRefCnt*,nsrefcnt) DECLSPEC_HIDDEN;
282 void (__cdecl *ccp_init)(ExternalCycleCollectionParticipant*,const CCObjCallback*) DECLSPEC_HIDDEN;
283 void (__cdecl *describe_cc_node)(nsCycleCollectingAutoRefCnt*,const char*,nsCycleCollectionTraversalCallback*) DECLSPEC_HIDDEN;
284 void (__cdecl *note_cc_edge)(nsISupports*,const char*,nsCycleCollectionTraversalCallback*) DECLSPEC_HIDDEN;
286 void init_dispex(DispatchEx*,IUnknown*,dispex_static_data_t*) DECLSPEC_HIDDEN;
287 void release_dispex(DispatchEx*) DECLSPEC_HIDDEN;
288 BOOL dispex_query_interface(DispatchEx*,REFIID,void**) DECLSPEC_HIDDEN;
289 HRESULT dispex_get_dprop_ref(DispatchEx*,const WCHAR*,BOOL,VARIANT**) DECLSPEC_HIDDEN;
290 HRESULT get_dispids(tid_t,DWORD*,DISPID**) DECLSPEC_HIDDEN;
291 HRESULT remove_attribute(DispatchEx*,DISPID,VARIANT_BOOL*) DECLSPEC_HIDDEN;
292 HRESULT dispex_get_dynid(DispatchEx*,const WCHAR*,DISPID*) DECLSPEC_HIDDEN;
293 void dispex_traverse(DispatchEx*,nsCycleCollectionTraversalCallback*) DECLSPEC_HIDDEN;
294 void dispex_unlink(DispatchEx*) DECLSPEC_HIDDEN;
295 void release_typelib(void) DECLSPEC_HIDDEN;
296 HRESULT get_htmldoc_classinfo(ITypeInfo **typeinfo) DECLSPEC_HIDDEN;
298 typedef enum {
299 DISPEXPROP_CUSTOM,
300 DISPEXPROP_DYNAMIC,
301 DISPEXPROP_BUILTIN
302 } dispex_prop_type_t;
304 dispex_prop_type_t get_dispid_type(DISPID) DECLSPEC_HIDDEN;
306 typedef struct HTMLWindow HTMLWindow;
307 typedef struct HTMLInnerWindow HTMLInnerWindow;
308 typedef struct HTMLOuterWindow HTMLOuterWindow;
309 typedef struct HTMLDocumentNode HTMLDocumentNode;
310 typedef struct HTMLDocumentObj HTMLDocumentObj;
311 typedef struct HTMLFrameBase HTMLFrameBase;
312 typedef struct NSContainer NSContainer;
313 typedef struct HTMLAttributeCollection HTMLAttributeCollection;
315 typedef enum {
316 SCRIPTMODE_GECKO,
317 SCRIPTMODE_ACTIVESCRIPT
318 } SCRIPTMODE;
320 typedef struct ScriptHost ScriptHost;
322 typedef enum {
323 GLOBAL_SCRIPTVAR,
324 GLOBAL_ELEMENTVAR,
325 GLOBAL_DISPEXVAR,
326 GLOBAL_FRAMEVAR
327 } global_prop_type_t;
329 typedef struct {
330 global_prop_type_t type;
331 WCHAR *name;
332 ScriptHost *script_host;
333 DISPID id;
334 } global_prop_t;
336 typedef struct {
337 DispatchEx dispex;
338 event_target_t *ptr;
339 } EventTarget;
341 typedef struct {
342 DispatchEx dispex;
343 IHTMLOptionElementFactory IHTMLOptionElementFactory_iface;
345 LONG ref;
347 HTMLInnerWindow *window;
348 } HTMLOptionElementFactory;
350 typedef struct {
351 DispatchEx dispex;
352 IHTMLImageElementFactory IHTMLImageElementFactory_iface;
354 LONG ref;
356 HTMLInnerWindow *window;
357 } HTMLImageElementFactory;
359 typedef struct {
360 DispatchEx dispex;
361 IHTMLXMLHttpRequestFactory IHTMLXMLHttpRequestFactory_iface;
363 LONG ref;
365 HTMLInnerWindow *window;
366 } HTMLXMLHttpRequestFactory;
368 struct HTMLLocation {
369 DispatchEx dispex;
370 IHTMLLocation IHTMLLocation_iface;
372 LONG ref;
374 HTMLInnerWindow *window;
377 typedef struct {
378 DispatchEx dispex;
379 IOmHistory IOmHistory_iface;
381 LONG ref;
383 HTMLInnerWindow *window;
384 } OmHistory;
386 typedef struct {
387 HTMLOuterWindow *window;
388 LONG ref;
389 } windowref_t;
391 typedef struct nsChannelBSC nsChannelBSC;
393 struct HTMLWindow {
394 IHTMLWindow2 IHTMLWindow2_iface;
395 IHTMLWindow3 IHTMLWindow3_iface;
396 IHTMLWindow4 IHTMLWindow4_iface;
397 IHTMLWindow5 IHTMLWindow5_iface;
398 IHTMLWindow6 IHTMLWindow6_iface;
399 IHTMLPrivateWindow IHTMLPrivateWindow_iface;
400 IDispatchEx IDispatchEx_iface;
401 IServiceProvider IServiceProvider_iface;
402 ITravelLogClient ITravelLogClient_iface;
403 IObjectIdentity IObjectIdentity_iface;
405 LONG ref;
407 HTMLInnerWindow *inner_window;
408 HTMLOuterWindow *outer_window;
411 struct HTMLOuterWindow {
412 HTMLWindow base;
414 windowref_t *window_ref;
415 LONG task_magic;
417 HTMLDocumentObj *doc_obj;
418 nsIDOMWindow *nswindow;
419 HTMLOuterWindow *parent;
420 HTMLFrameBase *frame_element;
422 READYSTATE readystate;
423 BOOL readystate_locked;
424 unsigned readystate_pending;
426 HTMLInnerWindow *pending_window;
427 IMoniker *mon;
428 IUri *uri;
429 IUri *uri_nofrag;
430 BSTR url;
431 DWORD load_flags;
433 SCRIPTMODE scriptmode;
435 IInternetSecurityManager *secmgr;
437 struct list children;
438 struct list sibling_entry;
439 struct list entry;
442 struct HTMLInnerWindow {
443 HTMLWindow base;
444 EventTarget event_target;
446 HTMLDocumentNode *doc;
448 struct list script_hosts;
450 IHTMLEventObj *event;
452 HTMLImageElementFactory *image_factory;
453 HTMLOptionElementFactory *option_factory;
454 HTMLXMLHttpRequestFactory *xhr_factory;
455 IHTMLScreen *screen;
456 OmHistory *history;
457 IHTMLStorage *session_storage;
459 unsigned parser_callback_cnt;
460 struct list script_queue;
462 global_prop_t *global_props;
463 DWORD global_prop_cnt;
464 DWORD global_prop_size;
466 LONG task_magic;
468 HTMLLocation *location;
470 IMoniker *mon;
471 nsChannelBSC *bscallback;
472 struct list bindings;
475 typedef enum {
476 UNKNOWN_USERMODE,
477 BROWSEMODE,
478 EDITMODE
479 } USERMODE;
481 typedef struct _cp_static_data_t {
482 tid_t tid;
483 void (*on_advise)(IUnknown*,struct _cp_static_data_t*);
484 BOOL pass_event_arg;
485 DWORD id_cnt;
486 DISPID *ids;
487 } cp_static_data_t;
489 typedef struct {
490 const IID *riid;
491 cp_static_data_t *desc;
492 } cpc_entry_t;
494 typedef struct ConnectionPointContainer {
495 IConnectionPointContainer IConnectionPointContainer_iface;
497 ConnectionPoint *cps;
498 const cpc_entry_t *cp_entries;
499 IUnknown *outer;
500 struct ConnectionPointContainer *forward_container;
501 } ConnectionPointContainer;
503 struct ConnectionPoint {
504 IConnectionPoint IConnectionPoint_iface;
506 ConnectionPointContainer *container;
508 union {
509 IUnknown *unk;
510 IDispatch *disp;
511 IPropertyNotifySink *propnotif;
512 } *sinks;
513 DWORD sinks_size;
515 const IID *iid;
516 cp_static_data_t *data;
519 struct HTMLDocument {
520 IHTMLDocument2 IHTMLDocument2_iface;
521 IHTMLDocument3 IHTMLDocument3_iface;
522 IHTMLDocument4 IHTMLDocument4_iface;
523 IHTMLDocument5 IHTMLDocument5_iface;
524 IHTMLDocument6 IHTMLDocument6_iface;
525 IHTMLDocument7 IHTMLDocument7_iface;
526 IPersistMoniker IPersistMoniker_iface;
527 IPersistFile IPersistFile_iface;
528 IPersistHistory IPersistHistory_iface;
529 IMonikerProp IMonikerProp_iface;
530 IOleObject IOleObject_iface;
531 IOleDocument IOleDocument_iface;
532 IOleDocumentView IOleDocumentView_iface;
533 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
534 IViewObjectEx IViewObjectEx_iface;
535 IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface;
536 IServiceProvider IServiceProvider_iface;
537 IOleCommandTarget IOleCommandTarget_iface;
538 IOleControl IOleControl_iface;
539 IHlinkTarget IHlinkTarget_iface;
540 IPersistStreamInit IPersistStreamInit_iface;
541 IDispatchEx IDispatchEx_iface;
542 ISupportErrorInfo ISupportErrorInfo_iface;
543 IObjectWithSite IObjectWithSite_iface;
544 IOleContainer IOleContainer_iface;
545 IObjectSafety IObjectSafety_iface;
546 IProvideClassInfo IProvideClassInfo_iface;
548 IUnknown *unk_impl;
549 IDispatchEx *dispex;
551 HTMLDocumentObj *doc_obj;
552 HTMLDocumentNode *doc_node;
554 HTMLOuterWindow *window;
556 LONG task_magic;
558 ConnectionPointContainer cp_container;
559 IOleAdviseHolder *advise_holder;
562 static inline HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv)
564 return IUnknown_QueryInterface(This->unk_impl, riid, ppv);
567 static inline ULONG htmldoc_addref(HTMLDocument *This)
569 return IUnknown_AddRef(This->unk_impl);
572 static inline ULONG htmldoc_release(HTMLDocument *This)
574 return IUnknown_Release(This->unk_impl);
577 struct HTMLDocumentObj {
578 HTMLDocument basedoc;
579 DispatchEx dispex;
580 ICustomDoc ICustomDoc_iface;
581 ITargetContainer ITargetContainer_iface;
583 IWindowForBindingUI IWindowForBindingUI_iface;
585 LONG ref;
587 NSContainer *nscontainer;
589 IOleClientSite *client;
590 IDocHostUIHandler *hostui;
591 IOleCommandTarget *client_cmdtrg;
592 BOOL custom_hostui;
593 IOleInPlaceSite *ipsite;
594 IOleInPlaceFrame *frame;
595 IOleInPlaceUIWindow *ip_window;
596 IAdviseSink *view_sink;
597 IDocObjectService *doc_object_service;
598 IUnknown *webbrowser;
599 ITravelLog *travel_log;
600 IUnknown *browser_service;
602 DOCHOSTUIINFO hostinfo;
604 IOleUndoManager *undomgr;
606 HWND hwnd;
607 HWND tooltips_hwnd;
609 BOOL request_uiactivate;
610 BOOL in_place_active;
611 BOOL ui_active;
612 BOOL window_active;
613 BOOL hostui_setup;
614 BOOL container_locked;
615 BOOL focus;
616 BOOL has_popup;
617 INT download_state;
619 USERMODE usermode;
620 LPWSTR mime;
622 DWORD update;
625 typedef struct nsWeakReference nsWeakReference;
627 struct NSContainer {
628 nsIWebBrowserChrome nsIWebBrowserChrome_iface;
629 nsIContextMenuListener nsIContextMenuListener_iface;
630 nsIURIContentListener nsIURIContentListener_iface;
631 nsIEmbeddingSiteWindow nsIEmbeddingSiteWindow_iface;
632 nsITooltipListener nsITooltipListener_iface;
633 nsIInterfaceRequestor nsIInterfaceRequestor_iface;
634 nsISupportsWeakReference nsISupportsWeakReference_iface;
636 nsIWebBrowser *webbrowser;
637 nsIWebNavigation *navigation;
638 nsIBaseWindow *window;
639 nsIWebBrowserFocus *focus;
641 nsIEditor *editor;
642 nsIController *editor_controller;
644 LONG ref;
646 nsWeakReference *weak_reference;
648 NSContainer *parent;
649 HTMLDocumentObj *doc;
651 nsIURIContentListener *content_listener;
653 HWND hwnd;
656 typedef struct {
657 HRESULT (*qi)(HTMLDOMNode*,REFIID,void**);
658 void (*destructor)(HTMLDOMNode*);
659 const cpc_entry_t *cpc_entries;
660 HRESULT (*clone)(HTMLDOMNode*,nsIDOMNode*,HTMLDOMNode**);
661 HRESULT (*handle_event)(HTMLDOMNode*,DWORD,nsIDOMEvent*,BOOL*);
662 HRESULT (*get_attr_col)(HTMLDOMNode*,HTMLAttributeCollection**);
663 event_target_t **(*get_event_target_ptr)(HTMLDOMNode*);
664 HRESULT (*fire_event)(HTMLDOMNode*,DWORD,BOOL*);
665 HRESULT (*put_disabled)(HTMLDOMNode*,VARIANT_BOOL);
666 HRESULT (*get_disabled)(HTMLDOMNode*,VARIANT_BOOL*);
667 HRESULT (*get_document)(HTMLDOMNode*,IDispatch**);
668 HRESULT (*get_readystate)(HTMLDOMNode*,BSTR*);
669 HRESULT (*get_dispid)(HTMLDOMNode*,BSTR,DWORD,DISPID*);
670 HRESULT (*invoke)(HTMLDOMNode*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
671 HRESULT (*bind_to_tree)(HTMLDOMNode*);
672 void (*traverse)(HTMLDOMNode*,nsCycleCollectionTraversalCallback*);
673 void (*unlink)(HTMLDOMNode*);
674 BOOL (*is_text_edit)(HTMLDOMNode*);
675 } NodeImplVtbl;
677 struct HTMLDOMNode {
678 EventTarget event_target;
679 IHTMLDOMNode IHTMLDOMNode_iface;
680 IHTMLDOMNode2 IHTMLDOMNode2_iface;
681 const NodeImplVtbl *vtbl;
683 nsCycleCollectingAutoRefCnt ccref;
685 nsIDOMNode *nsnode;
686 HTMLDocumentNode *doc;
687 ConnectionPointContainer *cp_container;
690 static inline void node_addref(HTMLDOMNode *node)
692 IHTMLDOMNode_AddRef(&node->IHTMLDOMNode_iface);
695 static inline void node_release(HTMLDOMNode *node)
697 IHTMLDOMNode_Release(&node->IHTMLDOMNode_iface);
700 typedef struct {
701 HTMLDOMNode node;
702 ConnectionPointContainer cp_container;
704 IHTMLElement IHTMLElement_iface;
705 IHTMLElement2 IHTMLElement2_iface;
706 IHTMLElement3 IHTMLElement3_iface;
707 IHTMLElement4 IHTMLElement4_iface;
709 nsIDOMHTMLElement *nselem;
710 HTMLStyle *style;
711 HTMLStyle *runtime_style;
712 HTMLAttributeCollection *attrs;
713 WCHAR *filter;
714 } HTMLElement;
716 #define HTMLELEMENT_TIDS \
717 IHTMLDOMNode_tid, \
718 IHTMLDOMNode2_tid, \
719 IHTMLElement_tid, \
720 IHTMLElement2_tid, \
721 IHTMLElement3_tid, \
722 IHTMLElement4_tid
724 extern cp_static_data_t HTMLElementEvents2_data DECLSPEC_HIDDEN;
725 #define HTMLELEMENT_CPC {&DIID_HTMLElementEvents2, &HTMLElementEvents2_data}
726 extern const cpc_entry_t HTMLElement_cpc[] DECLSPEC_HIDDEN;
728 typedef struct {
729 HTMLElement element;
731 IHTMLTextContainer IHTMLTextContainer_iface;
732 } HTMLTextContainer;
734 struct HTMLFrameBase {
735 HTMLElement element;
737 IHTMLFrameBase IHTMLFrameBase_iface;
738 IHTMLFrameBase2 IHTMLFrameBase2_iface;
740 HTMLOuterWindow *content_window;
742 nsIDOMHTMLFrameElement *nsframe;
743 nsIDOMHTMLIFrameElement *nsiframe;
746 typedef struct nsDocumentEventListener nsDocumentEventListener;
748 struct HTMLDocumentNode {
749 HTMLDOMNode node;
750 HTMLDocument basedoc;
752 IInternetHostSecurityManager IInternetHostSecurityManager_iface;
754 nsIDocumentObserver nsIDocumentObserver_iface;
756 LONG ref;
758 HTMLInnerWindow *window;
760 nsIDOMHTMLDocument *nsdoc;
761 BOOL content_ready;
762 event_target_t *body_event_target;
764 IHTMLDOMImplementation *dom_implementation;
766 ICatInformation *catmgr;
767 nsDocumentEventListener *nsevent_listener;
768 BOOL *event_vector;
770 WCHAR **elem_vars;
771 unsigned elem_vars_size;
772 unsigned elem_vars_cnt;
774 BOOL skip_mutation_notif;
776 UINT charset;
778 struct list selection_list;
779 struct list range_list;
780 struct list plugin_hosts;
783 HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
784 HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
785 HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocumentObj*,HTMLInnerWindow*,HTMLDocumentNode**) DECLSPEC_HIDDEN;
787 HRESULT HTMLOuterWindow_Create(HTMLDocumentObj*,nsIDOMWindow*,HTMLOuterWindow*,HTMLOuterWindow**) DECLSPEC_HIDDEN;
788 HRESULT update_window_doc(HTMLInnerWindow*) DECLSPEC_HIDDEN;
789 HTMLOuterWindow *nswindow_to_window(const nsIDOMWindow*) DECLSPEC_HIDDEN;
790 void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**) DECLSPEC_HIDDEN;
791 HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow*,HTMLOptionElementFactory**) DECLSPEC_HIDDEN;
792 HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow*,HTMLImageElementFactory**) DECLSPEC_HIDDEN;
793 HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow*,HTMLXMLHttpRequestFactory**) DECLSPEC_HIDDEN;
794 HRESULT HTMLLocation_Create(HTMLInnerWindow*,HTMLLocation**) DECLSPEC_HIDDEN;
795 IOmNavigator *OmNavigator_Create(void) DECLSPEC_HIDDEN;
796 HRESULT HTMLScreen_Create(IHTMLScreen**) DECLSPEC_HIDDEN;
797 HRESULT create_history(HTMLInnerWindow*,OmHistory**) DECLSPEC_HIDDEN;
798 HRESULT create_dom_implementation(IHTMLDOMImplementation**) DECLSPEC_HIDDEN;
800 HRESULT create_storage(IHTMLStorage**) DECLSPEC_HIDDEN;
802 void HTMLDocument_Persist_Init(HTMLDocument*) DECLSPEC_HIDDEN;
803 void HTMLDocument_OleCmd_Init(HTMLDocument*) DECLSPEC_HIDDEN;
804 void HTMLDocument_OleObj_Init(HTMLDocument*) DECLSPEC_HIDDEN;
805 void HTMLDocument_View_Init(HTMLDocument*) DECLSPEC_HIDDEN;
806 void HTMLDocument_Window_Init(HTMLDocument*) DECLSPEC_HIDDEN;
807 void HTMLDocument_Service_Init(HTMLDocument*) DECLSPEC_HIDDEN;
808 void HTMLDocument_Hlink_Init(HTMLDocument*) DECLSPEC_HIDDEN;
810 void TargetContainer_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN;
811 void init_binding_ui(HTMLDocumentObj*) DECLSPEC_HIDDEN;
813 void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN;
815 HRESULT HTMLCurrentStyle_Create(HTMLElement*,IHTMLCurrentStyle**) DECLSPEC_HIDDEN;
817 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*,const cpc_entry_t*) DECLSPEC_HIDDEN;
818 void ConnectionPointContainer_Destroy(ConnectionPointContainer*) DECLSPEC_HIDDEN;
820 HRESULT create_nscontainer(HTMLDocumentObj*,NSContainer**) DECLSPEC_HIDDEN;
821 void NSContainer_Release(NSContainer*) DECLSPEC_HIDDEN;
823 void init_mutation(nsIComponentManager*) DECLSPEC_HIDDEN;
824 void init_document_mutation(HTMLDocumentNode*) DECLSPEC_HIDDEN;
825 void release_document_mutation(HTMLDocumentNode*) DECLSPEC_HIDDEN;
826 JSContext *get_context_from_document(nsIDOMHTMLDocument*) DECLSPEC_HIDDEN;
828 void HTMLDocument_LockContainer(HTMLDocumentObj*,BOOL) DECLSPEC_HIDDEN;
829 void show_context_menu(HTMLDocumentObj*,DWORD,POINT*,IDispatch*) DECLSPEC_HIDDEN;
830 void notif_focus(HTMLDocumentObj*) DECLSPEC_HIDDEN;
832 void show_tooltip(HTMLDocumentObj*,DWORD,DWORD,LPCWSTR) DECLSPEC_HIDDEN;
833 void hide_tooltip(HTMLDocumentObj*) DECLSPEC_HIDDEN;
834 HRESULT get_client_disp_property(IOleClientSite*,DISPID,VARIANT*) DECLSPEC_HIDDEN;
836 UINT get_document_charset(HTMLDocumentNode*) DECLSPEC_HIDDEN;
838 HRESULT ProtocolFactory_Create(REFCLSID,REFIID,void**) DECLSPEC_HIDDEN;
840 BOOL load_gecko(void) DECLSPEC_HIDDEN;
841 void close_gecko(void) DECLSPEC_HIDDEN;
842 void register_nsservice(nsIComponentRegistrar*,nsIServiceManager*) DECLSPEC_HIDDEN;
843 void init_nsio(nsIComponentManager*,nsIComponentRegistrar*) DECLSPEC_HIDDEN;
844 void release_nsio(void) DECLSPEC_HIDDEN;
845 BOOL is_gecko_path(const char*) DECLSPEC_HIDDEN;
846 void set_viewer_zoom(NSContainer*,float) DECLSPEC_HIDDEN;
848 void init_node_cc(void) DECLSPEC_HIDDEN;
850 HRESULT nsuri_to_url(LPCWSTR,BOOL,BSTR*) DECLSPEC_HIDDEN;
852 HRESULT set_frame_doc(HTMLFrameBase*,nsIDOMDocument*) DECLSPEC_HIDDEN;
854 void call_property_onchanged(ConnectionPointContainer*,DISPID) DECLSPEC_HIDDEN;
855 HRESULT call_set_active_object(IOleInPlaceUIWindow*,IOleInPlaceActiveObject*) DECLSPEC_HIDDEN;
857 void *nsalloc(size_t) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN;
858 void nsfree(void*) DECLSPEC_HIDDEN;
860 BOOL nsACString_Init(nsACString *str, const char *data) DECLSPEC_HIDDEN;
861 void nsACString_InitDepend(nsACString*,const char*) DECLSPEC_HIDDEN;
862 void nsACString_SetData(nsACString*,const char*) DECLSPEC_HIDDEN;
863 UINT32 nsACString_GetData(const nsACString*,const char**) DECLSPEC_HIDDEN;
864 void nsACString_Finish(nsACString*) DECLSPEC_HIDDEN;
866 BOOL nsAString_Init(nsAString*,const PRUnichar*) DECLSPEC_HIDDEN;
867 void nsAString_InitDepend(nsAString*,const PRUnichar*) DECLSPEC_HIDDEN;
868 UINT32 nsAString_GetData(const nsAString*,const PRUnichar**) DECLSPEC_HIDDEN;
869 void nsAString_Finish(nsAString*) DECLSPEC_HIDDEN;
871 HRESULT return_nsstr(nsresult,nsAString*,BSTR*) DECLSPEC_HIDDEN;
873 static inline HRESULT return_nsstr_variant(nsresult nsres, nsAString *nsstr, VARIANT *p)
875 V_VT(p) = VT_BSTR;
876 return return_nsstr(nsres, nsstr, &V_BSTR(p));
879 nsICommandParams *create_nscommand_params(void) DECLSPEC_HIDDEN;
880 HRESULT nsnode_to_nsstring(nsIDOMNode*,nsAString*) DECLSPEC_HIDDEN;
881 void get_editor_controller(NSContainer*) DECLSPEC_HIDDEN;
882 nsresult get_nsinterface(nsISupports*,REFIID,void**) DECLSPEC_HIDDEN;
883 nsIWritableVariant *create_nsvariant(void) DECLSPEC_HIDDEN;
884 nsIXMLHttpRequest *create_nsxhr(nsIDOMWindow *nswindow) DECLSPEC_HIDDEN;
885 nsresult create_nsfile(const PRUnichar*,nsIFile**) DECLSPEC_HIDDEN;
886 char *get_nscategory_entry(const char*,const char*) DECLSPEC_HIDDEN;
888 HRESULT create_pending_window(HTMLOuterWindow*,nsChannelBSC*) DECLSPEC_HIDDEN;
889 HRESULT start_binding(HTMLInnerWindow*,BSCallback*,IBindCtx*) DECLSPEC_HIDDEN;
890 HRESULT async_start_doc_binding(HTMLOuterWindow*,HTMLInnerWindow*) DECLSPEC_HIDDEN;
891 void abort_window_bindings(HTMLInnerWindow*) DECLSPEC_HIDDEN;
892 void set_download_state(HTMLDocumentObj*,int) DECLSPEC_HIDDEN;
893 void call_docview_84(HTMLDocumentObj*) DECLSPEC_HIDDEN;
895 void set_ready_state(HTMLOuterWindow*,READYSTATE) DECLSPEC_HIDDEN;
896 HRESULT get_readystate_string(READYSTATE,BSTR*) DECLSPEC_HIDDEN;
898 HRESULT HTMLSelectionObject_Create(HTMLDocumentNode*,nsISelection*,IHTMLSelectionObject**) DECLSPEC_HIDDEN;
899 HRESULT HTMLTxtRange_Create(HTMLDocumentNode*,nsIDOMRange*,IHTMLTxtRange**) DECLSPEC_HIDDEN;
900 IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet*) DECLSPEC_HIDDEN;
901 IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList*) DECLSPEC_HIDDEN;
903 void detach_selection(HTMLDocumentNode*) DECLSPEC_HIDDEN;
904 void detach_ranges(HTMLDocumentNode*) DECLSPEC_HIDDEN;
905 HRESULT get_node_text(HTMLDOMNode*,BSTR*) DECLSPEC_HIDDEN;
906 HRESULT replace_node_by_html(nsIDOMHTMLDocument*,nsIDOMNode*,const WCHAR*) DECLSPEC_HIDDEN;
908 HRESULT create_nselem(HTMLDocumentNode*,const WCHAR*,nsIDOMHTMLElement**) DECLSPEC_HIDDEN;
909 HRESULT create_element(HTMLDocumentNode*,const WCHAR*,HTMLElement**) DECLSPEC_HIDDEN;
911 HRESULT HTMLDOMTextNode_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLDOMNode**) DECLSPEC_HIDDEN;
913 BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr) DECLSPEC_HIDDEN;
914 HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret) DECLSPEC_HIDDEN;
917 struct HTMLAttributeCollection {
918 DispatchEx dispex;
919 IHTMLAttributeCollection IHTMLAttributeCollection_iface;
920 IHTMLAttributeCollection2 IHTMLAttributeCollection2_iface;
921 IHTMLAttributeCollection3 IHTMLAttributeCollection3_iface;
923 LONG ref;
925 HTMLElement *elem;
926 struct list attrs;
929 typedef struct {
930 DispatchEx dispex;
931 IHTMLDOMAttribute IHTMLDOMAttribute_iface;
932 IHTMLDOMAttribute2 IHTMLDOMAttribute2_iface;
934 LONG ref;
936 WCHAR *name;
938 HTMLElement *elem;
939 DISPID dispid;
940 struct list entry;
941 } HTMLDOMAttribute;
943 HRESULT HTMLDOMAttribute_Create(const WCHAR*,HTMLElement*,DISPID,HTMLDOMAttribute**) DECLSPEC_HIDDEN;
945 HRESULT HTMLElement_Create(HTMLDocumentNode*,nsIDOMNode*,BOOL,HTMLElement**) DECLSPEC_HIDDEN;
946 HRESULT HTMLCommentElement_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLElement**) DECLSPEC_HIDDEN;
947 HRESULT HTMLAnchorElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
948 HRESULT HTMLAreaElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
949 HRESULT HTMLBodyElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
950 HRESULT HTMLButtonElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
951 HRESULT HTMLEmbedElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
952 HRESULT HTMLFormElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
953 HRESULT HTMLFrameElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
954 HRESULT HTMLHeadElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
955 HRESULT HTMLIFrame_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
956 HRESULT HTMLStyleElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
957 HRESULT HTMLImgElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
958 HRESULT HTMLInputElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
959 HRESULT HTMLLabelElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
960 HRESULT HTMLLinkElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
961 HRESULT HTMLMetaElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
962 HRESULT HTMLObjectElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
963 HRESULT HTMLOptionElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
964 HRESULT HTMLScriptElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
965 HRESULT HTMLSelectElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
966 HRESULT HTMLTable_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
967 HRESULT HTMLTableCell_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
968 HRESULT HTMLTableRow_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
969 HRESULT HTMLTextAreaElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
970 HRESULT HTMLTitleElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
971 HRESULT HTMLGenericElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
973 void HTMLDOMNode_Init(HTMLDocumentNode*,HTMLDOMNode*,nsIDOMNode*) DECLSPEC_HIDDEN;
974 void HTMLElement_Init(HTMLElement*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
975 void HTMLTextContainer_Init(HTMLTextContainer*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
976 void HTMLFrameBase_Init(HTMLFrameBase*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
978 HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**) DECLSPEC_HIDDEN;
979 void HTMLDOMNode_destructor(HTMLDOMNode*) DECLSPEC_HIDDEN;
981 HRESULT HTMLElement_QI(HTMLDOMNode*,REFIID,void**) DECLSPEC_HIDDEN;
982 void HTMLElement_destructor(HTMLDOMNode*) DECLSPEC_HIDDEN;
983 HRESULT HTMLElement_clone(HTMLDOMNode*,nsIDOMNode*,HTMLDOMNode**) DECLSPEC_HIDDEN;
984 HRESULT HTMLElement_get_attr_col(HTMLDOMNode*,HTMLAttributeCollection**) DECLSPEC_HIDDEN;
985 HRESULT HTMLElement_handle_event(HTMLDOMNode*,DWORD,nsIDOMEvent*,BOOL*) DECLSPEC_HIDDEN;
987 HRESULT HTMLFrameBase_QI(HTMLFrameBase*,REFIID,void**) DECLSPEC_HIDDEN;
988 void HTMLFrameBase_destructor(HTMLFrameBase*) DECLSPEC_HIDDEN;
990 HRESULT get_node(HTMLDocumentNode*,nsIDOMNode*,BOOL,HTMLDOMNode**) DECLSPEC_HIDDEN;
991 HRESULT get_elem(HTMLDocumentNode*,nsIDOMElement*,HTMLElement**) DECLSPEC_HIDDEN;
993 HTMLElement *unsafe_impl_from_IHTMLElement(IHTMLElement*) DECLSPEC_HIDDEN;
995 HRESULT search_window_props(HTMLInnerWindow*,BSTR,DWORD,DISPID*) DECLSPEC_HIDDEN;
996 HRESULT get_frame_by_name(HTMLOuterWindow*,const WCHAR*,BOOL,HTMLOuterWindow**) DECLSPEC_HIDDEN;
997 HRESULT get_doc_elem_by_id(HTMLDocumentNode*,const WCHAR*,HTMLElement**) DECLSPEC_HIDDEN;
998 HTMLOuterWindow *get_target_window(HTMLOuterWindow*,nsAString*,BOOL*) DECLSPEC_HIDDEN;
1000 HRESULT wrap_iface(IUnknown*,IUnknown*,IUnknown**) DECLSPEC_HIDDEN;
1002 IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL) DECLSPEC_HIDDEN;
1003 IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode*,nsIDOMNodeList*) DECLSPEC_HIDDEN;
1004 IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode*,nsIDOMHTMLCollection*) DECLSPEC_HIDDEN;
1006 #define ATTRFLAG_CASESENSITIVE 0x0001
1007 #define ATTRFLAG_ASSTRING 0x0002
1008 #define ATTRFLAG_EXPANDURL 0x0004
1010 HRESULT get_elem_attr_value_by_dispid(HTMLElement*,DISPID,DWORD,VARIANT*) DECLSPEC_HIDDEN;
1011 HRESULT get_elem_source_index(HTMLElement*,LONG*) DECLSPEC_HIDDEN;
1013 nsresult get_elem_attr_value(nsIDOMHTMLElement*,const WCHAR*,nsAString*,const PRUnichar**) DECLSPEC_HIDDEN;
1014 HRESULT elem_string_attr_getter(HTMLElement*,const WCHAR*,BOOL,BSTR*) DECLSPEC_HIDDEN;
1015 HRESULT elem_string_attr_setter(HTMLElement*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN;
1017 /* commands */
1018 typedef struct {
1019 DWORD id;
1020 HRESULT (*query)(HTMLDocument*,OLECMD*);
1021 HRESULT (*exec)(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
1022 } cmdtable_t;
1024 extern const cmdtable_t editmode_cmds[] DECLSPEC_HIDDEN;
1026 void do_ns_command(HTMLDocument*,const char*,nsICommandParams*) DECLSPEC_HIDDEN;
1028 /* timer */
1029 #define UPDATE_UI 0x0001
1030 #define UPDATE_TITLE 0x0002
1032 void update_doc(HTMLDocument*,DWORD) DECLSPEC_HIDDEN;
1033 void update_title(HTMLDocumentObj*) DECLSPEC_HIDDEN;
1034 void set_document_navigation(HTMLDocumentObj*,BOOL) DECLSPEC_HIDDEN;
1036 HRESULT do_query_service(IUnknown*,REFGUID,REFIID,void**) DECLSPEC_HIDDEN;
1038 /* editor */
1039 HRESULT setup_edit_mode(HTMLDocumentObj*) DECLSPEC_HIDDEN;
1040 void init_editor(HTMLDocument*) DECLSPEC_HIDDEN;
1041 void handle_edit_event(HTMLDocument*,nsIDOMEvent*) DECLSPEC_HIDDEN;
1042 HRESULT editor_exec_copy(HTMLDocument*,DWORD,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
1043 HRESULT editor_exec_cut(HTMLDocument*,DWORD,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
1044 HRESULT editor_exec_paste(HTMLDocument*,DWORD,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
1045 void handle_edit_load(HTMLDocument*) DECLSPEC_HIDDEN;
1046 HRESULT editor_is_dirty(HTMLDocument*) DECLSPEC_HIDDEN;
1047 void set_dirty(HTMLDocument*,VARIANT_BOOL) DECLSPEC_HIDDEN;
1049 extern DWORD mshtml_tls DECLSPEC_HIDDEN;
1051 typedef struct task_t task_t;
1052 typedef void (*task_proc_t)(task_t*);
1054 struct task_t {
1055 LONG target_magic;
1056 task_proc_t proc;
1057 task_proc_t destr;
1058 struct list entry;
1061 typedef struct {
1062 task_t header;
1063 HTMLDocumentObj *doc;
1064 } docobj_task_t;
1066 typedef struct {
1067 HWND thread_hwnd;
1068 struct list task_list;
1069 struct list timer_list;
1070 } thread_data_t;
1072 thread_data_t *get_thread_data(BOOL) DECLSPEC_HIDDEN;
1073 HWND get_thread_hwnd(void) DECLSPEC_HIDDEN;
1075 LONG get_task_target_magic(void) DECLSPEC_HIDDEN;
1076 HRESULT push_task(task_t*,task_proc_t,task_proc_t,LONG) DECLSPEC_HIDDEN;
1077 void remove_target_tasks(LONG) DECLSPEC_HIDDEN;
1078 void flush_pending_tasks(LONG) DECLSPEC_HIDDEN;
1080 HRESULT set_task_timer(HTMLInnerWindow*,DWORD,BOOL,IDispatch*,LONG*) DECLSPEC_HIDDEN;
1081 HRESULT clear_task_timer(HTMLInnerWindow*,BOOL,DWORD) DECLSPEC_HIDDEN;
1083 const char *debugstr_mshtml_guid(const GUID*) DECLSPEC_HIDDEN;
1085 DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1086 DEFINE_GUID(CLSID_JSProtocol, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1087 DEFINE_GUID(CLSID_MailtoProtocol, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1088 DEFINE_GUID(CLSID_ResProtocol, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1089 DEFINE_GUID(CLSID_SysimageProtocol, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
1091 DEFINE_GUID(CLSID_CMarkup,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
1093 DEFINE_OLEGUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0);
1095 DEFINE_GUID(CLSID_JScript, 0xf414c260,0x6ac0,0x11cf, 0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58);
1096 DEFINE_GUID(CLSID_VBScript, 0xb54f3741,0x5b07,0x11cf, 0xa4,0xb0,0x00,0xaa,0x00,0x4a,0x55,0xe8);
1098 DEFINE_GUID(IID_UndocumentedScriptIface,0x719c3050,0xf9d3,0x11cf,0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa0);
1099 DEFINE_GUID(IID_IDispatchJS,0x719c3050,0xf9d3,0x11cf,0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa6);
1101 /* memory allocation functions */
1103 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len)
1105 return HeapAlloc(GetProcessHeap(), 0, len);
1108 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len)
1110 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
1113 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t len)
1115 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
1118 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t len)
1120 return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len);
1123 static inline BOOL heap_free(void *mem)
1125 return HeapFree(GetProcessHeap(), 0, mem);
1128 static inline LPWSTR heap_strdupW(LPCWSTR str)
1130 LPWSTR ret = NULL;
1132 if(str) {
1133 DWORD size;
1135 size = (strlenW(str)+1)*sizeof(WCHAR);
1136 ret = heap_alloc(size);
1137 if(ret)
1138 memcpy(ret, str, size);
1141 return ret;
1144 static inline LPWSTR heap_strndupW(LPCWSTR str, unsigned len)
1146 LPWSTR ret = NULL;
1148 if(str) {
1149 ret = heap_alloc((len+1)*sizeof(WCHAR));
1150 if(ret)
1152 memcpy(ret, str, len*sizeof(WCHAR));
1153 ret[len] = 0;
1157 return ret;
1160 static inline char *heap_strdupA(const char *str)
1162 char *ret = NULL;
1164 if(str) {
1165 DWORD size;
1167 size = strlen(str)+1;
1168 ret = heap_alloc(size);
1169 if(ret)
1170 memcpy(ret, str, size);
1173 return ret;
1176 static inline WCHAR *heap_strdupAtoW(const char *str)
1178 LPWSTR ret = NULL;
1180 if(str) {
1181 DWORD len;
1183 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
1184 ret = heap_alloc(len*sizeof(WCHAR));
1185 if(ret)
1186 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
1189 return ret;
1192 static inline char *heap_strdupWtoA(LPCWSTR str)
1194 char *ret = NULL;
1196 if(str) {
1197 DWORD size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
1198 ret = heap_alloc(size);
1199 if(ret)
1200 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);
1203 return ret;
1206 static inline WCHAR *heap_strdupUtoW(const char *str)
1208 WCHAR *ret = NULL;
1210 if(str) {
1211 size_t len;
1213 len = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);
1214 ret = heap_alloc(len*sizeof(WCHAR));
1215 if(ret)
1216 MultiByteToWideChar(CP_UTF8, 0, str, -1, ret, len);
1219 return ret;
1222 static inline char *heap_strdupWtoU(const WCHAR *str)
1224 char *ret = NULL;
1226 if(str) {
1227 size_t size = WideCharToMultiByte(CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL);
1228 ret = heap_alloc(size);
1229 if(ret)
1230 WideCharToMultiByte(CP_UTF8, 0, str, -1, ret, size, NULL, NULL);
1233 return ret;
1236 static inline char *heap_strndupWtoU(LPCWSTR str, unsigned len)
1238 char *ret = NULL;
1239 DWORD size;
1241 if(str && len) {
1242 size = WideCharToMultiByte(CP_UTF8, 0, str, len, NULL, 0, NULL, NULL);
1243 ret = heap_alloc(size + 1);
1244 if(ret) {
1245 WideCharToMultiByte(CP_UTF8, 0, str, len, ret, size, NULL, NULL);
1246 ret[size] = '\0';
1250 return ret;
1253 static inline void windowref_addref(windowref_t *ref)
1255 InterlockedIncrement(&ref->ref);
1258 static inline void windowref_release(windowref_t *ref)
1260 if(!InterlockedDecrement(&ref->ref))
1261 heap_free(ref);
1264 UINT cp_from_charset_string(BSTR) DECLSPEC_HIDDEN;
1265 HDC get_display_dc(void) DECLSPEC_HIDDEN;
1266 HINSTANCE get_shdoclc(void) DECLSPEC_HIDDEN;
1267 void set_statustext(HTMLDocumentObj*,INT,LPCWSTR) DECLSPEC_HIDDEN;
1269 extern HINSTANCE hInst DECLSPEC_HIDDEN;