Unicodify wineesd.
[wine] / dlls / mshtml / mshtml_private.h
1 /*
2  * Copyright 2005 Jacek Caban
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #include "nsiface.h"
20
21 #define NS_OK                     ((nsresult)0x00000000L)
22 #define NS_NOINTERFACE            ((nsresult)0x80004002L)
23 #define NS_ERROR_NOT_IMPLEMENTED  ((nsresult)0x80004001L)
24
25 #define NS_FAILED(res) ((res) & 0x80000000)
26 #define NS_SUCCEEDED(res) (!NS_FAILED(res))
27
28 typedef struct NSContainer NSContainer;
29 typedef struct BindStatusCallback BindStatusCallback;
30
31 typedef struct {
32     const IHTMLDocument2Vtbl              *lpHTMLDocument2Vtbl;
33     const IPersistMonikerVtbl             *lpPersistMonikerVtbl;
34     const IPersistFileVtbl                *lpPersistFileVtbl;
35     const IMonikerPropVtbl                *lpMonikerPropVtbl;
36     const IOleObjectVtbl                  *lpOleObjectVtbl;
37     const IOleDocumentVtbl                *lpOleDocumentVtbl;
38     const IOleDocumentViewVtbl            *lpOleDocumentViewVtbl;
39     const IOleInPlaceActiveObjectVtbl     *lpOleInPlaceActiveObjectVtbl;
40     const IViewObject2Vtbl                *lpViewObject2Vtbl;
41     const IOleInPlaceObjectWindowlessVtbl *lpOleInPlaceObjectWindowlessVtbl;
42     const IServiceProviderVtbl            *lpServiceProviderVtbl;
43     const IOleCommandTargetVtbl           *lpOleCommandTargetVtbl;
44     const IOleControlVtbl                 *lpOleControlVtbl;
45
46     LONG ref;
47
48     NSContainer *nscontainer;
49
50     IOleClientSite *client;
51     IDocHostUIHandler *hostui;
52     IOleInPlaceSite *ipsite;
53     IOleInPlaceFrame *frame;
54
55     HWND hwnd;
56
57     BOOL in_place_active;
58     BOOL ui_active;
59     BOOL has_key_path;
60
61     BindStatusCallback *status_callback;
62 } HTMLDocument;
63
64 struct NSContainer {
65     nsIWebBrowser *webbrowser;
66     nsIWebNavigation *navigation;
67     nsIBaseWindow *window;
68
69     HWND hwnd;
70 };
71
72
73 #define HTMLDOC(x)       ((IHTMLDocument2*)               &(x)->lpHTMLDocument2Vtbl)
74 #define PERSIST(x)       ((IPersist*)                     &(x)->lpPersistFileVtbl)
75 #define PERSISTMON(x)    ((IPersistMoniker*)              &(x)->lpPersistMonikerVtbl)
76 #define PERSISTFILE(x)   ((IPersistFile*)                 &(x)->lpPersistFileVtbl)
77 #define MONPROP(x)       ((IMonikerProp*)                 &(x)->lpMonikerPropVtbl)
78 #define OLEOBJ(x)        ((IOleObject*)                   &(x)->lpOleObjectVtbl)
79 #define OLEDOC(x)        ((IOleDocument*)                 &(x)->lpOleDocumentVtbl)
80 #define DOCVIEW(x)       ((IOleDocumentView*)             &(x)->lpOleDocumentViewVtbl)
81 #define OLEWIN(x)        ((IOleWindow*)                   &(x)->lpOleInPlaceActiveObjectVtbl)
82 #define ACTOBJ(x)        ((IOleInPlaceActiveObject*)      &(x)->lpOleInPlaceActiveObjectVtbl)
83 #define VIEWOBJ(x)       ((IViewObject*)                  &(x)->lpViewObject2Vtbl)
84 #define VIEWOBJ2(x)      ((IViewObject2*)                 &(x)->lpViewObject2Vtbl)
85 #define INPLACEOBJ(x)    ((IOleInPlaceObject*)            &(x)->lpOleInPlaceObjectWindowlessVtbl)
86 #define INPLACEWIN(x)    ((IOleInPlaceObjectWindowless*)  &(x)->lpOleInPlaceObjectWindowlessVtbl)
87 #define SERVPROV(x)      ((IServiceProvider*)             &(x)->lpServiceProviderVtbl)
88 #define CMDTARGET(x)     ((IOleCommandTarget*)            &(x)->lpOleCommandTargetVtbl)
89 #define CONTROL(x)       ((IOleControl*)                  &(x)->lpOleControlVtbl)
90 #define STATUSCLB(x)     ((IBindStatusCallback*)          &(x)->lpBindStatusCallbackVtbl)
91
92 #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
93
94 HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**);
95
96 void HTMLDocument_Persist_Init(HTMLDocument*);
97 void HTMLDocument_OleObj_Init(HTMLDocument*);
98 void HTMLDocument_View_Init(HTMLDocument*);
99 void HTMLDocument_Window_Init(HTMLDocument*);
100 void HTMLDocument_Service_Init(HTMLDocument*);
101 void HTMLDocument_NSContainer_Init(HTMLDocument*);
102
103 void HTMLDocument_NSContainer_Destroy(HTMLDocument*);
104
105 HRESULT ProtocolFactory_Create(REFCLSID,REFIID,void**);
106
107 void close_gecko(void);
108
109 DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
110 DEFINE_GUID(CLSID_JSProtocol, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
111 DEFINE_GUID(CLSID_MailtoProtocol, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
112 DEFINE_GUID(CLSID_ResProtocol, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
113 DEFINE_GUID(CLSID_SysimageProtocol, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
114
115 extern LONG module_ref;
116 #define LOCK_MODULE()   InterlockedIncrement(&module_ref)
117 #define UNLOCK_MODULE() InterlockedDecrement(&module_ref)
118
119 extern HINSTANCE hInst;