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
27 #include "wine/list.h"
28 #include "wine/unicode.h"
36 #define GENERATE_MSHTML_NS_FAILURE(code) \
37 ((nsresult) ((PRUint32)(1<<31) | ((PRUint32)(0x45+6)<<16) | (PRUint32)(code)))
39 #define NS_OK ((nsresult)0x00000000L)
40 #define NS_ERROR_FAILURE ((nsresult)0x80004005L)
41 #define NS_NOINTERFACE ((nsresult)0x80004002L)
42 #define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L)
43 #define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L)
44 #define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL)
45 #define NS_ERROR_UNKNOWN_PROTOCOL ((nsresult)0x804b0012L)
47 #define WINE_NS_LOAD_FROM_MONIKER GENERATE_MSHTML_NS_FAILURE(0)
49 #define NS_FAILED(res) ((res) & 0x80000000)
50 #define NS_SUCCEEDED(res) (!NS_FAILED(res))
54 #define MSHTML_E_NODOC 0x800a025c
56 typedef struct HTMLDOMNode HTMLDOMNode
;
57 typedef struct ConnectionPoint ConnectionPoint
;
58 typedef struct BSCallback BSCallback
;
59 typedef struct nsChannelBSC nsChannelBSC
;
60 typedef struct event_target_t event_target_t
;
62 /* NOTE: make sure to keep in sync with dispex.c */
66 DispDOMChildrenCollection_tid
,
68 DispHTMLCommentElement_tid
,
69 DispHTMLCurrentStyle_tid
,
71 DispHTMLDOMTextNode_tid
,
72 DispHTMLElementCollection_tid
,
73 DispHTMLGenericElement_tid
,
76 DispHTMLInputElement_tid
,
77 DispHTMLOptionElement_tid
,
78 DispHTMLSelectElement_tid
,
82 DispHTMLUnknownElement_tid
,
85 IHTMLBodyElement2_tid
,
86 IHTMLCommentElement_tid
,
87 IHTMLCurrentStyle_tid
,
88 IHTMLCurrentStyle2_tid
,
89 IHTMLCurrentStyle3_tid
,
90 IHTMLCurrentStyle4_tid
,
95 IHTMLDOMChildrenCollection_tid
,
103 IHTMLElementCollection_tid
,
106 IHTMLGenericElement_tid
,
108 IHTMLInputElement_tid
,
110 IHTMLOptionElement_tid
,
111 IHTMLSelectElement_tid
,
118 IHTMLTextContainer_tid
,
126 typedef struct dispex_data_t dispex_data_t
;
127 typedef struct dispex_dynamic_data_t dispex_dynamic_data_t
;
129 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
130 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
133 HRESULT (*get_dispid
)(IUnknown
*,BSTR
,DWORD
,DISPID
*);
134 HRESULT (*invoke
)(IUnknown
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
135 } dispex_static_data_vtbl_t
;
138 const dispex_static_data_vtbl_t
*vtbl
;
139 const tid_t disp_tid
;
141 const tid_t
* const iface_tids
;
142 } dispex_static_data_t
;
145 const IDispatchExVtbl
*lpIDispatchExVtbl
;
149 dispex_static_data_t
*data
;
150 dispex_dynamic_data_t
*dynamic_data
;
153 void init_dispex(DispatchEx
*,IUnknown
*,dispex_static_data_t
*);
154 BOOL
dispex_query_interface(DispatchEx
*,REFIID
,void**);
155 HRESULT
dispex_get_dprop_ref(DispatchEx
*,const WCHAR
*,BOOL
,VARIANT
**);
159 const IHTMLWindow2Vtbl
*lpHTMLWindow2Vtbl
;
160 const IHTMLWindow3Vtbl
*lpHTMLWindow3Vtbl
;
161 const IDispatchExVtbl
*lpIDispatchExVtbl
;
166 nsIDOMWindow
*nswindow
;
168 IHTMLEventObj
*event
;
181 SCRIPTMODE_ACTIVESCRIPT
185 const IConnectionPointContainerVtbl
*lpConnectionPointContainerVtbl
;
187 ConnectionPoint
*cp_list
;
189 } ConnectionPointContainer
;
191 struct ConnectionPoint
{
192 const IConnectionPointVtbl
*lpConnectionPointVtbl
;
194 IConnectionPointContainer
*container
;
199 IPropertyNotifySink
*propnotif
;
205 ConnectionPoint
*next
;
208 struct HTMLLocation
{
210 const IHTMLLocationVtbl
*lpHTMLLocationVtbl
;
218 const IHTMLOptionElementFactoryVtbl
*lpHTMLOptionElementFactoryVtbl
;
223 } HTMLOptionElementFactory
;
225 struct HTMLDocument
{
227 const IHTMLDocument2Vtbl
*lpHTMLDocument2Vtbl
;
228 const IHTMLDocument3Vtbl
*lpHTMLDocument3Vtbl
;
229 const IHTMLDocument4Vtbl
*lpHTMLDocument4Vtbl
;
230 const IHTMLDocument5Vtbl
*lpHTMLDocument5Vtbl
;
231 const IPersistMonikerVtbl
*lpPersistMonikerVtbl
;
232 const IPersistFileVtbl
*lpPersistFileVtbl
;
233 const IPersistHistoryVtbl
*lpPersistHistoryVtbl
;
234 const IMonikerPropVtbl
*lpMonikerPropVtbl
;
235 const IOleObjectVtbl
*lpOleObjectVtbl
;
236 const IOleDocumentVtbl
*lpOleDocumentVtbl
;
237 const IOleDocumentViewVtbl
*lpOleDocumentViewVtbl
;
238 const IOleInPlaceActiveObjectVtbl
*lpOleInPlaceActiveObjectVtbl
;
239 const IViewObject2Vtbl
*lpViewObject2Vtbl
;
240 const IOleInPlaceObjectWindowlessVtbl
*lpOleInPlaceObjectWindowlessVtbl
;
241 const IServiceProviderVtbl
*lpServiceProviderVtbl
;
242 const IOleCommandTargetVtbl
*lpOleCommandTargetVtbl
;
243 const IOleControlVtbl
*lpOleControlVtbl
;
244 const IHlinkTargetVtbl
*lpHlinkTargetVtbl
;
245 const IPersistStreamInitVtbl
*lpPersistStreamInitVtbl
;
246 const ICustomDocVtbl
*lpCustomDocVtbl
;
247 const IDispatchExVtbl
*lpIDispatchExVtbl
;
248 const ISupportErrorInfoVtbl
*lpSupportErrorInfoVtbl
;
251 NSContainer
*nscontainer
;
253 nsIDOMHTMLDocument
*nsdoc
;
255 IOleClientSite
*client
;
256 IDocHostUIHandler
*hostui
;
257 IOleInPlaceSite
*ipsite
;
258 IOleInPlaceFrame
*frame
;
259 IOleInPlaceUIWindow
*ip_window
;
261 IOleUndoManager
*undomgr
;
263 nsChannelBSC
*bscallback
;
266 struct list bindings
;
268 struct list script_hosts
;
273 DOCHOSTUIINFO hostinfo
;
276 SCRIPTMODE scriptmode
;
277 READYSTATE readystate
;
278 BOOL in_place_active
;
282 BOOL container_locked
;
288 event_target_t
*event_target
;
289 ConnectionPointContainer cp_container
;
290 ConnectionPoint cp_htmldocevents
;
291 ConnectionPoint cp_htmldocevents2
;
292 ConnectionPoint cp_propnotif
;
294 HTMLOptionElementFactory
*option_factory
;
295 HTMLLocation
*location
;
297 struct list selection_list
;
298 struct list range_list
;
304 const nsIDOMEventListenerVtbl
*lpDOMEventListenerVtbl
;
308 typedef struct _mutation_queue_t
{
310 nsISupports
*nsiface
;
312 struct _mutation_queue_t
*next
;
316 const nsIWebBrowserChromeVtbl
*lpWebBrowserChromeVtbl
;
317 const nsIContextMenuListenerVtbl
*lpContextMenuListenerVtbl
;
318 const nsIURIContentListenerVtbl
*lpURIContentListenerVtbl
;
319 const nsIEmbeddingSiteWindowVtbl
*lpEmbeddingSiteWindowVtbl
;
320 const nsITooltipListenerVtbl
*lpTooltipListenerVtbl
;
321 const nsIInterfaceRequestorVtbl
*lpInterfaceRequestorVtbl
;
322 const nsIWeakReferenceVtbl
*lpWeakReferenceVtbl
;
323 const nsISupportsWeakReferenceVtbl
*lpSupportsWeakReferenceVtbl
;
325 const nsIDocumentObserverVtbl
*lpDocumentObserverVtbl
;
327 const nsIRunnableVtbl
*lpRunnableVtbl
;
329 nsEventListener blur_listener
;
330 nsEventListener focus_listener
;
331 nsEventListener keypress_listener
;
332 nsEventListener load_listener
;
333 nsEventListener htmlevent_listener
;
335 nsIWebBrowser
*webbrowser
;
336 nsIWebNavigation
*navigation
;
337 nsIBaseWindow
*window
;
338 nsIWebBrowserFocus
*focus
;
341 nsIController
*editor_controller
;
348 nsIURIContentListener
*content_listener
;
352 mutation_queue_t
*mutation_queue
;
353 mutation_queue_t
*mutation_queue_tail
;
355 nsChannelBSC
*bscallback
; /* hack */
356 HWND reset_focus
; /* hack */
362 const nsIHttpChannelVtbl
*lpHttpChannelVtbl
;
363 const nsIUploadChannelVtbl
*lpUploadChannelVtbl
;
368 nsIHttpChannel
*http_channel
;
370 nsIInputStream
*post_data_stream
;
371 nsILoadGroup
*load_group
;
372 nsIInterfaceRequestor
*notif_callback
;
374 nsLoadFlags load_flags
;
375 nsIURI
*original_uri
;
381 HRESULT (*qi
)(HTMLDOMNode
*,REFIID
,void**);
382 void (*destructor
)(HTMLDOMNode
*);
383 HRESULT (*put_disabled
)(HTMLDOMNode
*,VARIANT_BOOL
);
384 HRESULT (*get_disabled
)(HTMLDOMNode
*,VARIANT_BOOL
*);
389 const IHTMLDOMNodeVtbl
*lpHTMLDOMNodeVtbl
;
390 const IHTMLDOMNode2Vtbl
*lpHTMLDOMNode2Vtbl
;
391 const NodeImplVtbl
*vtbl
;
397 event_target_t
*event_target
;
404 ConnectionPointContainer cp_container
;
406 const IHTMLElementVtbl
*lpHTMLElementVtbl
;
407 const IHTMLElement2Vtbl
*lpHTMLElement2Vtbl
;
408 const IHTMLElement3Vtbl
*lpHTMLElement3Vtbl
;
410 nsIDOMHTMLElement
*nselem
;
416 const IHTMLTextContainerVtbl
*lpHTMLTextContainerVtbl
;
421 #define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
422 #define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
424 #define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl)
425 #define HTMLDOC3(x) ((IHTMLDocument3*) &(x)->lpHTMLDocument3Vtbl)
426 #define HTMLDOC4(x) ((IHTMLDocument4*) &(x)->lpHTMLDocument4Vtbl)
427 #define HTMLDOC5(x) ((IHTMLDocument5*) &(x)->lpHTMLDocument5Vtbl)
428 #define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
429 #define PERSISTMON(x) ((IPersistMoniker*) &(x)->lpPersistMonikerVtbl)
430 #define PERSISTFILE(x) ((IPersistFile*) &(x)->lpPersistFileVtbl)
431 #define MONPROP(x) ((IMonikerProp*) &(x)->lpMonikerPropVtbl)
432 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
433 #define OLEDOC(x) ((IOleDocument*) &(x)->lpOleDocumentVtbl)
434 #define DOCVIEW(x) ((IOleDocumentView*) &(x)->lpOleDocumentViewVtbl)
435 #define OLEWIN(x) ((IOleWindow*) &(x)->lpOleInPlaceActiveObjectVtbl)
436 #define ACTOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
437 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObject2Vtbl)
438 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObject2Vtbl)
439 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
440 #define INPLACEWIN(x) ((IOleInPlaceObjectWindowless*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
441 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
442 #define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
443 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
444 #define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
445 #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
446 #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
447 #define PERSISTHIST(x) ((IPersistHistory*) &(x)->lpPersistHistoryVtbl)
448 #define CUSTOMDOC(x) ((ICustomDoc*) &(x)->lpCustomDocVtbl)
450 #define NSWBCHROME(x) ((nsIWebBrowserChrome*) &(x)->lpWebBrowserChromeVtbl)
451 #define NSCML(x) ((nsIContextMenuListener*) &(x)->lpContextMenuListenerVtbl)
452 #define NSURICL(x) ((nsIURIContentListener*) &(x)->lpURIContentListenerVtbl)
453 #define NSEMBWNDS(x) ((nsIEmbeddingSiteWindow*) &(x)->lpEmbeddingSiteWindowVtbl)
454 #define NSIFACEREQ(x) ((nsIInterfaceRequestor*) &(x)->lpInterfaceRequestorVtbl)
455 #define NSTOOLTIP(x) ((nsITooltipListener*) &(x)->lpTooltipListenerVtbl)
456 #define NSEVENTLIST(x) ((nsIDOMEventListener*) &(x)->lpDOMEventListenerVtbl)
457 #define NSWEAKREF(x) ((nsIWeakReference*) &(x)->lpWeakReferenceVtbl)
458 #define NSSUPWEAKREF(x) ((nsISupportsWeakReference*) &(x)->lpSupportsWeakReferenceVtbl)
460 #define NSDOCOBS(x) ((nsIDocumentObserver*) &(x)->lpDocumentObserverVtbl)
462 #define NSRUNNABLE(x) ((nsIRunnable*) &(x)->lpRunnableVtbl)
464 #define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
465 #define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
466 #define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl)
468 #define HTTPNEG(x) ((IHttpNegotiate2*) &(x)->lpHttpNegotiate2Vtbl)
469 #define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
470 #define BINDINFO(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl);
472 #define HTMLELEM(x) ((IHTMLElement*) &(x)->lpHTMLElementVtbl)
473 #define HTMLELEM2(x) ((IHTMLElement2*) &(x)->lpHTMLElement2Vtbl)
474 #define HTMLELEM3(x) ((IHTMLElement3*) &(x)->lpHTMLElement3Vtbl)
475 #define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
476 #define HTMLDOMNODE2(x) ((IHTMLDOMNode2*) &(x)->lpHTMLDOMNode2Vtbl)
478 #define HTMLTEXTCONT(x) ((IHTMLTextContainer*) &(x)->lpHTMLTextContainerVtbl)
480 #define HTMLOPTFACTORY(x) ((IHTMLOptionElementFactory*) &(x)->lpHTMLOptionElementFactoryVtbl)
481 #define HTMLLOCATION(x) ((IHTMLLocation*) &(x)->lpHTMLLocationVtbl)
483 #define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
485 #define SUPPERRINFO(x) ((ISupportErrorInfo*) &(x)->lpSupportErrorInfoVtbl)
487 #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
488 #define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
490 HRESULT
HTMLDocument_Create(IUnknown
*,REFIID
,void**);
491 HRESULT
HTMLLoadOptions_Create(IUnknown
*,REFIID
,void**);
492 HRESULT
create_doc_from_nsdoc(nsIDOMHTMLDocument
*,HTMLDocument
**);
494 HRESULT
HTMLWindow_Create(HTMLDocument
*,nsIDOMWindow
*,HTMLWindow
**);
495 HTMLWindow
*nswindow_to_window(const nsIDOMWindow
*);
496 HTMLOptionElementFactory
*HTMLOptionElementFactory_Create(HTMLDocument
*);
497 HTMLLocation
*HTMLLocation_Create(HTMLDocument
*);
498 IOmNavigator
*OmNavigator_Create(void);
500 void HTMLDocument_HTMLDocument3_Init(HTMLDocument
*);
501 void HTMLDocument_HTMLDocument5_Init(HTMLDocument
*);
502 void HTMLDocument_Persist_Init(HTMLDocument
*);
503 void HTMLDocument_OleCmd_Init(HTMLDocument
*);
504 void HTMLDocument_OleObj_Init(HTMLDocument
*);
505 void HTMLDocument_View_Init(HTMLDocument
*);
506 void HTMLDocument_Window_Init(HTMLDocument
*);
507 void HTMLDocument_Service_Init(HTMLDocument
*);
508 void HTMLDocument_Hlink_Init(HTMLDocument
*);
510 HRESULT
HTMLCurrentStyle_Create(HTMLElement
*,IHTMLCurrentStyle
**);
512 void ConnectionPoint_Init(ConnectionPoint
*,ConnectionPointContainer
*,REFIID
);
513 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*);
514 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*);
516 NSContainer
*NSContainer_Create(HTMLDocument
*,NSContainer
*);
517 void NSContainer_Release(NSContainer
*);
519 void init_mutation(NSContainer
*);
520 void set_mutation_observer(NSContainer
*,nsIDOMHTMLDocument
*);
521 void remove_mutation_observer(NSContainer
*,nsIDOMHTMLDocument
*);
523 void HTMLDocument_LockContainer(HTMLDocument
*,BOOL
);
524 void show_context_menu(HTMLDocument
*,DWORD
,POINT
*,IDispatch
*);
525 void notif_focus(HTMLDocument
*);
527 void show_tooltip(HTMLDocument
*,DWORD
,DWORD
,LPCWSTR
);
528 void hide_tooltip(HTMLDocument
*);
529 HRESULT
get_client_disp_property(IOleClientSite
*,DISPID
,VARIANT
*);
531 HRESULT
ProtocolFactory_Create(REFCLSID
,REFIID
,void**);
533 BOOL
load_gecko(BOOL
);
534 void close_gecko(void);
535 void register_nsservice(nsIComponentRegistrar
*,nsIServiceManager
*);
536 void init_nsio(nsIComponentManager
*,nsIComponentRegistrar
*);
537 void release_nsio(void);
538 BOOL
install_wine_gecko(BOOL
);
540 HRESULT
nsuri_to_url(LPCWSTR
,BSTR
*);
542 void hlink_frame_navigate(HTMLDocument
*,IHlinkFrame
*,LPCWSTR
,nsIInputStream
*,DWORD
);
544 void call_property_onchanged(ConnectionPoint
*,DISPID
);
545 HRESULT
call_set_active_object(IOleInPlaceUIWindow
*,IOleInPlaceActiveObject
*);
547 void *nsalloc(size_t) __WINE_ALLOC_SIZE(1);
550 void nsACString_Init(nsACString
*,const char*);
551 void nsACString_SetData(nsACString
*,const char*);
552 PRUint32
nsACString_GetData(const nsACString
*,const char**);
553 void nsACString_Finish(nsACString
*);
555 void nsAString_Init(nsAString
*,const PRUnichar
*);
556 void nsAString_SetData(nsAString
*,const PRUnichar
*);
557 PRUint32
nsAString_GetData(const nsAString
*,const PRUnichar
**);
558 void nsAString_Finish(nsAString
*);
560 nsIInputStream
*create_nsstream(const char*,PRInt32
);
561 nsICommandParams
*create_nscommand_params(void);
562 void nsnode_to_nsstring(nsIDOMNode
*,nsAString
*);
563 void get_editor_controller(NSContainer
*);
564 void init_nsevents(NSContainer
*);
565 void add_nsevent_listener(NSContainer
*,LPCWSTR
);
566 nsresult
get_nsinterface(nsISupports
*,REFIID
,void**);
567 void update_nsdocument(HTMLDocument
*);
569 void set_document_bscallback(HTMLDocument
*,nsChannelBSC
*);
570 void set_current_mon(HTMLDocument
*,IMoniker
*);
571 HRESULT
start_binding(HTMLDocument
*,BSCallback
*,IBindCtx
*);
573 HRESULT
bind_mon_to_buffer(HTMLDocument
*,IMoniker
*,void**,DWORD
*);
575 nsChannelBSC
*create_channelbsc(IMoniker
*);
576 HRESULT
channelbsc_load_stream(nsChannelBSC
*,IStream
*);
577 void channelbsc_set_channel(nsChannelBSC
*,nsChannel
*,nsIStreamListener
*,nsISupports
*);
578 IMoniker
*get_channelbsc_mon(nsChannelBSC
*);
580 IHTMLSelectionObject
*HTMLSelectionObject_Create(HTMLDocument
*,nsISelection
*);
581 IHTMLTxtRange
*HTMLTxtRange_Create(HTMLDocument
*,nsIDOMRange
*);
582 IHTMLStyle
*HTMLStyle_Create(nsIDOMCSSStyleDeclaration
*);
583 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*);
584 IHTMLStyleSheetsCollection
*HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList
*);
586 void detach_selection(HTMLDocument
*);
587 void detach_ranges(HTMLDocument
*);
588 HRESULT
get_node_text(HTMLDOMNode
*,BSTR
*);
590 HTMLDOMNode
*HTMLDOMTextNode_Create(HTMLDocument
*,nsIDOMNode
*);
592 HTMLElement
*HTMLElement_Create(HTMLDocument
*,nsIDOMNode
*,BOOL
);
593 HTMLElement
*HTMLCommentElement_Create(HTMLDocument
*,nsIDOMNode
*);
594 HTMLElement
*HTMLAnchorElement_Create(nsIDOMHTMLElement
*);
595 HTMLElement
*HTMLBodyElement_Create(nsIDOMHTMLElement
*);
596 HTMLElement
*HTMLIFrame_Create(nsIDOMHTMLElement
*);
597 HTMLElement
*HTMLImgElement_Create(nsIDOMHTMLElement
*);
598 HTMLElement
*HTMLInputElement_Create(nsIDOMHTMLElement
*);
599 HTMLElement
*HTMLOptionElement_Create(nsIDOMHTMLElement
*);
600 HTMLElement
*HTMLScriptElement_Create(nsIDOMHTMLElement
*);
601 HTMLElement
*HTMLSelectElement_Create(nsIDOMHTMLElement
*);
602 HTMLElement
*HTMLTable_Create(nsIDOMHTMLElement
*);
603 HTMLElement
*HTMLTableRow_Create(nsIDOMHTMLElement
*);
604 HTMLElement
*HTMLTextAreaElement_Create(nsIDOMHTMLElement
*);
605 HTMLElement
*HTMLGenericElement_Create(nsIDOMHTMLElement
*);
607 void HTMLDOMNode_Init(HTMLDocument
*,HTMLDOMNode
*,nsIDOMNode
*);
608 void HTMLElement_Init(HTMLElement
*);
609 void HTMLElement2_Init(HTMLElement
*);
610 void HTMLElement3_Init(HTMLElement
*);
611 void HTMLTextContainer_Init(HTMLTextContainer
*);
613 HRESULT
HTMLDOMNode_QI(HTMLDOMNode
*,REFIID
,void**);
614 void HTMLDOMNode_destructor(HTMLDOMNode
*);
616 HRESULT
HTMLElement_QI(HTMLDOMNode
*,REFIID
,void**);
617 void HTMLElement_destructor(HTMLDOMNode
*);
619 HTMLDOMNode
*get_node(HTMLDocument
*,nsIDOMNode
*,BOOL
);
620 void release_nodes(HTMLDocument
*);
622 void release_script_hosts(HTMLDocument
*);
623 void connect_scripts(HTMLDocument
*);
624 void doc_insert_script(HTMLDocument
*,nsIDOMHTMLScriptElement
*);
625 IDispatch
*script_parse_event(HTMLDocument
*,LPCWSTR
);
626 void set_script_mode(HTMLDocument
*,SCRIPTMODE
);
628 IHTMLElementCollection
*create_all_collection(HTMLDOMNode
*,BOOL
);
629 IHTMLElementCollection
*create_collection_from_nodelist(HTMLDocument
*,IUnknown
*,nsIDOMNodeList
*);
630 IHTMLElementCollection
*create_collection_from_htmlcol(HTMLDocument
*,IUnknown
*,nsIDOMHTMLCollection
*);
635 HRESULT (*query
)(HTMLDocument
*,OLECMD
*);
636 HRESULT (*exec
)(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
639 extern const cmdtable_t editmode_cmds
[];
641 void do_ns_command(NSContainer
*,const char*,nsICommandParams
*);
644 #define UPDATE_UI 0x0001
645 #define UPDATE_TITLE 0x0002
647 void update_doc(HTMLDocument
*This
, DWORD flags
);
648 void update_title(HTMLDocument
*);
651 void init_editor(HTMLDocument
*);
652 void set_ns_editmode(NSContainer
*);
653 void handle_edit_event(HTMLDocument
*,nsIDOMEvent
*);
654 HRESULT
editor_exec_copy(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
655 HRESULT
editor_exec_cut(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
656 HRESULT
editor_exec_paste(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
657 void handle_edit_load(HTMLDocument
*);
658 HRESULT
editor_is_dirty(HTMLDocument
*);
659 void set_dirty(HTMLDocument
*,VARIANT_BOOL
);
661 extern DWORD mshtml_tls
;
663 typedef struct task_t
{
667 TASK_SETDOWNLOADSTATE
,
673 nsChannelBSC
*bscallback
;
680 task_t
*task_queue_head
;
681 task_t
*task_queue_tail
;
682 struct list timer_list
;
685 thread_data_t
*get_thread_data(BOOL
);
686 HWND
get_thread_hwnd(void);
687 void push_task(task_t
*);
688 void remove_doc_tasks(const HTMLDocument
*);
689 DWORD
set_task_timer(HTMLDocument
*,DWORD
,BOOL
,IDispatch
*);
690 HRESULT
clear_task_timer(HTMLDocument
*,BOOL
,DWORD
);
692 void release_typelib(void);
693 void call_disp_func(HTMLDocument
*,IDispatch
*,IDispatch
*);
695 const char *debugstr_variant(const VARIANT
*);
697 DEFINE_GUID(CLSID_AboutProtocol
, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
698 DEFINE_GUID(CLSID_JSProtocol
, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
699 DEFINE_GUID(CLSID_MailtoProtocol
, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
700 DEFINE_GUID(CLSID_ResProtocol
, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
701 DEFINE_GUID(CLSID_SysimageProtocol
, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
703 DEFINE_GUID(CLSID_CMarkup
,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
705 /* memory allocation functions */
707 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len
)
709 return HeapAlloc(GetProcessHeap(), 0, len
);
712 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len
)
714 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
717 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem
, size_t len
)
719 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
722 static inline BOOL
heap_free(void *mem
)
724 return HeapFree(GetProcessHeap(), 0, mem
);
727 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
734 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
735 ret
= heap_alloc(size
);
736 memcpy(ret
, str
, size
);
742 static inline char *heap_strdupA(const char *str
)
749 size
= strlen(str
)+1;
750 ret
= heap_alloc(size
);
751 memcpy(ret
, str
, size
);
757 static inline WCHAR
*heap_strdupAtoW(const char *str
)
764 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
765 ret
= heap_alloc(len
*sizeof(WCHAR
));
766 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
772 static inline char *heap_strdupWtoA(LPCWSTR str
)
777 DWORD size
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
778 ret
= heap_alloc(size
);
779 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, size
, NULL
, NULL
);
785 HINSTANCE
get_shdoclc(void);
787 extern HINSTANCE hInst
;