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 */
64 DispDOMChildrenCollection_tid
,
65 DispHTMLCommentElement_tid
,
67 DispHTMLDOMTextNode_tid
,
68 DispHTMLElementCollection_tid
,
69 DispHTMLGenericElement_tid
,
71 DispHTMLInputElement_tid
,
72 DispHTMLOptionElement_tid
,
73 DispHTMLSelectElement_tid
,
75 DispHTMLUnknownElement_tid
,
77 IHTMLCommentElement_tid
,
82 IHTMLDOMChildrenCollection_tid
,
88 IHTMLElementCollection_tid
,
89 IHTMLGenericElement_tid
,
91 IHTMLInputElement_tid
,
92 IHTMLOptionElement_tid
,
93 IHTMLSelectElement_tid
,
108 typedef struct dispex_data_t dispex_data_t
;
109 typedef struct dispex_dynamic_data_t dispex_dynamic_data_t
;
111 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
112 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
115 HRESULT (*get_dispid
)(IUnknown
*,BSTR
,DWORD
,DISPID
*);
116 HRESULT (*invoke
)(IUnknown
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
117 } dispex_static_data_vtbl_t
;
120 const dispex_static_data_vtbl_t
*vtbl
;
121 const tid_t disp_tid
;
123 const tid_t
* const iface_tids
;
124 } dispex_static_data_t
;
127 const IDispatchExVtbl
*lpIDispatchExVtbl
;
131 dispex_static_data_t
*data
;
132 dispex_dynamic_data_t
*dynamic_data
;
135 void init_dispex(DispatchEx
*,IUnknown
*,dispex_static_data_t
*);
139 const IHTMLWindow2Vtbl
*lpHTMLWindow2Vtbl
;
140 const IHTMLWindow3Vtbl
*lpHTMLWindow3Vtbl
;
141 const IDispatchExVtbl
*lpIDispatchExVtbl
;
146 nsIDOMWindow
*nswindow
;
148 IHTMLEventObj
*event
;
160 const IConnectionPointContainerVtbl
*lpConnectionPointContainerVtbl
;
162 ConnectionPoint
*cp_list
;
164 } ConnectionPointContainer
;
166 struct ConnectionPoint
{
167 const IConnectionPointVtbl
*lpConnectionPointVtbl
;
169 IConnectionPointContainer
*container
;
174 IPropertyNotifySink
*propnotif
;
180 ConnectionPoint
*next
;
184 const IHTMLLocationVtbl
*lpHTMLLocationVtbl
;
192 const IHTMLOptionElementFactoryVtbl
*lpHTMLOptionElementFactoryVtbl
;
197 } HTMLOptionElementFactory
;
199 struct HTMLDocument
{
201 const IHTMLDocument2Vtbl
*lpHTMLDocument2Vtbl
;
202 const IHTMLDocument3Vtbl
*lpHTMLDocument3Vtbl
;
203 const IHTMLDocument4Vtbl
*lpHTMLDocument4Vtbl
;
204 const IHTMLDocument5Vtbl
*lpHTMLDocument5Vtbl
;
205 const IPersistMonikerVtbl
*lpPersistMonikerVtbl
;
206 const IPersistFileVtbl
*lpPersistFileVtbl
;
207 const IMonikerPropVtbl
*lpMonikerPropVtbl
;
208 const IOleObjectVtbl
*lpOleObjectVtbl
;
209 const IOleDocumentVtbl
*lpOleDocumentVtbl
;
210 const IOleDocumentViewVtbl
*lpOleDocumentViewVtbl
;
211 const IOleInPlaceActiveObjectVtbl
*lpOleInPlaceActiveObjectVtbl
;
212 const IViewObject2Vtbl
*lpViewObject2Vtbl
;
213 const IOleInPlaceObjectWindowlessVtbl
*lpOleInPlaceObjectWindowlessVtbl
;
214 const IServiceProviderVtbl
*lpServiceProviderVtbl
;
215 const IOleCommandTargetVtbl
*lpOleCommandTargetVtbl
;
216 const IOleControlVtbl
*lpOleControlVtbl
;
217 const IHlinkTargetVtbl
*lpHlinkTargetVtbl
;
218 const IPersistStreamInitVtbl
*lpPersistStreamInitVtbl
;
219 const ICustomDocVtbl
*lpCustomDocVtbl
;
220 const IDispatchExVtbl
*lpIDispatchExVtbl
;
224 NSContainer
*nscontainer
;
227 IOleClientSite
*client
;
228 IDocHostUIHandler
*hostui
;
229 IOleInPlaceSite
*ipsite
;
230 IOleInPlaceFrame
*frame
;
231 IOleInPlaceUIWindow
*ip_window
;
233 IOleUndoManager
*undomgr
;
235 nsChannelBSC
*bscallback
;
238 struct list bindings
;
240 struct list script_hosts
;
245 DOCHOSTUIINFO hostinfo
;
248 READYSTATE readystate
;
249 BOOL in_place_active
;
253 BOOL container_locked
;
259 ConnectionPointContainer cp_container
;
260 ConnectionPoint cp_htmldocevents
;
261 ConnectionPoint cp_htmldocevents2
;
262 ConnectionPoint cp_propnotif
;
264 HTMLOptionElementFactory
*option_factory
;
265 HTMLLocation
*location
;
267 struct list selection_list
;
268 struct list range_list
;
274 const nsIDOMEventListenerVtbl
*lpDOMEventListenerVtbl
;
279 const nsIWebBrowserChromeVtbl
*lpWebBrowserChromeVtbl
;
280 const nsIContextMenuListenerVtbl
*lpContextMenuListenerVtbl
;
281 const nsIURIContentListenerVtbl
*lpURIContentListenerVtbl
;
282 const nsIEmbeddingSiteWindowVtbl
*lpEmbeddingSiteWindowVtbl
;
283 const nsITooltipListenerVtbl
*lpTooltipListenerVtbl
;
284 const nsIInterfaceRequestorVtbl
*lpInterfaceRequestorVtbl
;
285 const nsIWeakReferenceVtbl
*lpWeakReferenceVtbl
;
286 const nsISupportsWeakReferenceVtbl
*lpSupportsWeakReferenceVtbl
;
288 nsEventListener blur_listener
;
289 nsEventListener focus_listener
;
290 nsEventListener keypress_listener
;
291 nsEventListener load_listener
;
292 nsEventListener node_insert_listener
;
293 nsEventListener htmlevent_listener
;
295 nsIWebBrowser
*webbrowser
;
296 nsIWebNavigation
*navigation
;
297 nsIBaseWindow
*window
;
298 nsIWebBrowserFocus
*focus
;
301 nsIController
*editor_controller
;
308 nsIURIContentListener
*content_listener
;
312 nsChannelBSC
*bscallback
; /* hack */
313 HWND reset_focus
; /* hack */
315 BOOL event_vector
[EVENTID_LAST
];
319 const nsIHttpChannelVtbl
*lpHttpChannelVtbl
;
320 const nsIUploadChannelVtbl
*lpUploadChannelVtbl
;
325 nsIHttpChannel
*http_channel
;
327 nsIInputStream
*post_data_stream
;
328 nsILoadGroup
*load_group
;
329 nsIInterfaceRequestor
*notif_callback
;
330 nsLoadFlags load_flags
;
331 nsIURI
*original_uri
;
337 HRESULT (*qi
)(HTMLDOMNode
*,REFIID
,void**);
338 void (*destructor
)(HTMLDOMNode
*);
343 const IHTMLDOMNodeVtbl
*lpHTMLDOMNodeVtbl
;
344 const IHTMLDOMNode2Vtbl
*lpHTMLDOMNode2Vtbl
;
345 const NodeImplVtbl
*vtbl
;
351 event_target_t
*event_target
;
358 ConnectionPointContainer cp_container
;
360 const IHTMLElementVtbl
*lpHTMLElementVtbl
;
361 const IHTMLElement2Vtbl
*lpHTMLElement2Vtbl
;
363 nsIDOMHTMLElement
*nselem
;
369 const IHTMLTextContainerVtbl
*lpHTMLTextContainerVtbl
;
374 #define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
375 #define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
377 #define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl)
378 #define HTMLDOC3(x) ((IHTMLDocument3*) &(x)->lpHTMLDocument3Vtbl)
379 #define HTMLDOC4(x) ((IHTMLDocument4*) &(x)->lpHTMLDocument4Vtbl)
380 #define HTMLDOC5(x) ((IHTMLDocument5*) &(x)->lpHTMLDocument5Vtbl)
381 #define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
382 #define PERSISTMON(x) ((IPersistMoniker*) &(x)->lpPersistMonikerVtbl)
383 #define PERSISTFILE(x) ((IPersistFile*) &(x)->lpPersistFileVtbl)
384 #define MONPROP(x) ((IMonikerProp*) &(x)->lpMonikerPropVtbl)
385 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
386 #define OLEDOC(x) ((IOleDocument*) &(x)->lpOleDocumentVtbl)
387 #define DOCVIEW(x) ((IOleDocumentView*) &(x)->lpOleDocumentViewVtbl)
388 #define OLEWIN(x) ((IOleWindow*) &(x)->lpOleInPlaceActiveObjectVtbl)
389 #define ACTOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
390 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObject2Vtbl)
391 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObject2Vtbl)
392 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
393 #define INPLACEWIN(x) ((IOleInPlaceObjectWindowless*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
394 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
395 #define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
396 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
397 #define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
398 #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
399 #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
400 #define CUSTOMDOC(x) ((ICustomDoc*) &(x)->lpCustomDocVtbl)
402 #define NSWBCHROME(x) ((nsIWebBrowserChrome*) &(x)->lpWebBrowserChromeVtbl)
403 #define NSCML(x) ((nsIContextMenuListener*) &(x)->lpContextMenuListenerVtbl)
404 #define NSURICL(x) ((nsIURIContentListener*) &(x)->lpURIContentListenerVtbl)
405 #define NSEMBWNDS(x) ((nsIEmbeddingSiteWindow*) &(x)->lpEmbeddingSiteWindowVtbl)
406 #define NSIFACEREQ(x) ((nsIInterfaceRequestor*) &(x)->lpInterfaceRequestorVtbl)
407 #define NSTOOLTIP(x) ((nsITooltipListener*) &(x)->lpTooltipListenerVtbl)
408 #define NSEVENTLIST(x) ((nsIDOMEventListener*) &(x)->lpDOMEventListenerVtbl)
409 #define NSWEAKREF(x) ((nsIWeakReference*) &(x)->lpWeakReferenceVtbl)
410 #define NSSUPWEAKREF(x) ((nsISupportsWeakReference*) &(x)->lpSupportsWeakReferenceVtbl)
412 #define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
413 #define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
414 #define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl)
416 #define HTTPNEG(x) ((IHttpNegotiate2*) &(x)->lpHttpNegotiate2Vtbl)
417 #define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
418 #define BINDINFO(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl);
420 #define HTMLELEM(x) ((IHTMLElement*) &(x)->lpHTMLElementVtbl)
421 #define HTMLELEM2(x) ((IHTMLElement2*) &(x)->lpHTMLElement2Vtbl)
422 #define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
423 #define HTMLDOMNODE2(x) ((IHTMLDOMNode2*) &(x)->lpHTMLDOMNode2Vtbl)
425 #define HTMLTEXTCONT(x) ((IHTMLTextContainer*) &(x)->lpHTMLTextContainerVtbl)
427 #define HTMLOPTFACTORY(x) ((IHTMLOptionElementFactory*) &(x)->lpHTMLOptionElementFactoryVtbl)
428 #define HTMLLOCATION(x) ((IHTMLLocation*) &(x)->lpHTMLLocationVtbl)
430 #define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
432 #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
433 #define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
435 HRESULT
HTMLDocument_Create(IUnknown
*,REFIID
,void**);
436 HRESULT
HTMLLoadOptions_Create(IUnknown
*,REFIID
,void**);
438 HTMLWindow
*HTMLWindow_Create(HTMLDocument
*);
439 HTMLWindow
*nswindow_to_window(const nsIDOMWindow
*);
440 HTMLOptionElementFactory
*HTMLOptionElementFactory_Create(HTMLDocument
*);
441 HTMLLocation
*HTMLLocation_Create(HTMLDocument
*);
442 IOmNavigator
*OmNavigator_Create(void);
443 void setup_nswindow(HTMLWindow
*);
445 void HTMLDocument_HTMLDocument3_Init(HTMLDocument
*);
446 void HTMLDocument_HTMLDocument5_Init(HTMLDocument
*);
447 void HTMLDocument_Persist_Init(HTMLDocument
*);
448 void HTMLDocument_OleCmd_Init(HTMLDocument
*);
449 void HTMLDocument_OleObj_Init(HTMLDocument
*);
450 void HTMLDocument_View_Init(HTMLDocument
*);
451 void HTMLDocument_Window_Init(HTMLDocument
*);
452 void HTMLDocument_Service_Init(HTMLDocument
*);
453 void HTMLDocument_Hlink_Init(HTMLDocument
*);
455 void ConnectionPoint_Init(ConnectionPoint
*,ConnectionPointContainer
*,REFIID
);
456 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*);
457 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*);
459 NSContainer
*NSContainer_Create(HTMLDocument
*,NSContainer
*);
460 void NSContainer_Release(NSContainer
*);
462 void HTMLDocument_LockContainer(HTMLDocument
*,BOOL
);
463 void show_context_menu(HTMLDocument
*,DWORD
,POINT
*,IDispatch
*);
464 void notif_focus(HTMLDocument
*);
466 void show_tooltip(HTMLDocument
*,DWORD
,DWORD
,LPCWSTR
);
467 void hide_tooltip(HTMLDocument
*);
468 HRESULT
get_client_disp_property(IOleClientSite
*,DISPID
,VARIANT
*);
470 HRESULT
ProtocolFactory_Create(REFCLSID
,REFIID
,void**);
472 BOOL
load_gecko(BOOL
);
473 void close_gecko(void);
474 void register_nsservice(nsIComponentRegistrar
*,nsIServiceManager
*);
475 void init_nsio(nsIComponentManager
*,nsIComponentRegistrar
*);
476 BOOL
install_wine_gecko(BOOL
);
478 void hlink_frame_navigate(HTMLDocument
*,IHlinkFrame
*,LPCWSTR
,nsIInputStream
*,DWORD
);
480 void call_property_onchanged(ConnectionPoint
*,DISPID
);
481 HRESULT
call_set_active_object(IOleInPlaceUIWindow
*,IOleInPlaceActiveObject
*);
483 void *nsalloc(size_t);
486 void nsACString_Init(nsACString
*,const char*);
487 void nsACString_SetData(nsACString
*,const char*);
488 PRUint32
nsACString_GetData(const nsACString
*,const char**);
489 void nsACString_Finish(nsACString
*);
491 void nsAString_Init(nsAString
*,const PRUnichar
*);
492 void nsAString_SetData(nsAString
*,const PRUnichar
*);
493 PRUint32
nsAString_GetData(const nsAString
*,const PRUnichar
**);
494 void nsAString_Finish(nsAString
*);
496 nsIInputStream
*create_nsstream(const char*,PRInt32
);
497 nsICommandParams
*create_nscommand_params(void);
498 nsIMutableArray
*create_nsarray(void);
499 nsIWritableVariant
*create_nsvariant(void);
500 void nsnode_to_nsstring(nsIDOMNode
*,nsAString
*);
501 void get_editor_controller(NSContainer
*);
502 void init_nsevents(NSContainer
*);
503 void add_nsevent_listener(NSContainer
*,LPCWSTR
);
504 nsresult
get_nsinterface(nsISupports
*,REFIID
,void**);
506 void check_event_attr(HTMLDocument
*,nsIDOMElement
*);
507 void release_event_target(event_target_t
*);
508 void fire_event(HTMLDocument
*,eventid_t
,nsIDOMNode
*);
509 HRESULT
set_node_event(HTMLDOMNode
*,eventid_t
,VARIANT
*);
510 eventid_t
str_to_eid(LPCWSTR
);
512 void set_document_bscallback(HTMLDocument
*,nsChannelBSC
*);
513 void set_current_mon(HTMLDocument
*,IMoniker
*);
514 HRESULT
start_binding(HTMLDocument
*,BSCallback
*,IBindCtx
*);
516 HRESULT
bind_mon_to_buffer(HTMLDocument
*,IMoniker
*,void**,DWORD
*);
518 nsChannelBSC
*create_channelbsc(IMoniker
*);
519 HRESULT
channelbsc_load_stream(nsChannelBSC
*,IStream
*);
520 void channelbsc_set_channel(nsChannelBSC
*,nsChannel
*,nsIStreamListener
*,nsISupports
*);
521 IMoniker
*get_channelbsc_mon(nsChannelBSC
*);
523 IHTMLSelectionObject
*HTMLSelectionObject_Create(HTMLDocument
*,nsISelection
*);
524 IHTMLTxtRange
*HTMLTxtRange_Create(HTMLDocument
*,nsIDOMRange
*);
525 IHTMLStyle
*HTMLStyle_Create(nsIDOMCSSStyleDeclaration
*);
526 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*);
527 IHTMLStyleSheetsCollection
*HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList
*);
529 void detach_selection(HTMLDocument
*);
530 void detach_ranges(HTMLDocument
*);
532 HTMLDOMNode
*HTMLDOMTextNode_Create(HTMLDocument
*,nsIDOMNode
*);
534 HTMLElement
*HTMLElement_Create(HTMLDocument
*,nsIDOMNode
*,BOOL
);
535 HTMLElement
*HTMLCommentElement_Create(HTMLDocument
*,nsIDOMNode
*);
536 HTMLElement
*HTMLAnchorElement_Create(nsIDOMHTMLElement
*);
537 HTMLElement
*HTMLBodyElement_Create(nsIDOMHTMLElement
*);
538 HTMLElement
*HTMLImgElement_Create(nsIDOMHTMLElement
*);
539 HTMLElement
*HTMLInputElement_Create(nsIDOMHTMLElement
*);
540 HTMLElement
*HTMLOptionElement_Create(nsIDOMHTMLElement
*);
541 HTMLElement
*HTMLScriptElement_Create(nsIDOMHTMLElement
*);
542 HTMLElement
*HTMLSelectElement_Create(nsIDOMHTMLElement
*);
543 HTMLElement
*HTMLTable_Create(nsIDOMHTMLElement
*);
544 HTMLElement
*HTMLTextAreaElement_Create(nsIDOMHTMLElement
*);
545 HTMLElement
*HTMLGenericElement_Create(nsIDOMHTMLElement
*);
547 void HTMLDOMNode_Init(HTMLDocument
*,HTMLDOMNode
*,nsIDOMNode
*);
548 void HTMLElement_Init(HTMLElement
*);
549 void HTMLElement2_Init(HTMLElement
*);
550 void HTMLTextContainer_Init(HTMLTextContainer
*);
552 HRESULT
HTMLDOMNode_QI(HTMLDOMNode
*,REFIID
,void**);
553 void HTMLDOMNode_destructor(HTMLDOMNode
*);
555 HRESULT
HTMLElement_QI(HTMLDOMNode
*,REFIID
,void**);
556 void HTMLElement_destructor(HTMLDOMNode
*);
558 HTMLDOMNode
*get_node(HTMLDocument
*,nsIDOMNode
*,BOOL
);
559 void release_nodes(HTMLDocument
*);
561 void release_script_hosts(HTMLDocument
*);
562 void connect_scripts(HTMLDocument
*);
563 void doc_insert_script(HTMLDocument
*,nsIDOMHTMLScriptElement
*);
564 IDispatch
*script_parse_event(HTMLDocument
*,LPCWSTR
);
566 IHTMLElementCollection
*create_all_collection(HTMLDOMNode
*);
571 HRESULT (*query
)(HTMLDocument
*,OLECMD
*);
572 HRESULT (*exec
)(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
575 extern const cmdtable_t editmode_cmds
[];
577 void do_ns_command(NSContainer
*,const char*,nsICommandParams
*);
580 #define UPDATE_UI 0x0001
581 #define UPDATE_TITLE 0x0002
583 void update_doc(HTMLDocument
*This
, DWORD flags
);
584 void update_title(HTMLDocument
*);
587 void init_editor(HTMLDocument
*);
588 void set_ns_editmode(NSContainer
*);
589 void handle_edit_event(HTMLDocument
*,nsIDOMEvent
*);
590 HRESULT
editor_exec_copy(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
591 HRESULT
editor_exec_cut(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
592 HRESULT
editor_exec_paste(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
593 void handle_edit_load(HTMLDocument
*);
594 HRESULT
editor_is_dirty(HTMLDocument
*);
595 void set_dirty(HTMLDocument
*,VARIANT_BOOL
);
597 extern DWORD mshtml_tls
;
599 typedef struct task_t
{
603 TASK_SETDOWNLOADSTATE
,
609 nsChannelBSC
*bscallback
;
616 task_t
*task_queue_head
;
617 task_t
*task_queue_tail
;
618 struct list timer_list
;
621 thread_data_t
*get_thread_data(BOOL
);
622 HWND
get_thread_hwnd(void);
623 void push_task(task_t
*);
624 void remove_doc_tasks(const HTMLDocument
*);
625 DWORD
set_task_timer(HTMLDocument
*,DWORD
,IDispatch
*);
627 HRESULT
get_typeinfo(tid_t
,ITypeInfo
**);
628 void release_typelib(void);
629 void call_disp_func(HTMLDocument
*,IDispatch
*);
631 DEFINE_GUID(CLSID_AboutProtocol
, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
632 DEFINE_GUID(CLSID_JSProtocol
, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
633 DEFINE_GUID(CLSID_MailtoProtocol
, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
634 DEFINE_GUID(CLSID_ResProtocol
, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
635 DEFINE_GUID(CLSID_SysimageProtocol
, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
637 DEFINE_GUID(CLSID_CMarkup
,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
639 extern LONG module_ref
;
640 #define LOCK_MODULE() InterlockedIncrement(&module_ref)
641 #define UNLOCK_MODULE() InterlockedDecrement(&module_ref)
643 /* memory allocation functions */
645 static inline void *heap_alloc(size_t len
)
647 return HeapAlloc(GetProcessHeap(), 0, len
);
650 static inline void *heap_alloc_zero(size_t len
)
652 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
655 static inline void *heap_realloc(void *mem
, size_t len
)
657 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
660 static inline BOOL
heap_free(void *mem
)
662 return HeapFree(GetProcessHeap(), 0, mem
);
665 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
672 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
673 ret
= heap_alloc(size
);
674 memcpy(ret
, str
, size
);
680 static inline char *heap_strdupA(const char *str
)
687 size
= strlen(str
)+1;
688 ret
= heap_alloc(size
);
689 memcpy(ret
, str
, size
);
695 static inline WCHAR
*heap_strdupAtoW(const char *str
)
702 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
703 ret
= heap_alloc(len
*sizeof(WCHAR
));
704 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
710 static inline char *heap_strdupWtoA(LPCWSTR str
)
715 DWORD size
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
716 ret
= heap_alloc(size
);
717 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, size
, NULL
, NULL
);
723 HINSTANCE
get_shdoclc(void);
725 extern HINSTANCE hInst
;