2 * Copyright 2005-2008 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
26 #include "wine/list.h"
27 #include "wine/unicode.h"
35 #define GENERATE_MSHTML_NS_FAILURE(code) \
36 ((nsresult) ((PRUint32)(1<<31) | ((PRUint32)(0x45+6)<<16) | (PRUint32)(code)))
38 #define NS_OK ((nsresult)0x00000000L)
39 #define NS_ERROR_FAILURE ((nsresult)0x80004005L)
40 #define NS_NOINTERFACE ((nsresult)0x80004002L)
41 #define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L)
42 #define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L)
43 #define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL)
44 #define NS_ERROR_UNKNOWN_PROTOCOL ((nsresult)0x804b0012L)
46 #define WINE_NS_LOAD_FROM_MONIKER GENERATE_MSHTML_NS_FAILURE(0)
48 #define NS_FAILED(res) ((res) & 0x80000000)
49 #define NS_SUCCEEDED(res) (!NS_FAILED(res))
53 #define MSHTML_E_NODOC 0x800a025c
55 typedef struct HTMLDOMNode HTMLDOMNode
;
56 typedef struct ConnectionPoint ConnectionPoint
;
57 typedef struct BSCallback BSCallback
;
58 typedef struct nsChannelBSC nsChannelBSC
;
59 typedef struct event_target_t event_target_t
;
61 /* NOTE: make sure to keep in sync with dispex.c */
65 DispDOMChildrenCollection_tid
,
67 DispHTMLCommentElement_tid
,
68 DispHTMLCurrentStyle_tid
,
70 DispHTMLDOMTextNode_tid
,
71 DispHTMLElementCollection_tid
,
72 DispHTMLGenericElement_tid
,
75 DispHTMLInputElement_tid
,
76 DispHTMLOptionElement_tid
,
77 DispHTMLSelectElement_tid
,
81 DispHTMLUnknownElement_tid
,
84 IHTMLBodyElement2_tid
,
85 IHTMLCommentElement_tid
,
86 IHTMLCurrentStyle_tid
,
91 IHTMLDOMChildrenCollection_tid
,
99 IHTMLElementCollection_tid
,
102 IHTMLGenericElement_tid
,
104 IHTMLInputElement_tid
,
106 IHTMLOptionElement_tid
,
107 IHTMLSelectElement_tid
,
112 IHTMLTextContainer_tid
,
120 typedef struct dispex_data_t dispex_data_t
;
121 typedef struct dispex_dynamic_data_t dispex_dynamic_data_t
;
123 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
124 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
127 HRESULT (*get_dispid
)(IUnknown
*,BSTR
,DWORD
,DISPID
*);
128 HRESULT (*invoke
)(IUnknown
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
129 } dispex_static_data_vtbl_t
;
132 const dispex_static_data_vtbl_t
*vtbl
;
133 const tid_t disp_tid
;
135 const tid_t
* const iface_tids
;
136 } dispex_static_data_t
;
139 const IDispatchExVtbl
*lpIDispatchExVtbl
;
143 dispex_static_data_t
*data
;
144 dispex_dynamic_data_t
*dynamic_data
;
147 void init_dispex(DispatchEx
*,IUnknown
*,dispex_static_data_t
*);
148 BOOL
dispex_query_interface(DispatchEx
*,REFIID
,void**);
149 HRESULT
dispex_get_dprop_ref(DispatchEx
*,const WCHAR
*,BOOL
,VARIANT
**);
153 const IHTMLWindow2Vtbl
*lpHTMLWindow2Vtbl
;
154 const IHTMLWindow3Vtbl
*lpHTMLWindow3Vtbl
;
155 const IDispatchExVtbl
*lpIDispatchExVtbl
;
160 nsIDOMWindow
*nswindow
;
162 IHTMLEventObj
*event
;
175 SCRIPTMODE_ACTIVESCRIPT
179 const IConnectionPointContainerVtbl
*lpConnectionPointContainerVtbl
;
181 ConnectionPoint
*cp_list
;
183 } ConnectionPointContainer
;
185 struct ConnectionPoint
{
186 const IConnectionPointVtbl
*lpConnectionPointVtbl
;
188 IConnectionPointContainer
*container
;
193 IPropertyNotifySink
*propnotif
;
199 ConnectionPoint
*next
;
204 const IHTMLLocationVtbl
*lpHTMLLocationVtbl
;
212 const IHTMLOptionElementFactoryVtbl
*lpHTMLOptionElementFactoryVtbl
;
217 } HTMLOptionElementFactory
;
219 struct HTMLDocument
{
221 const IHTMLDocument2Vtbl
*lpHTMLDocument2Vtbl
;
222 const IHTMLDocument3Vtbl
*lpHTMLDocument3Vtbl
;
223 const IHTMLDocument4Vtbl
*lpHTMLDocument4Vtbl
;
224 const IHTMLDocument5Vtbl
*lpHTMLDocument5Vtbl
;
225 const IPersistMonikerVtbl
*lpPersistMonikerVtbl
;
226 const IPersistFileVtbl
*lpPersistFileVtbl
;
227 const IMonikerPropVtbl
*lpMonikerPropVtbl
;
228 const IOleObjectVtbl
*lpOleObjectVtbl
;
229 const IOleDocumentVtbl
*lpOleDocumentVtbl
;
230 const IOleDocumentViewVtbl
*lpOleDocumentViewVtbl
;
231 const IOleInPlaceActiveObjectVtbl
*lpOleInPlaceActiveObjectVtbl
;
232 const IViewObject2Vtbl
*lpViewObject2Vtbl
;
233 const IOleInPlaceObjectWindowlessVtbl
*lpOleInPlaceObjectWindowlessVtbl
;
234 const IServiceProviderVtbl
*lpServiceProviderVtbl
;
235 const IOleCommandTargetVtbl
*lpOleCommandTargetVtbl
;
236 const IOleControlVtbl
*lpOleControlVtbl
;
237 const IHlinkTargetVtbl
*lpHlinkTargetVtbl
;
238 const IPersistStreamInitVtbl
*lpPersistStreamInitVtbl
;
239 const ICustomDocVtbl
*lpCustomDocVtbl
;
240 const IDispatchExVtbl
*lpIDispatchExVtbl
;
241 const ISupportErrorInfoVtbl
*lpSupportErrorInfoVtbl
;
244 NSContainer
*nscontainer
;
246 nsIDOMHTMLDocument
*nsdoc
;
248 IOleClientSite
*client
;
249 IDocHostUIHandler
*hostui
;
250 IOleInPlaceSite
*ipsite
;
251 IOleInPlaceFrame
*frame
;
252 IOleInPlaceUIWindow
*ip_window
;
254 IOleUndoManager
*undomgr
;
256 nsChannelBSC
*bscallback
;
259 struct list bindings
;
261 struct list script_hosts
;
266 DOCHOSTUIINFO hostinfo
;
269 SCRIPTMODE scriptmode
;
270 READYSTATE readystate
;
271 BOOL in_place_active
;
275 BOOL container_locked
;
281 event_target_t
*event_target
;
282 ConnectionPointContainer cp_container
;
283 ConnectionPoint cp_htmldocevents
;
284 ConnectionPoint cp_htmldocevents2
;
285 ConnectionPoint cp_propnotif
;
287 HTMLOptionElementFactory
*option_factory
;
288 HTMLLocation
*location
;
290 struct list selection_list
;
291 struct list range_list
;
297 const nsIDOMEventListenerVtbl
*lpDOMEventListenerVtbl
;
301 typedef struct _mutation_queue_t
{
303 nsISupports
*nsiface
;
305 struct _mutation_queue_t
*next
;
309 const nsIWebBrowserChromeVtbl
*lpWebBrowserChromeVtbl
;
310 const nsIContextMenuListenerVtbl
*lpContextMenuListenerVtbl
;
311 const nsIURIContentListenerVtbl
*lpURIContentListenerVtbl
;
312 const nsIEmbeddingSiteWindowVtbl
*lpEmbeddingSiteWindowVtbl
;
313 const nsITooltipListenerVtbl
*lpTooltipListenerVtbl
;
314 const nsIInterfaceRequestorVtbl
*lpInterfaceRequestorVtbl
;
315 const nsIWeakReferenceVtbl
*lpWeakReferenceVtbl
;
316 const nsISupportsWeakReferenceVtbl
*lpSupportsWeakReferenceVtbl
;
318 const nsIDocumentObserverVtbl
*lpDocumentObserverVtbl
;
320 const nsIRunnableVtbl
*lpRunnableVtbl
;
322 nsEventListener blur_listener
;
323 nsEventListener focus_listener
;
324 nsEventListener keypress_listener
;
325 nsEventListener load_listener
;
326 nsEventListener htmlevent_listener
;
328 nsIWebBrowser
*webbrowser
;
329 nsIWebNavigation
*navigation
;
330 nsIBaseWindow
*window
;
331 nsIWebBrowserFocus
*focus
;
334 nsIController
*editor_controller
;
341 nsIURIContentListener
*content_listener
;
345 mutation_queue_t
*mutation_queue
;
346 mutation_queue_t
*mutation_queue_tail
;
348 nsChannelBSC
*bscallback
; /* hack */
349 HWND reset_focus
; /* hack */
355 const nsIHttpChannelVtbl
*lpHttpChannelVtbl
;
356 const nsIUploadChannelVtbl
*lpUploadChannelVtbl
;
361 nsIHttpChannel
*http_channel
;
363 nsIInputStream
*post_data_stream
;
364 nsILoadGroup
*load_group
;
365 nsIInterfaceRequestor
*notif_callback
;
367 nsLoadFlags load_flags
;
368 nsIURI
*original_uri
;
374 HRESULT (*qi
)(HTMLDOMNode
*,REFIID
,void**);
375 void (*destructor
)(HTMLDOMNode
*);
376 HRESULT (*put_disabled
)(HTMLDOMNode
*,VARIANT_BOOL
);
377 HRESULT (*get_disabled
)(HTMLDOMNode
*,VARIANT_BOOL
*);
382 const IHTMLDOMNodeVtbl
*lpHTMLDOMNodeVtbl
;
383 const IHTMLDOMNode2Vtbl
*lpHTMLDOMNode2Vtbl
;
384 const NodeImplVtbl
*vtbl
;
390 event_target_t
*event_target
;
397 ConnectionPointContainer cp_container
;
399 const IHTMLElementVtbl
*lpHTMLElementVtbl
;
400 const IHTMLElement2Vtbl
*lpHTMLElement2Vtbl
;
401 const IHTMLElement3Vtbl
*lpHTMLElement3Vtbl
;
403 nsIDOMHTMLElement
*nselem
;
409 const IHTMLTextContainerVtbl
*lpHTMLTextContainerVtbl
;
414 #define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
415 #define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
417 #define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl)
418 #define HTMLDOC3(x) ((IHTMLDocument3*) &(x)->lpHTMLDocument3Vtbl)
419 #define HTMLDOC4(x) ((IHTMLDocument4*) &(x)->lpHTMLDocument4Vtbl)
420 #define HTMLDOC5(x) ((IHTMLDocument5*) &(x)->lpHTMLDocument5Vtbl)
421 #define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
422 #define PERSISTMON(x) ((IPersistMoniker*) &(x)->lpPersistMonikerVtbl)
423 #define PERSISTFILE(x) ((IPersistFile*) &(x)->lpPersistFileVtbl)
424 #define MONPROP(x) ((IMonikerProp*) &(x)->lpMonikerPropVtbl)
425 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
426 #define OLEDOC(x) ((IOleDocument*) &(x)->lpOleDocumentVtbl)
427 #define DOCVIEW(x) ((IOleDocumentView*) &(x)->lpOleDocumentViewVtbl)
428 #define OLEWIN(x) ((IOleWindow*) &(x)->lpOleInPlaceActiveObjectVtbl)
429 #define ACTOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
430 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObject2Vtbl)
431 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObject2Vtbl)
432 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
433 #define INPLACEWIN(x) ((IOleInPlaceObjectWindowless*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
434 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
435 #define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
436 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
437 #define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
438 #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
439 #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
440 #define CUSTOMDOC(x) ((ICustomDoc*) &(x)->lpCustomDocVtbl)
442 #define NSWBCHROME(x) ((nsIWebBrowserChrome*) &(x)->lpWebBrowserChromeVtbl)
443 #define NSCML(x) ((nsIContextMenuListener*) &(x)->lpContextMenuListenerVtbl)
444 #define NSURICL(x) ((nsIURIContentListener*) &(x)->lpURIContentListenerVtbl)
445 #define NSEMBWNDS(x) ((nsIEmbeddingSiteWindow*) &(x)->lpEmbeddingSiteWindowVtbl)
446 #define NSIFACEREQ(x) ((nsIInterfaceRequestor*) &(x)->lpInterfaceRequestorVtbl)
447 #define NSTOOLTIP(x) ((nsITooltipListener*) &(x)->lpTooltipListenerVtbl)
448 #define NSEVENTLIST(x) ((nsIDOMEventListener*) &(x)->lpDOMEventListenerVtbl)
449 #define NSWEAKREF(x) ((nsIWeakReference*) &(x)->lpWeakReferenceVtbl)
450 #define NSSUPWEAKREF(x) ((nsISupportsWeakReference*) &(x)->lpSupportsWeakReferenceVtbl)
452 #define NSDOCOBS(x) ((nsIDocumentObserver*) &(x)->lpDocumentObserverVtbl)
454 #define NSRUNNABLE(x) ((nsIRunnable*) &(x)->lpRunnableVtbl)
456 #define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
457 #define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
458 #define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl)
460 #define HTTPNEG(x) ((IHttpNegotiate2*) &(x)->lpHttpNegotiate2Vtbl)
461 #define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
462 #define BINDINFO(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl);
464 #define HTMLELEM(x) ((IHTMLElement*) &(x)->lpHTMLElementVtbl)
465 #define HTMLELEM2(x) ((IHTMLElement2*) &(x)->lpHTMLElement2Vtbl)
466 #define HTMLELEM3(x) ((IHTMLElement3*) &(x)->lpHTMLElement3Vtbl)
467 #define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
468 #define HTMLDOMNODE2(x) ((IHTMLDOMNode2*) &(x)->lpHTMLDOMNode2Vtbl)
470 #define HTMLTEXTCONT(x) ((IHTMLTextContainer*) &(x)->lpHTMLTextContainerVtbl)
472 #define HTMLOPTFACTORY(x) ((IHTMLOptionElementFactory*) &(x)->lpHTMLOptionElementFactoryVtbl)
473 #define HTMLLOCATION(x) ((IHTMLLocation*) &(x)->lpHTMLLocationVtbl)
475 #define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
477 #define SUPPERRINFO(x) ((ISupportErrorInfo*) &(x)->lpSupportErrorInfoVtbl)
479 #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
480 #define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
482 HRESULT
HTMLDocument_Create(IUnknown
*,REFIID
,void**);
483 HRESULT
HTMLLoadOptions_Create(IUnknown
*,REFIID
,void**);
484 HRESULT
create_doc_from_nsdoc(nsIDOMHTMLDocument
*,HTMLDocument
**);
486 HRESULT
HTMLWindow_Create(HTMLDocument
*,nsIDOMWindow
*,HTMLWindow
**);
487 HTMLWindow
*nswindow_to_window(const nsIDOMWindow
*);
488 HTMLOptionElementFactory
*HTMLOptionElementFactory_Create(HTMLDocument
*);
489 HTMLLocation
*HTMLLocation_Create(HTMLDocument
*);
490 IOmNavigator
*OmNavigator_Create(void);
492 void HTMLDocument_HTMLDocument3_Init(HTMLDocument
*);
493 void HTMLDocument_HTMLDocument5_Init(HTMLDocument
*);
494 void HTMLDocument_Persist_Init(HTMLDocument
*);
495 void HTMLDocument_OleCmd_Init(HTMLDocument
*);
496 void HTMLDocument_OleObj_Init(HTMLDocument
*);
497 void HTMLDocument_View_Init(HTMLDocument
*);
498 void HTMLDocument_Window_Init(HTMLDocument
*);
499 void HTMLDocument_Service_Init(HTMLDocument
*);
500 void HTMLDocument_Hlink_Init(HTMLDocument
*);
502 HRESULT
HTMLCurrentStyle_Create(HTMLElement
*,IHTMLCurrentStyle
**);
504 void ConnectionPoint_Init(ConnectionPoint
*,ConnectionPointContainer
*,REFIID
);
505 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*);
506 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*);
508 NSContainer
*NSContainer_Create(HTMLDocument
*,NSContainer
*);
509 void NSContainer_Release(NSContainer
*);
511 void init_mutation(NSContainer
*);
512 void set_mutation_observer(NSContainer
*,nsIDOMHTMLDocument
*);
514 void HTMLDocument_LockContainer(HTMLDocument
*,BOOL
);
515 void show_context_menu(HTMLDocument
*,DWORD
,POINT
*,IDispatch
*);
516 void notif_focus(HTMLDocument
*);
518 void show_tooltip(HTMLDocument
*,DWORD
,DWORD
,LPCWSTR
);
519 void hide_tooltip(HTMLDocument
*);
520 HRESULT
get_client_disp_property(IOleClientSite
*,DISPID
,VARIANT
*);
522 HRESULT
ProtocolFactory_Create(REFCLSID
,REFIID
,void**);
524 BOOL
load_gecko(BOOL
);
525 void close_gecko(void);
526 void register_nsservice(nsIComponentRegistrar
*,nsIServiceManager
*);
527 void init_nsio(nsIComponentManager
*,nsIComponentRegistrar
*);
528 void release_nsio(void);
529 BOOL
install_wine_gecko(BOOL
);
531 HRESULT
nsuri_to_url(LPCWSTR
,BSTR
*);
533 void hlink_frame_navigate(HTMLDocument
*,IHlinkFrame
*,LPCWSTR
,nsIInputStream
*,DWORD
);
535 void call_property_onchanged(ConnectionPoint
*,DISPID
);
536 HRESULT
call_set_active_object(IOleInPlaceUIWindow
*,IOleInPlaceActiveObject
*);
538 void *nsalloc(size_t) __WINE_ALLOC_SIZE(1);
541 void nsACString_Init(nsACString
*,const char*);
542 void nsACString_SetData(nsACString
*,const char*);
543 PRUint32
nsACString_GetData(const nsACString
*,const char**);
544 void nsACString_Finish(nsACString
*);
546 void nsAString_Init(nsAString
*,const PRUnichar
*);
547 void nsAString_SetData(nsAString
*,const PRUnichar
*);
548 PRUint32
nsAString_GetData(const nsAString
*,const PRUnichar
**);
549 void nsAString_Finish(nsAString
*);
551 nsIInputStream
*create_nsstream(const char*,PRInt32
);
552 nsICommandParams
*create_nscommand_params(void);
553 void nsnode_to_nsstring(nsIDOMNode
*,nsAString
*);
554 void get_editor_controller(NSContainer
*);
555 void init_nsevents(NSContainer
*);
556 void add_nsevent_listener(NSContainer
*,LPCWSTR
);
557 nsresult
get_nsinterface(nsISupports
*,REFIID
,void**);
558 void update_nsdocument(HTMLDocument
*);
560 void set_document_bscallback(HTMLDocument
*,nsChannelBSC
*);
561 void set_current_mon(HTMLDocument
*,IMoniker
*);
562 HRESULT
start_binding(HTMLDocument
*,BSCallback
*,IBindCtx
*);
564 HRESULT
bind_mon_to_buffer(HTMLDocument
*,IMoniker
*,void**,DWORD
*);
566 nsChannelBSC
*create_channelbsc(IMoniker
*);
567 HRESULT
channelbsc_load_stream(nsChannelBSC
*,IStream
*);
568 void channelbsc_set_channel(nsChannelBSC
*,nsChannel
*,nsIStreamListener
*,nsISupports
*);
569 IMoniker
*get_channelbsc_mon(nsChannelBSC
*);
571 IHTMLSelectionObject
*HTMLSelectionObject_Create(HTMLDocument
*,nsISelection
*);
572 IHTMLTxtRange
*HTMLTxtRange_Create(HTMLDocument
*,nsIDOMRange
*);
573 IHTMLStyle
*HTMLStyle_Create(nsIDOMCSSStyleDeclaration
*);
574 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*);
575 IHTMLStyleSheetsCollection
*HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList
*);
577 void detach_selection(HTMLDocument
*);
578 void detach_ranges(HTMLDocument
*);
579 HRESULT
get_node_text(HTMLDOMNode
*,BSTR
*);
581 HTMLDOMNode
*HTMLDOMTextNode_Create(HTMLDocument
*,nsIDOMNode
*);
583 HTMLElement
*HTMLElement_Create(HTMLDocument
*,nsIDOMNode
*,BOOL
);
584 HTMLElement
*HTMLCommentElement_Create(HTMLDocument
*,nsIDOMNode
*);
585 HTMLElement
*HTMLAnchorElement_Create(nsIDOMHTMLElement
*);
586 HTMLElement
*HTMLBodyElement_Create(nsIDOMHTMLElement
*);
587 HTMLElement
*HTMLIFrame_Create(nsIDOMHTMLElement
*);
588 HTMLElement
*HTMLImgElement_Create(nsIDOMHTMLElement
*);
589 HTMLElement
*HTMLInputElement_Create(nsIDOMHTMLElement
*);
590 HTMLElement
*HTMLOptionElement_Create(nsIDOMHTMLElement
*);
591 HTMLElement
*HTMLScriptElement_Create(nsIDOMHTMLElement
*);
592 HTMLElement
*HTMLSelectElement_Create(nsIDOMHTMLElement
*);
593 HTMLElement
*HTMLTable_Create(nsIDOMHTMLElement
*);
594 HTMLElement
*HTMLTableRow_Create(nsIDOMHTMLElement
*);
595 HTMLElement
*HTMLTextAreaElement_Create(nsIDOMHTMLElement
*);
596 HTMLElement
*HTMLGenericElement_Create(nsIDOMHTMLElement
*);
598 void HTMLDOMNode_Init(HTMLDocument
*,HTMLDOMNode
*,nsIDOMNode
*);
599 void HTMLElement_Init(HTMLElement
*);
600 void HTMLElement2_Init(HTMLElement
*);
601 void HTMLElement3_Init(HTMLElement
*);
602 void HTMLTextContainer_Init(HTMLTextContainer
*);
604 HRESULT
HTMLDOMNode_QI(HTMLDOMNode
*,REFIID
,void**);
605 void HTMLDOMNode_destructor(HTMLDOMNode
*);
607 HRESULT
HTMLElement_QI(HTMLDOMNode
*,REFIID
,void**);
608 void HTMLElement_destructor(HTMLDOMNode
*);
610 HTMLDOMNode
*get_node(HTMLDocument
*,nsIDOMNode
*,BOOL
);
611 void release_nodes(HTMLDocument
*);
613 void release_script_hosts(HTMLDocument
*);
614 void connect_scripts(HTMLDocument
*);
615 void doc_insert_script(HTMLDocument
*,nsIDOMHTMLScriptElement
*);
616 IDispatch
*script_parse_event(HTMLDocument
*,LPCWSTR
);
617 void set_script_mode(HTMLDocument
*,SCRIPTMODE
);
619 IHTMLElementCollection
*create_all_collection(HTMLDOMNode
*,BOOL
);
620 IHTMLElementCollection
*create_collection_from_nodelist(HTMLDocument
*,IUnknown
*,nsIDOMNodeList
*);
621 IHTMLElementCollection
*create_collection_from_htmlcol(HTMLDocument
*,IUnknown
*,nsIDOMHTMLCollection
*);
626 HRESULT (*query
)(HTMLDocument
*,OLECMD
*);
627 HRESULT (*exec
)(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
630 extern const cmdtable_t editmode_cmds
[];
632 void do_ns_command(NSContainer
*,const char*,nsICommandParams
*);
635 #define UPDATE_UI 0x0001
636 #define UPDATE_TITLE 0x0002
638 void update_doc(HTMLDocument
*This
, DWORD flags
);
639 void update_title(HTMLDocument
*);
642 void init_editor(HTMLDocument
*);
643 void set_ns_editmode(NSContainer
*);
644 void handle_edit_event(HTMLDocument
*,nsIDOMEvent
*);
645 HRESULT
editor_exec_copy(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
646 HRESULT
editor_exec_cut(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
647 HRESULT
editor_exec_paste(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
648 void handle_edit_load(HTMLDocument
*);
649 HRESULT
editor_is_dirty(HTMLDocument
*);
650 void set_dirty(HTMLDocument
*,VARIANT_BOOL
);
652 extern DWORD mshtml_tls
;
654 typedef struct task_t
{
658 TASK_SETDOWNLOADSTATE
,
664 nsChannelBSC
*bscallback
;
671 task_t
*task_queue_head
;
672 task_t
*task_queue_tail
;
673 struct list timer_list
;
676 thread_data_t
*get_thread_data(BOOL
);
677 HWND
get_thread_hwnd(void);
678 void push_task(task_t
*);
679 void remove_doc_tasks(const HTMLDocument
*);
680 DWORD
set_task_timer(HTMLDocument
*,DWORD
,BOOL
,IDispatch
*);
681 HRESULT
clear_task_timer(HTMLDocument
*,BOOL
,DWORD
);
683 void release_typelib(void);
684 void call_disp_func(HTMLDocument
*,IDispatch
*,IDispatch
*);
686 const char *debugstr_variant(const VARIANT
*);
688 DEFINE_GUID(CLSID_AboutProtocol
, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
689 DEFINE_GUID(CLSID_JSProtocol
, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
690 DEFINE_GUID(CLSID_MailtoProtocol
, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
691 DEFINE_GUID(CLSID_ResProtocol
, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
692 DEFINE_GUID(CLSID_SysimageProtocol
, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
694 DEFINE_GUID(CLSID_CMarkup
,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
696 /* memory allocation functions */
698 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len
)
700 return HeapAlloc(GetProcessHeap(), 0, len
);
703 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len
)
705 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
708 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem
, size_t len
)
710 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
713 static inline BOOL
heap_free(void *mem
)
715 return HeapFree(GetProcessHeap(), 0, mem
);
718 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
725 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
726 ret
= heap_alloc(size
);
727 memcpy(ret
, str
, size
);
733 static inline char *heap_strdupA(const char *str
)
740 size
= strlen(str
)+1;
741 ret
= heap_alloc(size
);
742 memcpy(ret
, str
, size
);
748 static inline WCHAR
*heap_strdupAtoW(const char *str
)
755 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
756 ret
= heap_alloc(len
*sizeof(WCHAR
));
757 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
763 static inline char *heap_strdupWtoA(LPCWSTR str
)
768 DWORD size
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
769 ret
= heap_alloc(size
);
770 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, size
, NULL
, NULL
);
776 HINSTANCE
get_shdoclc(void);
778 extern HINSTANCE hInst
;