2 * Copyright 2005 Jacek Caban
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 #define NS_OK ((nsresult)0x00000000L)
31 #define NS_NOINTERFACE ((nsresult)0x80004002L)
32 #define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L)
33 #define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L)
35 #define NS_FAILED(res) ((res) & 0x80000000)
36 #define NS_SUCCEEDED(res) (!NS_FAILED(res))
40 typedef struct NSContainer NSContainer;
41 typedef struct BindStatusCallback BindStatusCallback;
44 const IHTMLDocument2Vtbl *lpHTMLDocument2Vtbl;
45 const IPersistMonikerVtbl *lpPersistMonikerVtbl;
46 const IPersistFileVtbl *lpPersistFileVtbl;
47 const IMonikerPropVtbl *lpMonikerPropVtbl;
48 const IOleObjectVtbl *lpOleObjectVtbl;
49 const IOleDocumentVtbl *lpOleDocumentVtbl;
50 const IOleDocumentViewVtbl *lpOleDocumentViewVtbl;
51 const IOleInPlaceActiveObjectVtbl *lpOleInPlaceActiveObjectVtbl;
52 const IViewObject2Vtbl *lpViewObject2Vtbl;
53 const IOleInPlaceObjectWindowlessVtbl *lpOleInPlaceObjectWindowlessVtbl;
54 const IServiceProviderVtbl *lpServiceProviderVtbl;
55 const IOleCommandTargetVtbl *lpOleCommandTargetVtbl;
56 const IOleControlVtbl *lpOleControlVtbl;
57 const IHlinkTargetVtbl *lpHlinkTargetVtbl;
61 NSContainer *nscontainer;
63 IOleClientSite *client;
64 IDocHostUIHandler *hostui;
65 IOleInPlaceSite *ipsite;
66 IOleInPlaceFrame *frame;
74 BOOL container_locked;
76 BindStatusCallback *status_callback;
80 const nsIWebBrowserChromeVtbl *lpWebBrowserChromeVtbl;
81 const nsIContextMenuListenerVtbl *lpContextMenuListenerVtbl;
83 nsIWebBrowser *webbrowser;
84 nsIWebNavigation *navigation;
85 nsIBaseWindow *window;
86 nsIWebBrowserStream *stream;
87 nsIWebBrowserFocus *focus;
94 #define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl)
95 #define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
96 #define PERSISTMON(x) ((IPersistMoniker*) &(x)->lpPersistMonikerVtbl)
97 #define PERSISTFILE(x) ((IPersistFile*) &(x)->lpPersistFileVtbl)
98 #define MONPROP(x) ((IMonikerProp*) &(x)->lpMonikerPropVtbl)
99 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
100 #define OLEDOC(x) ((IOleDocument*) &(x)->lpOleDocumentVtbl)
101 #define DOCVIEW(x) ((IOleDocumentView*) &(x)->lpOleDocumentViewVtbl)
102 #define OLEWIN(x) ((IOleWindow*) &(x)->lpOleInPlaceActiveObjectVtbl)
103 #define ACTOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
104 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObject2Vtbl)
105 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObject2Vtbl)
106 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
107 #define INPLACEWIN(x) ((IOleInPlaceObjectWindowless*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
108 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
109 #define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
110 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
111 #define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
112 #define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
114 #define NSWBCHROME(x) ((nsIWebBrowserChrome*) &(x)->lpWebBrowserChromeVtbl)
115 #define NSCML(x) ((nsIContextMenuListener*) &(x)->lpContextMenuListenerVtbl)
117 #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
119 HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**);
121 void HTMLDocument_Persist_Init(HTMLDocument*);
122 void HTMLDocument_OleObj_Init(HTMLDocument*);
123 void HTMLDocument_View_Init(HTMLDocument*);
124 void HTMLDocument_Window_Init(HTMLDocument*);
125 void HTMLDocument_Service_Init(HTMLDocument*);
126 void HTMLDocument_Hlink_Init(HTMLDocument*);
127 void HTMLDocument_NSContainer_Init(HTMLDocument*);
129 void HTMLDocument_NSContainer_Destroy(HTMLDocument*);
131 void HTMLDocument_LockContainer(HTMLDocument*,BOOL);
132 void HTMLDocument_ShowContextMenu(HTMLDocument*,DWORD,POINT*);
134 HRESULT ProtocolFactory_Create(REFCLSID,REFIID,void**);
136 void close_gecko(void);
138 nsIURI *get_nsIURI(LPCWSTR);
140 nsACString *nsACString_Create(void);
141 void nsACString_SetData(nsACString*,const char*);
142 void nsACString_Destroy(nsACString*);
144 DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
145 DEFINE_GUID(CLSID_JSProtocol, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
146 DEFINE_GUID(CLSID_MailtoProtocol, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
147 DEFINE_GUID(CLSID_ResProtocol, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
148 DEFINE_GUID(CLSID_SysimageProtocol, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
150 extern LONG module_ref;
151 #define LOCK_MODULE() InterlockedIncrement(&module_ref)
152 #define UNLOCK_MODULE() InterlockedDecrement(&module_ref)
154 extern HINSTANCE hInst;