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 #ifndef _MSHTML_PRIVATE_H_
20 #define _MSHTML_PRIVATE_H_
22 #include <wine/config.h>
29 #define WIN32_NO_STATUS
33 #define NONAMELESSUNION
34 #define NONAMELESSSTRUCT
41 #include <docobjectservice.h>
49 #include <shdeprecated.h>
51 #define NO_SHLWAPI_REG
58 #include <wine/debug.h>
59 #include <wine/list.h>
60 #include <wine/unicode.h>
62 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
64 #define NS_ERROR_GENERATE_FAILURE(module,code) \
65 ((nsresult) (((UINT32)(1u<<31)) | ((UINT32)(module+0x45)<<16) | ((UINT32)(code))))
67 #define NS_OK ((nsresult)0x00000000L)
68 #define NS_ERROR_FAILURE ((nsresult)0x80004005L)
69 #define NS_ERROR_OUT_OF_MEMORY ((nsresult)0x8007000EL)
70 #define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L)
71 #define NS_NOINTERFACE ((nsresult)0x80004002L)
72 #define NS_ERROR_INVALID_POINTER ((nsresult)0x80004003L)
73 #define NS_ERROR_NULL_POINTER NS_ERROR_INVALID_POINTER
74 #define NS_ERROR_NOT_AVAILABLE ((nsresult)0x80040111L)
75 #define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L)
76 #define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL)
78 #define NS_ERROR_MODULE_NETWORK 6
80 #define NS_BINDING_ABORTED NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 2)
81 #define NS_ERROR_UNKNOWN_PROTOCOL NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 18)
83 #define NS_FAILED(res) ((res) & 0x80000000)
84 #define NS_SUCCEEDED(res) (!NS_FAILED(res))
88 #define MSHTML_E_NODOC 0x800a025c
90 typedef struct HTMLDOMNode HTMLDOMNode
;
91 typedef struct ConnectionPoint ConnectionPoint
;
92 typedef struct BSCallback BSCallback
;
93 typedef struct event_target_t event_target_t
;
97 XDIID(DispCEventObj) \
99 XDIID(DispDOMChildrenCollection) \
100 XDIID(DispHTMLAnchorElement) \
101 XDIID(DispHTMLAreaElement) \
102 XDIID(DispHTMLAttributeCollection) \
103 XDIID(DispHTMLBody) \
104 XDIID(DispHTMLButtonElement) \
105 XDIID(DispHTMLCommentElement) \
106 XDIID(DispHTMLCurrentStyle) \
107 XDIID(DispHTMLDocument) \
108 XDIID(DispHTMLDOMAttribute) \
109 XDIID(DispHTMLDOMTextNode) \
110 XDIID(DispHTMLElementCollection) \
111 XDIID(DispHTMLEmbed) \
112 XDIID(DispHTMLFormElement) \
113 XDIID(DispHTMLGenericElement) \
114 XDIID(DispHTMLFrameElement) \
115 XDIID(DispHTMLHeadElement) \
116 XDIID(DispHTMLHistory) \
117 XDIID(DispHTMLIFrame) \
119 XDIID(DispHTMLInputElement) \
120 XDIID(DispHTMLLabelElement) \
121 XDIID(DispHTMLLinkElement) \
122 XDIID(DispHTMLLocation) \
123 XDIID(DispHTMLMetaElement) \
124 XDIID(DispHTMLNavigator) \
125 XDIID(DispHTMLObjectElement) \
126 XDIID(DispHTMLOptionElement) \
127 XDIID(DispHTMLScreen) \
128 XDIID(DispHTMLScriptElement) \
129 XDIID(DispHTMLSelectElement) \
130 XDIID(DispHTMLStyle) \
131 XDIID(DispHTMLStyleElement) \
132 XDIID(DispHTMLStyleSheet) \
133 XDIID(DispHTMLStyleSheetRulesCollection) \
134 XDIID(DispHTMLStyleSheetsCollection) \
135 XDIID(DispHTMLTable) \
136 XDIID(DispHTMLTableCell) \
137 XDIID(DispHTMLTableRow) \
138 XDIID(DispHTMLTextAreaElement) \
139 XDIID(DispHTMLTitleElement) \
140 XDIID(DispHTMLUnknownElement) \
141 XDIID(DispHTMLWindow2) \
142 XDIID(DispHTMLXMLHttpRequest) \
143 XDIID(HTMLDocumentEvents) \
144 XDIID(HTMLElementEvents2) \
145 XIID(IHTMLAnchorElement) \
146 XIID(IHTMLAreaElement) \
147 XIID(IHTMLAttributeCollection) \
148 XIID(IHTMLAttributeCollection2) \
149 XIID(IHTMLAttributeCollection3) \
150 XIID(IHTMLBodyElement) \
151 XIID(IHTMLBodyElement2) \
152 XIID(IHTMLButtonElement) \
153 XIID(IHTMLCommentElement) \
154 XIID(IHTMLCurrentStyle) \
155 XIID(IHTMLCurrentStyle2) \
156 XIID(IHTMLCurrentStyle3) \
157 XIID(IHTMLCurrentStyle4) \
158 XIID(IHTMLDocument2) \
159 XIID(IHTMLDocument3) \
160 XIID(IHTMLDocument4) \
161 XIID(IHTMLDocument5) \
162 XIID(IHTMLDOMAttribute) \
163 XIID(IHTMLDOMAttribute2) \
164 XIID(IHTMLDOMChildrenCollection) \
165 XIID(IHTMLDOMImplementation) \
167 XIID(IHTMLDOMNode2) \
168 XIID(IHTMLDOMTextNode) \
169 XIID(IHTMLDOMTextNode2) \
171 XIID(IHTMLElement2) \
172 XIID(IHTMLElement3) \
173 XIID(IHTMLElement4) \
174 XIID(IHTMLElementCollection) \
175 XIID(IHTMLEmbedElement) \
176 XIID(IHTMLEventObj) \
177 XIID(IHTMLFiltersCollection) \
178 XIID(IHTMLFormElement) \
179 XIID(IHTMLFrameBase) \
180 XIID(IHTMLFrameBase2) \
181 XIID(IHTMLFrameElement3) \
182 XIID(IHTMLGenericElement) \
183 XIID(IHTMLHeadElement) \
184 XIID(IHTMLIFrameElement) \
185 XIID(IHTMLIFrameElement2) \
186 XIID(IHTMLIFrameElement3) \
187 XIID(IHTMLImageElementFactory) \
188 XIID(IHTMLImgElement) \
189 XIID(IHTMLInputElement) \
190 XIID(IHTMLLabelElement) \
191 XIID(IHTMLLinkElement) \
192 XIID(IHTMLLocation) \
193 XIID(IHTMLMetaElement) \
194 XIID(IHTMLMimeTypesCollection) \
195 XIID(IHTMLObjectElement) \
196 XIID(IHTMLObjectElement2) \
197 XIID(IHTMLOptionElement) \
198 XIID(IHTMLOptionElementFactory) \
199 XIID(IHTMLPluginsCollection) \
202 XIID(IHTMLScriptElement) \
203 XIID(IHTMLSelectElement) \
204 XIID(IHTMLSelectionObject) \
205 XIID(IHTMLSelectionObject2) \
213 XIID(IHTMLStyleElement) \
214 XIID(IHTMLStyleSheet) \
215 XIID(IHTMLStyleSheetRulesCollection) \
216 XIID(IHTMLStyleSheetsCollection) \
220 XIID(IHTMLTableCell) \
221 XIID(IHTMLTableRow) \
222 XIID(IHTMLTextAreaElement) \
223 XIID(IHTMLTextContainer) \
224 XIID(IHTMLTitleElement) \
225 XIID(IHTMLTxtRange) \
226 XIID(IHTMLUniqueName) \
232 XIID(IHTMLXMLHttpRequest) \
233 XIID(IHTMLXMLHttpRequestFactory) \
238 #define XIID(iface) iface ## _tid,
239 #define XDIID(iface) iface ## _tid,
246 typedef struct dispex_data_t dispex_data_t
;
247 typedef struct dispex_dynamic_data_t dispex_dynamic_data_t
;
249 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
250 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
251 #define MSHTML_CUSTOM_DISPID_CNT (MSHTML_DISPID_CUSTOM_MAX-MSHTML_DISPID_CUSTOM_MIN)
253 typedef struct DispatchEx DispatchEx
;
256 HRESULT (*value
)(DispatchEx
*,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
257 HRESULT (*get_dispid
)(DispatchEx
*,BSTR
,DWORD
,DISPID
*);
258 HRESULT (*invoke
)(DispatchEx
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
259 HRESULT (*populate_props
)(DispatchEx
*);
260 /* We abuse this vtbl for EventTarget functions to avoid separated vtbl. */
261 event_target_t
**(*get_event_target_ptr
)(DispatchEx
*);
262 void (*bind_event
)(DispatchEx
*,int);
263 } dispex_static_data_vtbl_t
;
266 const dispex_static_data_vtbl_t
*vtbl
;
267 const tid_t disp_tid
;
269 const tid_t
* const iface_tids
;
270 } dispex_static_data_t
;
273 IDispatchEx IDispatchEx_iface
;
277 dispex_static_data_t
*data
;
278 dispex_dynamic_data_t
*dynamic_data
;
283 } nsCycleCollectingAutoRefCnt
;
289 } ExternalCycleCollectionParticipant
;
291 typedef struct nsCycleCollectionTraversalCallback nsCycleCollectionTraversalCallback
;
294 nsresult (NSAPI
*traverse
)(void*,void*,nsCycleCollectionTraversalCallback
*);
295 nsresult (NSAPI
*unlink
)(void*);
296 void (NSAPI
*delete_cycle_collectable
)(void*);
299 DEFINE_GUID(IID_nsXPCOMCycleCollectionParticipant
, 0x9674489b,0x1f6f,0x4550,0xa7,0x30, 0xcc,0xae,0xdd,0x10,0x4c,0xf9);
301 nsrefcnt (__cdecl
*ccref_incr
)(nsCycleCollectingAutoRefCnt
*,nsISupports
*) DECLSPEC_HIDDEN
;
302 nsrefcnt (__cdecl
*ccref_decr
)(nsCycleCollectingAutoRefCnt
*,nsISupports
*,ExternalCycleCollectionParticipant
*) DECLSPEC_HIDDEN
;
303 void (__cdecl
*ccref_init
)(nsCycleCollectingAutoRefCnt
*,nsrefcnt
) DECLSPEC_HIDDEN
;
304 void (__cdecl
*ccp_init
)(ExternalCycleCollectionParticipant
*,const CCObjCallback
*) DECLSPEC_HIDDEN
;
305 void (__cdecl
*describe_cc_node
)(nsCycleCollectingAutoRefCnt
*,const char*,nsCycleCollectionTraversalCallback
*) DECLSPEC_HIDDEN
;
306 void (__cdecl
*note_cc_edge
)(nsISupports
*,const char*,nsCycleCollectionTraversalCallback
*) DECLSPEC_HIDDEN
;
308 void init_dispex(DispatchEx
*,IUnknown
*,dispex_static_data_t
*) DECLSPEC_HIDDEN
;
309 void release_dispex(DispatchEx
*) DECLSPEC_HIDDEN
;
310 BOOL
dispex_query_interface(DispatchEx
*,REFIID
,void**) DECLSPEC_HIDDEN
;
311 HRESULT
dispex_get_dprop_ref(DispatchEx
*,const WCHAR
*,BOOL
,VARIANT
**) DECLSPEC_HIDDEN
;
312 HRESULT
get_dispids(tid_t
,DWORD
*,DISPID
**) DECLSPEC_HIDDEN
;
313 HRESULT
remove_attribute(DispatchEx
*,DISPID
,VARIANT_BOOL
*) DECLSPEC_HIDDEN
;
314 HRESULT
dispex_get_dynid(DispatchEx
*,const WCHAR
*,DISPID
*) DECLSPEC_HIDDEN
;
315 void dispex_traverse(DispatchEx
*,nsCycleCollectionTraversalCallback
*) DECLSPEC_HIDDEN
;
316 void dispex_unlink(DispatchEx
*) DECLSPEC_HIDDEN
;
317 void release_typelib(void) DECLSPEC_HIDDEN
;
318 HRESULT
get_htmldoc_classinfo(ITypeInfo
**typeinfo
) DECLSPEC_HIDDEN
;
324 } dispex_prop_type_t
;
326 dispex_prop_type_t
get_dispid_type(DISPID
) DECLSPEC_HIDDEN
;
328 typedef struct HTMLWindow HTMLWindow
;
329 typedef struct HTMLInnerWindow HTMLInnerWindow
;
330 typedef struct HTMLOuterWindow HTMLOuterWindow
;
331 typedef struct HTMLDocumentNode HTMLDocumentNode
;
332 typedef struct HTMLDocumentObj HTMLDocumentObj
;
333 typedef struct HTMLFrameBase HTMLFrameBase
;
334 typedef struct NSContainer NSContainer
;
335 typedef struct HTMLAttributeCollection HTMLAttributeCollection
;
339 SCRIPTMODE_ACTIVESCRIPT
342 typedef struct ScriptHost ScriptHost
;
349 } global_prop_type_t
;
352 global_prop_type_t type
;
354 ScriptHost
*script_host
;
365 IHTMLOptionElementFactory IHTMLOptionElementFactory_iface
;
369 HTMLInnerWindow
*window
;
370 } HTMLOptionElementFactory
;
374 IHTMLImageElementFactory IHTMLImageElementFactory_iface
;
378 HTMLInnerWindow
*window
;
379 } HTMLImageElementFactory
;
383 IHTMLXMLHttpRequestFactory IHTMLXMLHttpRequestFactory_iface
;
387 HTMLInnerWindow
*window
;
388 } HTMLXMLHttpRequestFactory
;
390 struct HTMLLocation
{
392 IHTMLLocation IHTMLLocation_iface
;
396 HTMLInnerWindow
*window
;
401 IOmHistory IOmHistory_iface
;
405 HTMLInnerWindow
*window
;
409 HTMLOuterWindow
*window
;
413 typedef struct nsChannelBSC nsChannelBSC
;
416 IHTMLWindow2 IHTMLWindow2_iface
;
417 IHTMLWindow3 IHTMLWindow3_iface
;
418 IHTMLWindow4 IHTMLWindow4_iface
;
419 IHTMLWindow5 IHTMLWindow5_iface
;
420 IHTMLWindow6 IHTMLWindow6_iface
;
421 IHTMLPrivateWindow IHTMLPrivateWindow_iface
;
422 IDispatchEx IDispatchEx_iface
;
423 IServiceProvider IServiceProvider_iface
;
424 ITravelLogClient ITravelLogClient_iface
;
425 IObjectIdentity IObjectIdentity_iface
;
429 HTMLInnerWindow
*inner_window
;
430 HTMLOuterWindow
*outer_window
;
433 struct HTMLOuterWindow
{
436 windowref_t
*window_ref
;
439 HTMLDocumentObj
*doc_obj
;
440 nsIDOMWindow
*nswindow
;
441 HTMLOuterWindow
*parent
;
442 HTMLFrameBase
*frame_element
;
444 READYSTATE readystate
;
445 BOOL readystate_locked
;
446 unsigned readystate_pending
;
448 HTMLInnerWindow
*pending_window
;
455 SCRIPTMODE scriptmode
;
457 IInternetSecurityManager
*secmgr
;
459 struct list children
;
460 struct list sibling_entry
;
464 struct HTMLInnerWindow
{
466 EventTarget event_target
;
468 HTMLDocumentNode
*doc
;
470 struct list script_hosts
;
472 IHTMLEventObj
*event
;
474 HTMLImageElementFactory
*image_factory
;
475 HTMLOptionElementFactory
*option_factory
;
476 HTMLXMLHttpRequestFactory
*xhr_factory
;
479 IHTMLStorage
*session_storage
;
481 unsigned parser_callback_cnt
;
482 struct list script_queue
;
484 global_prop_t
*global_props
;
485 DWORD global_prop_cnt
;
486 DWORD global_prop_size
;
490 HTMLLocation
*location
;
493 nsChannelBSC
*bscallback
;
494 struct list bindings
;
503 typedef struct _cp_static_data_t
{
505 void (*on_advise
)(IUnknown
*,struct _cp_static_data_t
*);
513 cp_static_data_t
*desc
;
516 typedef struct ConnectionPointContainer
{
517 IConnectionPointContainer IConnectionPointContainer_iface
;
519 ConnectionPoint
*cps
;
520 const cpc_entry_t
*cp_entries
;
522 struct ConnectionPointContainer
*forward_container
;
523 } ConnectionPointContainer
;
525 struct ConnectionPoint
{
526 IConnectionPoint IConnectionPoint_iface
;
528 ConnectionPointContainer
*container
;
533 IPropertyNotifySink
*propnotif
;
538 cp_static_data_t
*data
;
541 struct HTMLDocument
{
542 IHTMLDocument2 IHTMLDocument2_iface
;
543 IHTMLDocument3 IHTMLDocument3_iface
;
544 IHTMLDocument4 IHTMLDocument4_iface
;
545 IHTMLDocument5 IHTMLDocument5_iface
;
546 IHTMLDocument6 IHTMLDocument6_iface
;
547 IHTMLDocument7 IHTMLDocument7_iface
;
548 IPersistMoniker IPersistMoniker_iface
;
549 IPersistFile IPersistFile_iface
;
550 IPersistHistory IPersistHistory_iface
;
551 IMonikerProp IMonikerProp_iface
;
552 IOleObject IOleObject_iface
;
553 IOleDocument IOleDocument_iface
;
554 IOleDocumentView IOleDocumentView_iface
;
555 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface
;
556 IViewObjectEx IViewObjectEx_iface
;
557 IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface
;
558 IServiceProvider IServiceProvider_iface
;
559 IOleCommandTarget IOleCommandTarget_iface
;
560 IOleControl IOleControl_iface
;
561 IHlinkTarget IHlinkTarget_iface
;
562 IPersistStreamInit IPersistStreamInit_iface
;
563 IDispatchEx IDispatchEx_iface
;
564 ISupportErrorInfo ISupportErrorInfo_iface
;
565 IObjectWithSite IObjectWithSite_iface
;
566 IOleContainer IOleContainer_iface
;
567 IObjectSafety IObjectSafety_iface
;
568 IProvideClassInfo IProvideClassInfo_iface
;
573 HTMLDocumentObj
*doc_obj
;
574 HTMLDocumentNode
*doc_node
;
576 HTMLOuterWindow
*window
;
580 ConnectionPointContainer cp_container
;
581 IOleAdviseHolder
*advise_holder
;
584 static inline HRESULT
htmldoc_query_interface(HTMLDocument
*This
, REFIID riid
, void **ppv
)
586 return IUnknown_QueryInterface(This
->unk_impl
, riid
, ppv
);
589 static inline ULONG
htmldoc_addref(HTMLDocument
*This
)
591 return IUnknown_AddRef(This
->unk_impl
);
594 static inline ULONG
htmldoc_release(HTMLDocument
*This
)
596 return IUnknown_Release(This
->unk_impl
);
599 struct HTMLDocumentObj
{
600 HTMLDocument basedoc
;
602 ICustomDoc ICustomDoc_iface
;
603 ITargetContainer ITargetContainer_iface
;
605 IWindowForBindingUI IWindowForBindingUI_iface
;
609 NSContainer
*nscontainer
;
611 IOleClientSite
*client
;
612 IDocHostUIHandler
*hostui
;
613 IOleCommandTarget
*client_cmdtrg
;
615 IOleInPlaceSite
*ipsite
;
616 IOleInPlaceFrame
*frame
;
617 IOleInPlaceUIWindow
*ip_window
;
618 IAdviseSink
*view_sink
;
619 IDocObjectService
*doc_object_service
;
620 IUnknown
*webbrowser
;
621 ITravelLog
*travel_log
;
622 IUnknown
*browser_service
;
624 DOCHOSTUIINFO hostinfo
;
626 IOleUndoManager
*undomgr
;
627 IHTMLEditServices
*editsvcs
;
632 BOOL request_uiactivate
;
633 BOOL in_place_active
;
637 BOOL container_locked
;
648 typedef struct nsWeakReference nsWeakReference
;
651 nsIWebBrowserChrome nsIWebBrowserChrome_iface
;
652 nsIContextMenuListener nsIContextMenuListener_iface
;
653 nsIURIContentListener nsIURIContentListener_iface
;
654 nsIEmbeddingSiteWindow nsIEmbeddingSiteWindow_iface
;
655 nsITooltipListener nsITooltipListener_iface
;
656 nsIInterfaceRequestor nsIInterfaceRequestor_iface
;
657 nsISupportsWeakReference nsISupportsWeakReference_iface
;
659 nsIWebBrowser
*webbrowser
;
660 nsIWebNavigation
*navigation
;
661 nsIBaseWindow
*window
;
662 nsIWebBrowserFocus
*focus
;
665 nsIController
*editor_controller
;
669 nsWeakReference
*weak_reference
;
672 HTMLDocumentObj
*doc
;
674 nsIURIContentListener
*content_listener
;
680 HRESULT (*qi
)(HTMLDOMNode
*,REFIID
,void**);
681 void (*destructor
)(HTMLDOMNode
*);
682 const cpc_entry_t
*cpc_entries
;
683 HRESULT (*clone
)(HTMLDOMNode
*,nsIDOMNode
*,HTMLDOMNode
**);
684 HRESULT (*handle_event
)(HTMLDOMNode
*,DWORD
,nsIDOMEvent
*,BOOL
*);
685 HRESULT (*get_attr_col
)(HTMLDOMNode
*,HTMLAttributeCollection
**);
686 event_target_t
**(*get_event_target_ptr
)(HTMLDOMNode
*);
687 HRESULT (*fire_event
)(HTMLDOMNode
*,DWORD
,BOOL
*);
688 HRESULT (*put_disabled
)(HTMLDOMNode
*,VARIANT_BOOL
);
689 HRESULT (*get_disabled
)(HTMLDOMNode
*,VARIANT_BOOL
*);
690 HRESULT (*get_document
)(HTMLDOMNode
*,IDispatch
**);
691 HRESULT (*get_readystate
)(HTMLDOMNode
*,BSTR
*);
692 HRESULT (*get_dispid
)(HTMLDOMNode
*,BSTR
,DWORD
,DISPID
*);
693 HRESULT (*invoke
)(HTMLDOMNode
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
694 HRESULT (*bind_to_tree
)(HTMLDOMNode
*);
695 void (*traverse
)(HTMLDOMNode
*,nsCycleCollectionTraversalCallback
*);
696 void (*unlink
)(HTMLDOMNode
*);
697 BOOL (*is_text_edit
)(HTMLDOMNode
*);
701 EventTarget event_target
;
702 IHTMLDOMNode IHTMLDOMNode_iface
;
703 IHTMLDOMNode2 IHTMLDOMNode2_iface
;
704 const NodeImplVtbl
*vtbl
;
706 nsCycleCollectingAutoRefCnt ccref
;
709 HTMLDocumentNode
*doc
;
710 ConnectionPointContainer
*cp_container
;
713 static inline void node_addref(HTMLDOMNode
*node
)
715 IHTMLDOMNode_AddRef(&node
->IHTMLDOMNode_iface
);
718 static inline void node_release(HTMLDOMNode
*node
)
720 IHTMLDOMNode_Release(&node
->IHTMLDOMNode_iface
);
725 ConnectionPointContainer cp_container
;
727 IHTMLElement IHTMLElement_iface
;
728 IHTMLElement2 IHTMLElement2_iface
;
729 IHTMLElement3 IHTMLElement3_iface
;
730 IHTMLElement4 IHTMLElement4_iface
;
732 nsIDOMHTMLElement
*nselem
;
734 HTMLStyle
*runtime_style
;
735 HTMLAttributeCollection
*attrs
;
739 #define HTMLELEMENT_TIDS \
747 extern cp_static_data_t HTMLElementEvents2_data DECLSPEC_HIDDEN
;
748 #define HTMLELEMENT_CPC {&DIID_HTMLElementEvents2, &HTMLElementEvents2_data}
749 extern const cpc_entry_t HTMLElement_cpc
[] DECLSPEC_HIDDEN
;
754 IHTMLTextContainer IHTMLTextContainer_iface
;
757 struct HTMLFrameBase
{
760 IHTMLFrameBase IHTMLFrameBase_iface
;
761 IHTMLFrameBase2 IHTMLFrameBase2_iface
;
763 HTMLOuterWindow
*content_window
;
765 nsIDOMHTMLFrameElement
*nsframe
;
766 nsIDOMHTMLIFrameElement
*nsiframe
;
769 typedef struct nsDocumentEventListener nsDocumentEventListener
;
771 struct HTMLDocumentNode
{
773 HTMLDocument basedoc
;
775 IInternetHostSecurityManager IInternetHostSecurityManager_iface
;
777 nsIDocumentObserver nsIDocumentObserver_iface
;
781 HTMLInnerWindow
*window
;
783 nsIDOMHTMLDocument
*nsdoc
;
785 event_target_t
*body_event_target
;
787 IHTMLDOMImplementation
*dom_implementation
;
789 ICatInformation
*catmgr
;
790 nsDocumentEventListener
*nsevent_listener
;
794 unsigned elem_vars_size
;
795 unsigned elem_vars_cnt
;
797 BOOL skip_mutation_notif
;
801 struct list selection_list
;
802 struct list range_list
;
803 struct list plugin_hosts
;
806 HRESULT
HTMLDocument_Create(IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
807 HRESULT
HTMLLoadOptions_Create(IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
808 HRESULT
create_doc_from_nsdoc(nsIDOMHTMLDocument
*,HTMLDocumentObj
*,HTMLInnerWindow
*,HTMLDocumentNode
**) DECLSPEC_HIDDEN
;
810 HRESULT
HTMLOuterWindow_Create(HTMLDocumentObj
*,nsIDOMWindow
*,HTMLOuterWindow
*,HTMLOuterWindow
**) DECLSPEC_HIDDEN
;
811 HRESULT
update_window_doc(HTMLInnerWindow
*) DECLSPEC_HIDDEN
;
812 HTMLOuterWindow
*nswindow_to_window(const nsIDOMWindow
*) DECLSPEC_HIDDEN
;
813 void get_top_window(HTMLOuterWindow
*,HTMLOuterWindow
**) DECLSPEC_HIDDEN
;
814 HRESULT
HTMLOptionElementFactory_Create(HTMLInnerWindow
*,HTMLOptionElementFactory
**) DECLSPEC_HIDDEN
;
815 HRESULT
HTMLImageElementFactory_Create(HTMLInnerWindow
*,HTMLImageElementFactory
**) DECLSPEC_HIDDEN
;
816 HRESULT
HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow
*,HTMLXMLHttpRequestFactory
**) DECLSPEC_HIDDEN
;
817 HRESULT
HTMLLocation_Create(HTMLInnerWindow
*,HTMLLocation
**) DECLSPEC_HIDDEN
;
818 IOmNavigator
*OmNavigator_Create(void) DECLSPEC_HIDDEN
;
819 HRESULT
HTMLScreen_Create(IHTMLScreen
**) DECLSPEC_HIDDEN
;
820 HRESULT
create_history(HTMLInnerWindow
*,OmHistory
**) DECLSPEC_HIDDEN
;
821 HRESULT
create_dom_implementation(IHTMLDOMImplementation
**) DECLSPEC_HIDDEN
;
823 HRESULT
create_storage(IHTMLStorage
**) DECLSPEC_HIDDEN
;
825 void HTMLDocument_Persist_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
826 void HTMLDocument_OleCmd_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
827 void HTMLDocument_OleObj_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
828 void HTMLDocument_View_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
829 void HTMLDocument_Window_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
830 void HTMLDocument_Service_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
831 void HTMLDocument_Hlink_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
833 void TargetContainer_Init(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
834 void init_binding_ui(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
836 void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
838 HRESULT
HTMLCurrentStyle_Create(HTMLElement
*,IHTMLCurrentStyle
**) DECLSPEC_HIDDEN
;
840 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*,const cpc_entry_t
*) DECLSPEC_HIDDEN
;
841 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*) DECLSPEC_HIDDEN
;
843 HRESULT
create_nscontainer(HTMLDocumentObj
*,NSContainer
**) DECLSPEC_HIDDEN
;
844 void NSContainer_Release(NSContainer
*) DECLSPEC_HIDDEN
;
846 void init_mutation(nsIComponentManager
*) DECLSPEC_HIDDEN
;
847 void init_document_mutation(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
848 void release_document_mutation(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
849 JSContext
*get_context_from_document(nsIDOMHTMLDocument
*) DECLSPEC_HIDDEN
;
851 void HTMLDocument_LockContainer(HTMLDocumentObj
*,BOOL
) DECLSPEC_HIDDEN
;
852 void show_context_menu(HTMLDocumentObj
*,DWORD
,POINT
*,IDispatch
*) DECLSPEC_HIDDEN
;
853 void notif_focus(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
855 void show_tooltip(HTMLDocumentObj
*,DWORD
,DWORD
,LPCWSTR
) DECLSPEC_HIDDEN
;
856 void hide_tooltip(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
857 HRESULT
get_client_disp_property(IOleClientSite
*,DISPID
,VARIANT
*) DECLSPEC_HIDDEN
;
859 UINT
get_document_charset(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
861 HRESULT
ProtocolFactory_Create(REFCLSID
,REFIID
,void**) DECLSPEC_HIDDEN
;
863 BOOL
load_gecko(void) DECLSPEC_HIDDEN
;
864 void close_gecko(void) DECLSPEC_HIDDEN
;
865 void register_nsservice(nsIComponentRegistrar
*,nsIServiceManager
*) DECLSPEC_HIDDEN
;
866 void init_nsio(nsIComponentManager
*,nsIComponentRegistrar
*) DECLSPEC_HIDDEN
;
867 void release_nsio(void) DECLSPEC_HIDDEN
;
868 BOOL
is_gecko_path(const char*) DECLSPEC_HIDDEN
;
869 void set_viewer_zoom(NSContainer
*,float) DECLSPEC_HIDDEN
;
871 void init_node_cc(void) DECLSPEC_HIDDEN
;
873 HRESULT
nsuri_to_url(LPCWSTR
,BOOL
,BSTR
*) DECLSPEC_HIDDEN
;
875 HRESULT
set_frame_doc(HTMLFrameBase
*,nsIDOMDocument
*) DECLSPEC_HIDDEN
;
877 void call_property_onchanged(ConnectionPointContainer
*,DISPID
) DECLSPEC_HIDDEN
;
878 HRESULT
call_set_active_object(IOleInPlaceUIWindow
*,IOleInPlaceActiveObject
*) DECLSPEC_HIDDEN
;
880 void *nsalloc(size_t) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN
;
881 void nsfree(void*) DECLSPEC_HIDDEN
;
883 BOOL
nsACString_Init(nsACString
*str
, const char *data
) DECLSPEC_HIDDEN
;
884 void nsACString_InitDepend(nsACString
*,const char*) DECLSPEC_HIDDEN
;
885 void nsACString_SetData(nsACString
*,const char*) DECLSPEC_HIDDEN
;
886 UINT32
nsACString_GetData(const nsACString
*,const char**) DECLSPEC_HIDDEN
;
887 void nsACString_Finish(nsACString
*) DECLSPEC_HIDDEN
;
889 BOOL
nsAString_Init(nsAString
*,const PRUnichar
*) DECLSPEC_HIDDEN
;
890 void nsAString_InitDepend(nsAString
*,const PRUnichar
*) DECLSPEC_HIDDEN
;
891 UINT32
nsAString_GetData(const nsAString
*,const PRUnichar
**) DECLSPEC_HIDDEN
;
892 void nsAString_Finish(nsAString
*) DECLSPEC_HIDDEN
;
894 HRESULT
return_nsstr(nsresult
,nsAString
*,BSTR
*) DECLSPEC_HIDDEN
;
896 static inline HRESULT
return_nsstr_variant(nsresult nsres
, nsAString
*nsstr
, VARIANT
*p
)
899 return return_nsstr(nsres
, nsstr
, &V_BSTR(p
));
902 nsICommandParams
*create_nscommand_params(void) DECLSPEC_HIDDEN
;
903 HRESULT
nsnode_to_nsstring(nsIDOMNode
*,nsAString
*) DECLSPEC_HIDDEN
;
904 void get_editor_controller(NSContainer
*) DECLSPEC_HIDDEN
;
905 nsresult
get_nsinterface(nsISupports
*,REFIID
,void**) DECLSPEC_HIDDEN
;
906 nsIWritableVariant
*create_nsvariant(void) DECLSPEC_HIDDEN
;
907 nsIXMLHttpRequest
*create_nsxhr(nsIDOMWindow
*nswindow
) DECLSPEC_HIDDEN
;
908 nsresult
create_nsfile(const PRUnichar
*,nsIFile
**) DECLSPEC_HIDDEN
;
909 char *get_nscategory_entry(const char*,const char*) DECLSPEC_HIDDEN
;
911 HRESULT
create_pending_window(HTMLOuterWindow
*,nsChannelBSC
*) DECLSPEC_HIDDEN
;
912 HRESULT
start_binding(HTMLInnerWindow
*,BSCallback
*,IBindCtx
*) DECLSPEC_HIDDEN
;
913 HRESULT
async_start_doc_binding(HTMLOuterWindow
*,HTMLInnerWindow
*) DECLSPEC_HIDDEN
;
914 void abort_window_bindings(HTMLInnerWindow
*) DECLSPEC_HIDDEN
;
915 void set_download_state(HTMLDocumentObj
*,int) DECLSPEC_HIDDEN
;
916 void call_docview_84(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
918 void set_ready_state(HTMLOuterWindow
*,READYSTATE
) DECLSPEC_HIDDEN
;
919 HRESULT
get_readystate_string(READYSTATE
,BSTR
*) DECLSPEC_HIDDEN
;
921 HRESULT
HTMLSelectionObject_Create(HTMLDocumentNode
*,nsISelection
*,IHTMLSelectionObject
**) DECLSPEC_HIDDEN
;
922 HRESULT
HTMLTxtRange_Create(HTMLDocumentNode
*,nsIDOMRange
*,IHTMLTxtRange
**) DECLSPEC_HIDDEN
;
923 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*) DECLSPEC_HIDDEN
;
924 IHTMLStyleSheetsCollection
*HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList
*) DECLSPEC_HIDDEN
;
926 void detach_selection(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
927 void detach_ranges(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
928 HRESULT
get_node_text(HTMLDOMNode
*,BSTR
*) DECLSPEC_HIDDEN
;
929 HRESULT
replace_node_by_html(nsIDOMHTMLDocument
*,nsIDOMNode
*,const WCHAR
*) DECLSPEC_HIDDEN
;
931 HRESULT
create_nselem(HTMLDocumentNode
*,const WCHAR
*,nsIDOMHTMLElement
**) DECLSPEC_HIDDEN
;
932 HRESULT
create_element(HTMLDocumentNode
*,const WCHAR
*,HTMLElement
**) DECLSPEC_HIDDEN
;
934 HRESULT
HTMLDOMTextNode_Create(HTMLDocumentNode
*,nsIDOMNode
*,HTMLDOMNode
**) DECLSPEC_HIDDEN
;
936 BOOL
variant_to_nscolor(const VARIANT
*v
, nsAString
*nsstr
) DECLSPEC_HIDDEN
;
937 HRESULT
nscolor_to_str(LPCWSTR color
, BSTR
*ret
) DECLSPEC_HIDDEN
;
940 struct HTMLAttributeCollection
{
942 IHTMLAttributeCollection IHTMLAttributeCollection_iface
;
943 IHTMLAttributeCollection2 IHTMLAttributeCollection2_iface
;
944 IHTMLAttributeCollection3 IHTMLAttributeCollection3_iface
;
954 IHTMLDOMAttribute IHTMLDOMAttribute_iface
;
955 IHTMLDOMAttribute2 IHTMLDOMAttribute2_iface
;
966 HRESULT
HTMLDOMAttribute_Create(const WCHAR
*,HTMLElement
*,DISPID
,HTMLDOMAttribute
**) DECLSPEC_HIDDEN
;
968 HRESULT
HTMLElement_Create(HTMLDocumentNode
*,nsIDOMNode
*,BOOL
,HTMLElement
**) DECLSPEC_HIDDEN
;
969 HRESULT
HTMLCommentElement_Create(HTMLDocumentNode
*,nsIDOMNode
*,HTMLElement
**) DECLSPEC_HIDDEN
;
970 HRESULT
HTMLAnchorElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
971 HRESULT
HTMLAreaElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
972 HRESULT
HTMLBodyElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
973 HRESULT
HTMLButtonElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
974 HRESULT
HTMLEmbedElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
975 HRESULT
HTMLFormElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
976 HRESULT
HTMLFrameElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
977 HRESULT
HTMLHeadElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
978 HRESULT
HTMLIFrame_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
979 HRESULT
HTMLStyleElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
980 HRESULT
HTMLImgElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
981 HRESULT
HTMLInputElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
982 HRESULT
HTMLLabelElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
983 HRESULT
HTMLLinkElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
984 HRESULT
HTMLMetaElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
985 HRESULT
HTMLObjectElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
986 HRESULT
HTMLOptionElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
987 HRESULT
HTMLScriptElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
988 HRESULT
HTMLSelectElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
989 HRESULT
HTMLTable_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
990 HRESULT
HTMLTableCell_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
991 HRESULT
HTMLTableRow_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
992 HRESULT
HTMLTextAreaElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
993 HRESULT
HTMLTitleElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
994 HRESULT
HTMLGenericElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
996 void HTMLDOMNode_Init(HTMLDocumentNode
*,HTMLDOMNode
*,nsIDOMNode
*) DECLSPEC_HIDDEN
;
997 void HTMLElement_Init(HTMLElement
*,HTMLDocumentNode
*,nsIDOMHTMLElement
*,dispex_static_data_t
*) DECLSPEC_HIDDEN
;
998 void HTMLTextContainer_Init(HTMLTextContainer
*,HTMLDocumentNode
*,nsIDOMHTMLElement
*,dispex_static_data_t
*) DECLSPEC_HIDDEN
;
999 void HTMLFrameBase_Init(HTMLFrameBase
*,HTMLDocumentNode
*,nsIDOMHTMLElement
*,dispex_static_data_t
*) DECLSPEC_HIDDEN
;
1001 HRESULT
HTMLDOMNode_QI(HTMLDOMNode
*,REFIID
,void**) DECLSPEC_HIDDEN
;
1002 void HTMLDOMNode_destructor(HTMLDOMNode
*) DECLSPEC_HIDDEN
;
1004 HRESULT
HTMLElement_QI(HTMLDOMNode
*,REFIID
,void**) DECLSPEC_HIDDEN
;
1005 void HTMLElement_destructor(HTMLDOMNode
*) DECLSPEC_HIDDEN
;
1006 HRESULT
HTMLElement_clone(HTMLDOMNode
*,nsIDOMNode
*,HTMLDOMNode
**) DECLSPEC_HIDDEN
;
1007 HRESULT
HTMLElement_get_attr_col(HTMLDOMNode
*,HTMLAttributeCollection
**) DECLSPEC_HIDDEN
;
1008 HRESULT
HTMLElement_handle_event(HTMLDOMNode
*,DWORD
,nsIDOMEvent
*,BOOL
*) DECLSPEC_HIDDEN
;
1010 HRESULT
HTMLFrameBase_QI(HTMLFrameBase
*,REFIID
,void**) DECLSPEC_HIDDEN
;
1011 void HTMLFrameBase_destructor(HTMLFrameBase
*) DECLSPEC_HIDDEN
;
1013 HRESULT
get_node(HTMLDocumentNode
*,nsIDOMNode
*,BOOL
,HTMLDOMNode
**) DECLSPEC_HIDDEN
;
1014 HRESULT
get_elem(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1016 HTMLElement
*unsafe_impl_from_IHTMLElement(IHTMLElement
*) DECLSPEC_HIDDEN
;
1018 HRESULT
search_window_props(HTMLInnerWindow
*,BSTR
,DWORD
,DISPID
*) DECLSPEC_HIDDEN
;
1019 HRESULT
get_frame_by_name(HTMLOuterWindow
*,const WCHAR
*,BOOL
,HTMLOuterWindow
**) DECLSPEC_HIDDEN
;
1020 HRESULT
get_doc_elem_by_id(HTMLDocumentNode
*,const WCHAR
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1021 HTMLOuterWindow
*get_target_window(HTMLOuterWindow
*,nsAString
*,BOOL
*) DECLSPEC_HIDDEN
;
1022 HRESULT
handle_link_click_event(HTMLElement
*,nsAString
*,nsAString
*,nsIDOMEvent
*,BOOL
*) DECLSPEC_HIDDEN
;
1024 HRESULT
wrap_iface(IUnknown
*,IUnknown
*,IUnknown
**) DECLSPEC_HIDDEN
;
1026 IHTMLElementCollection
*create_all_collection(HTMLDOMNode
*,BOOL
) DECLSPEC_HIDDEN
;
1027 IHTMLElementCollection
*create_collection_from_nodelist(HTMLDocumentNode
*,nsIDOMNodeList
*) DECLSPEC_HIDDEN
;
1028 IHTMLElementCollection
*create_collection_from_htmlcol(HTMLDocumentNode
*,nsIDOMHTMLCollection
*) DECLSPEC_HIDDEN
;
1030 #define ATTRFLAG_CASESENSITIVE 0x0001
1031 #define ATTRFLAG_ASSTRING 0x0002
1032 #define ATTRFLAG_EXPANDURL 0x0004
1034 HRESULT
get_elem_attr_value_by_dispid(HTMLElement
*,DISPID
,DWORD
,VARIANT
*) DECLSPEC_HIDDEN
;
1035 HRESULT
get_elem_source_index(HTMLElement
*,LONG
*) DECLSPEC_HIDDEN
;
1037 nsresult
get_elem_attr_value(nsIDOMHTMLElement
*,const WCHAR
*,nsAString
*,const PRUnichar
**) DECLSPEC_HIDDEN
;
1038 HRESULT
elem_string_attr_getter(HTMLElement
*,const WCHAR
*,BOOL
,BSTR
*) DECLSPEC_HIDDEN
;
1039 HRESULT
elem_string_attr_setter(HTMLElement
*,const WCHAR
*,const WCHAR
*) DECLSPEC_HIDDEN
;
1044 HRESULT (*query
)(HTMLDocument
*,OLECMD
*);
1045 HRESULT (*exec
)(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
1048 extern const cmdtable_t editmode_cmds
[] DECLSPEC_HIDDEN
;
1050 void do_ns_command(HTMLDocument
*,const char*,nsICommandParams
*) DECLSPEC_HIDDEN
;
1053 #define UPDATE_UI 0x0001
1054 #define UPDATE_TITLE 0x0002
1056 void update_doc(HTMLDocument
*,DWORD
) DECLSPEC_HIDDEN
;
1057 void update_title(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
1058 void set_document_navigation(HTMLDocumentObj
*,BOOL
) DECLSPEC_HIDDEN
;
1060 HRESULT
do_query_service(IUnknown
*,REFGUID
,REFIID
,void**) DECLSPEC_HIDDEN
;
1063 HRESULT
setup_edit_mode(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
1064 void init_editor(HTMLDocument
*) DECLSPEC_HIDDEN
;
1065 void handle_edit_event(HTMLDocument
*,nsIDOMEvent
*) DECLSPEC_HIDDEN
;
1066 HRESULT
editor_exec_copy(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*) DECLSPEC_HIDDEN
;
1067 HRESULT
editor_exec_cut(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*) DECLSPEC_HIDDEN
;
1068 HRESULT
editor_exec_paste(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*) DECLSPEC_HIDDEN
;
1069 void handle_edit_load(HTMLDocument
*) DECLSPEC_HIDDEN
;
1070 HRESULT
editor_is_dirty(HTMLDocument
*) DECLSPEC_HIDDEN
;
1071 void set_dirty(HTMLDocument
*,VARIANT_BOOL
) DECLSPEC_HIDDEN
;
1073 extern DWORD mshtml_tls DECLSPEC_HIDDEN
;
1075 typedef struct task_t task_t
;
1076 typedef void (*task_proc_t
)(task_t
*);
1087 HTMLDocumentObj
*doc
;
1092 struct list task_list
;
1093 struct list timer_list
;
1096 thread_data_t
*get_thread_data(BOOL
) DECLSPEC_HIDDEN
;
1097 HWND
get_thread_hwnd(void) DECLSPEC_HIDDEN
;
1099 LONG
get_task_target_magic(void) DECLSPEC_HIDDEN
;
1100 HRESULT
push_task(task_t
*,task_proc_t
,task_proc_t
,LONG
) DECLSPEC_HIDDEN
;
1101 void remove_target_tasks(LONG
) DECLSPEC_HIDDEN
;
1102 void flush_pending_tasks(LONG
) DECLSPEC_HIDDEN
;
1104 HRESULT
set_task_timer(HTMLInnerWindow
*,DWORD
,BOOL
,IDispatch
*,LONG
*) DECLSPEC_HIDDEN
;
1105 HRESULT
clear_task_timer(HTMLInnerWindow
*,BOOL
,DWORD
) DECLSPEC_HIDDEN
;
1107 const char *debugstr_mshtml_guid(const GUID
*) DECLSPEC_HIDDEN
;
1109 DEFINE_GUID(CLSID_AboutProtocol
, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1110 DEFINE_GUID(CLSID_JSProtocol
, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1111 DEFINE_GUID(CLSID_MailtoProtocol
, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1112 DEFINE_GUID(CLSID_ResProtocol
, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1113 DEFINE_GUID(CLSID_SysimageProtocol
, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
1115 DEFINE_GUID(CLSID_CMarkup
,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
1117 DEFINE_OLEGUID(CGID_DocHostCmdPriv
, 0x000214D4L
, 0, 0);
1119 DEFINE_GUID(CLSID_JScript
, 0xf414c260,0x6ac0,0x11cf, 0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58);
1120 DEFINE_GUID(CLSID_VBScript
, 0xb54f3741,0x5b07,0x11cf, 0xa4,0xb0,0x00,0xaa,0x00,0x4a,0x55,0xe8);
1122 DEFINE_GUID(IID_UndocumentedScriptIface
,0x719c3050,0xf9d3,0x11cf,0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa0);
1123 DEFINE_GUID(IID_IDispatchJS
,0x719c3050,0xf9d3,0x11cf,0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa6);
1125 /* memory allocation functions */
1127 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len
)
1129 return HeapAlloc(GetProcessHeap(), 0, len
);
1132 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len
)
1134 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
1137 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem
, size_t len
)
1139 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
1142 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem
, size_t len
)
1144 return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, mem
, len
);
1147 static inline BOOL
heap_free(void *mem
)
1149 return HeapFree(GetProcessHeap(), 0, mem
);
1152 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
1159 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
1160 ret
= heap_alloc(size
);
1162 memcpy(ret
, str
, size
);
1168 static inline LPWSTR
heap_strndupW(LPCWSTR str
, unsigned len
)
1173 ret
= heap_alloc((len
+1)*sizeof(WCHAR
));
1176 memcpy(ret
, str
, len
*sizeof(WCHAR
));
1184 static inline char *heap_strdupA(const char *str
)
1191 size
= strlen(str
)+1;
1192 ret
= heap_alloc(size
);
1194 memcpy(ret
, str
, size
);
1200 static inline WCHAR
*heap_strdupAtoW(const char *str
)
1207 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
1208 ret
= heap_alloc(len
*sizeof(WCHAR
));
1210 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
1216 static inline char *heap_strdupWtoA(LPCWSTR str
)
1221 DWORD size
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
1222 ret
= heap_alloc(size
);
1224 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, size
, NULL
, NULL
);
1230 static inline WCHAR
*heap_strdupUtoW(const char *str
)
1237 len
= MultiByteToWideChar(CP_UTF8
, 0, str
, -1, NULL
, 0);
1238 ret
= heap_alloc(len
*sizeof(WCHAR
));
1240 MultiByteToWideChar(CP_UTF8
, 0, str
, -1, ret
, len
);
1246 static inline char *heap_strdupWtoU(const WCHAR
*str
)
1251 size_t size
= WideCharToMultiByte(CP_UTF8
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
1252 ret
= heap_alloc(size
);
1254 WideCharToMultiByte(CP_UTF8
, 0, str
, -1, ret
, size
, NULL
, NULL
);
1260 static inline char *heap_strndupWtoU(LPCWSTR str
, unsigned len
)
1266 size
= WideCharToMultiByte(CP_UTF8
, 0, str
, len
, NULL
, 0, NULL
, NULL
);
1267 ret
= heap_alloc(size
+ 1);
1269 WideCharToMultiByte(CP_UTF8
, 0, str
, len
, ret
, size
, NULL
, NULL
);
1277 static inline void windowref_addref(windowref_t
*ref
)
1279 InterlockedIncrement(&ref
->ref
);
1282 static inline void windowref_release(windowref_t
*ref
)
1284 if(!InterlockedDecrement(&ref
->ref
))
1288 UINT
cp_from_charset_string(BSTR
) DECLSPEC_HIDDEN
;
1289 HDC
get_display_dc(void) DECLSPEC_HIDDEN
;
1290 HINSTANCE
get_shdoclc(void) DECLSPEC_HIDDEN
;
1291 void set_statustext(HTMLDocumentObj
*,INT
,LPCWSTR
) DECLSPEC_HIDDEN
;
1293 extern HINSTANCE hInst DECLSPEC_HIDDEN
;
1295 #include "binding.h"
1296 #include "htmlevent.h"
1297 #include "htmlscript.h"
1298 #include "htmlstyle.h"
1299 #include "pluginhost.h"
1300 #include "resource.h"
1302 #endif /* _MSHTML_PRIVATE_H_ */