ReactOS Fundraising Campaign 2012
 
€ 3,873 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

shdocvw.h
Go to the documentation of this file.
00001 /*
00002  * Header includes for shdocvw.dll
00003  *
00004  * Copyright 2001 John R. Sheets (for CodeWeavers)
00005  * Copyright 2005-2006 Jacek Caban for CodeWeavers
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00020  */
00021 
00022 #ifndef __WINE_SHDOCVW_H
00023 #define __WINE_SHDOCVW_H
00024 
00025 #define COBJMACROS
00026 
00027 #include <stdarg.h>
00028 
00029 #include "windef.h"
00030 #include "winbase.h"
00031 #include "wingdi.h"
00032 #include "winuser.h"
00033 
00034 #include "ole2.h"
00035 #include "olectl.h"
00036 #include "shlobj.h"
00037 #include "exdisp.h"
00038 #include "mshtmhst.h"
00039 #include "hlink.h"
00040 #include "htiframe.h"
00041 
00042 #include "wine/unicode.h"
00043 #include "resource.h"
00044 
00045 
00046 #define WM_UPDATEADDRBAR    (WM_APP+1)
00047 
00048 /**********************************************************************
00049  * Shell Instance Objects
00050  */
00051 extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, 
00052     REFIID riid, LPVOID *ppvClassObj);
00053 
00054 /**********************************************************************
00055  * WebBrowser declaration for SHDOCVW.DLL
00056  */
00057 
00058 typedef struct ConnectionPoint ConnectionPoint;
00059 typedef struct DocHost DocHost;
00060 
00061 typedef struct {
00062     const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl;
00063 
00064     ConnectionPoint *wbe2;
00065     ConnectionPoint *wbe;
00066     ConnectionPoint *pns;
00067 
00068     IUnknown *impl;
00069 } ConnectionPointContainer;
00070 
00071 typedef struct {
00072     const IHlinkFrameVtbl    *lpIHlinkFrameVtbl;
00073     const ITargetFrame2Vtbl  *lpITargetFrame2Vtbl;
00074 
00075     IUnknown *outer;
00076     DocHost *doc_host;
00077 } HlinkFrame;
00078 
00079 struct _task_header_t;
00080 
00081 typedef void (*task_proc_t)(DocHost*, struct _task_header_t*);
00082 
00083 typedef struct _task_header_t {
00084     task_proc_t proc;
00085 } task_header_t;
00086 
00087 typedef struct _IDocHostContainerVtbl
00088 {
00089     void (WINAPI* GetDocObjRect)(DocHost*,RECT*);
00090     HRESULT (WINAPI* SetStatusText)(DocHost*,LPCWSTR);
00091     void (WINAPI* SetURL)(DocHost*,LPCWSTR);
00092     HRESULT (*exec)(DocHost*,const GUID*,DWORD,DWORD,VARIANT*,VARIANT*);
00093 } IDocHostContainerVtbl;
00094 
00095 struct DocHost {
00096     const IOleClientSiteVtbl      *lpOleClientSiteVtbl;
00097     const IOleInPlaceSiteVtbl     *lpOleInPlaceSiteVtbl;
00098     const IDocHostUIHandler2Vtbl  *lpDocHostUIHandlerVtbl;
00099     const IOleDocumentSiteVtbl    *lpOleDocumentSiteVtbl;
00100     const IOleCommandTargetVtbl   *lpOleCommandTargetVtbl;
00101     const IDispatchVtbl           *lpDispatchVtbl;
00102     const IPropertyNotifySinkVtbl *lpIPropertyNotifySinkVtbl;
00103     const IServiceProviderVtbl    *lpServiceProviderVtbl;
00104 
00105     /* Interfaces of InPlaceFrame object */
00106     const IOleInPlaceFrameVtbl          *lpOleInPlaceFrameVtbl;
00107 
00108     IDispatch *disp;
00109 
00110     IDispatch *client_disp;
00111     IDocHostUIHandler *hostui;
00112     IOleInPlaceFrame *frame;
00113 
00114     IUnknown *document;
00115     IOleDocumentView *view;
00116     IUnknown *doc_navigate;
00117 
00118     const IDocHostContainerVtbl *container_vtbl;
00119 
00120     HWND hwnd;
00121     HWND frame_hwnd;
00122 
00123     LPOLESTR url;
00124 
00125     VARIANT_BOOL silent;
00126     VARIANT_BOOL offline;
00127     VARIANT_BOOL busy;
00128 
00129     READYSTATE ready_state;
00130     READYSTATE doc_state;
00131     DWORD prop_notif_cookie;
00132     BOOL is_prop_notif;
00133 
00134     ConnectionPointContainer cps;
00135 };
00136 
00137 struct WebBrowser {
00138     /* Interfaces available via WebBrowser object */
00139 
00140     const IWebBrowser2Vtbl              *lpWebBrowser2Vtbl;
00141     const IOleObjectVtbl                *lpOleObjectVtbl;
00142     const IOleInPlaceObjectVtbl         *lpOleInPlaceObjectVtbl;
00143     const IOleControlVtbl               *lpOleControlVtbl;
00144     const IPersistStorageVtbl           *lpPersistStorageVtbl;
00145     const IPersistMemoryVtbl            *lpPersistMemoryVtbl;
00146     const IPersistStreamInitVtbl        *lpPersistStreamInitVtbl;
00147     const IProvideClassInfo2Vtbl        *lpProvideClassInfoVtbl;
00148     const IViewObject2Vtbl              *lpViewObjectVtbl;
00149     const IOleInPlaceActiveObjectVtbl   *lpOleInPlaceActiveObjectVtbl;
00150     const IOleCommandTargetVtbl         *lpOleCommandTargetVtbl;
00151     const IServiceProviderVtbl          *lpServiceProviderVtbl;
00152     const IDataObjectVtbl               *lpDataObjectVtbl;
00153     HlinkFrame hlink_frame;
00154 
00155     LONG ref;
00156 
00157     INT version;
00158 
00159     IOleClientSite *client;
00160     IOleContainer *container;
00161     IOleInPlaceSite *inplace;
00162 
00163     /* window context */
00164 
00165     HWND frame_hwnd;
00166     IOleInPlaceUIWindow *uiwindow;
00167     RECT pos_rect;
00168     RECT clip_rect;
00169     OLEINPLACEFRAMEINFO frameinfo;
00170     SIZEL extent;
00171 
00172     HWND shell_embedding_hwnd;
00173 
00174     VARIANT_BOOL register_browser;
00175     VARIANT_BOOL visible;
00176     VARIANT_BOOL menu_bar;
00177     VARIANT_BOOL address_bar;
00178     VARIANT_BOOL status_bar;
00179     VARIANT_BOOL tool_bar;
00180     VARIANT_BOOL full_screen;
00181     VARIANT_BOOL theater_mode;
00182 
00183     DocHost doc_host;
00184 };
00185 
00186 struct InternetExplorer {
00187     const IWebBrowser2Vtbl *lpWebBrowser2Vtbl;
00188     HlinkFrame hlink_frame;
00189 
00190     LONG ref;
00191 
00192     HWND frame_hwnd;
00193     HWND status_hwnd;
00194     HMENU menu;
00195 
00196     DocHost doc_host;
00197 };
00198 
00199 #define WEBBROWSER(x)   ((IWebBrowser*)                 &(x)->lpWebBrowser2Vtbl)
00200 #define WEBBROWSER2(x)  ((IWebBrowser2*)                &(x)->lpWebBrowser2Vtbl)
00201 #define OLEOBJ(x)       ((IOleObject*)                  &(x)->lpOleObjectVtbl)
00202 #define INPLACEOBJ(x)   ((IOleInPlaceObject*)           &(x)->lpOleInPlaceObjectVtbl)
00203 #define CONTROL(x)      ((IOleControl*)                 &(x)->lpOleControlVtbl)
00204 #define PERSTORAGE(x)   ((IPersistStorage*)             &(x)->lpPersistStorageVtbl)
00205 #define PERMEMORY(x)    ((IPersistMemory*)              &(x)->lpPersistMemoryVtbl)
00206 #define PERSTRINIT(x)   ((IPersistStreamInit*)          &(x)->lpPersistStreamInitVtbl)
00207 #define CLASSINFO(x)    ((IProvideClassInfo2*)          &(x)->lpProvideClassInfoVtbl)
00208 #define CONPTCONT(x)    ((IConnectionPointContainer*)   &(x)->lpConnectionPointContainerVtbl)
00209 #define VIEWOBJ(x)      ((IViewObject*)                 &(x)->lpViewObjectVtbl);
00210 #define VIEWOBJ2(x)     ((IViewObject2*)                &(x)->lpViewObjectVtbl);
00211 #define ACTIVEOBJ(x)    ((IOleInPlaceActiveObject*)     &(x)->lpOleInPlaceActiveObjectVtbl)
00212 #define OLECMD(x)       ((IOleCommandTarget*)           &(x)->lpOleCommandTargetVtbl)
00213 #define DATAOBJECT(x)   ((IDataObject*)                 &(x)->lpDataObjectVtbl)
00214 
00215 #define CLIENTSITE(x)   ((IOleClientSite*)              &(x)->lpOleClientSiteVtbl)
00216 #define INPLACESITE(x)  ((IOleInPlaceSite*)             &(x)->lpOleInPlaceSiteVtbl)
00217 #define DOCHOSTUI(x)    ((IDocHostUIHandler*)           &(x)->lpDocHostUIHandlerVtbl)
00218 #define DOCHOSTUI2(x)   ((IDocHostUIHandler2*)          &(x)->lpDocHostUIHandlerVtbl)
00219 #define DOCSITE(x)      ((IOleDocumentSite*)            &(x)->lpOleDocumentSiteVtbl)
00220 #define CLDISP(x)       ((IDispatch*)                   &(x)->lpDispatchVtbl)
00221 #define PROPNOTIF(x)    ((IPropertyNotifySink*)         &(x)->lpIPropertyNotifySinkVtbl)
00222 #define SERVPROV(x)     ((IServiceProvider*)            &(x)->lpServiceProviderVtbl)
00223 
00224 #define INPLACEFRAME(x) ((IOleInPlaceFrame*)            &(x)->lpOleInPlaceFrameVtbl)
00225 
00226 #define HLINKFRAME(x)   ((IHlinkFrame*)                 &(x)->lpIHlinkFrameVtbl)
00227 #define TARGETFRAME2(x) ((ITargetFrame2*)               &(x)->lpITargetFrame2Vtbl)
00228 
00229 void WebBrowser_OleObject_Init(WebBrowser*);
00230 void WebBrowser_ViewObject_Init(WebBrowser*);
00231 void WebBrowser_DataObject_Init(WebBrowser*);
00232 void WebBrowser_Persist_Init(WebBrowser*);
00233 void WebBrowser_ClassInfo_Init(WebBrowser*);
00234 
00235 void WebBrowser_OleObject_Destroy(WebBrowser*);
00236 
00237 void DocHost_Init(DocHost*,IDispatch*,const IDocHostContainerVtbl*);
00238 void DocHost_ClientSite_Init(DocHost*);
00239 void DocHost_Frame_Init(DocHost*);
00240 void release_dochost_client(DocHost*);
00241 
00242 void DocHost_Release(DocHost*);
00243 void DocHost_ClientSite_Release(DocHost*);
00244 
00245 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*);
00246 void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
00247 
00248 void HlinkFrame_Init(HlinkFrame*,IUnknown*,DocHost*);
00249 BOOL HlinkFrame_QI(HlinkFrame*,REFIID,void**);
00250 
00251 HRESULT WebBrowserV1_Create(IUnknown*,REFIID,void**);
00252 HRESULT WebBrowserV2_Create(IUnknown*,REFIID,void**);
00253 
00254 void create_doc_view_hwnd(DocHost*);
00255 void deactivate_document(DocHost*);
00256 HRESULT dochost_object_available(DocHost*,IUnknown*);
00257 void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*);
00258 HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*);
00259 HRESULT go_home(DocHost*);
00260 void set_doc_state(DocHost*,READYSTATE);
00261 
00262 #define WM_DOCHOSTTASK (WM_USER+0x300)
00263 void push_dochost_task(DocHost*,task_header_t*,task_proc_t,BOOL);
00264 LRESULT  process_dochost_task(DocHost*,LPARAM);
00265 
00266 HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**);
00267 void InternetExplorer_WebBrowser_Init(InternetExplorer*);
00268 
00269 HRESULT CUrlHistory_Create(IUnknown*,REFIID,void**);
00270 
00271 HRESULT InternetShortcut_Create(IUnknown*,REFIID,void**);
00272 
00273 HRESULT TaskbarList_Create(IUnknown*,REFIID,void**);
00274 
00275 #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
00276 #define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
00277 
00278 /**********************************************************************
00279  * Dll lifetime tracking declaration for shdocvw.dll
00280  */
00281 extern LONG SHDOCVW_refCount;
00282 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount ); }
00283 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount ); }
00284 
00285 extern HINSTANCE shdocvw_hinstance;
00286 extern void register_iewindow_class(void);
00287 extern void unregister_iewindow_class(void);
00288 extern HRESULT update_ie_statustext(InternetExplorer*, LPCWSTR);
00289 
00290 HRESULT register_class_object(BOOL);
00291 HRESULT get_typeinfo(ITypeInfo**);
00292 DWORD register_iexplore(BOOL);
00293 
00294 const char *debugstr_variant(const VARIANT*);
00295 
00296 /* memory allocation functions */
00297 
00298 static inline void *heap_alloc(size_t len)
00299 {
00300     return HeapAlloc(GetProcessHeap(), 0, len);
00301 }
00302 
00303 static inline void *heap_alloc_zero(size_t len)
00304 {
00305     return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
00306 }
00307 
00308 static inline void *heap_realloc(void *mem, size_t len)
00309 {
00310     return HeapReAlloc(GetProcessHeap(), 0, mem, len);
00311 }
00312 
00313 static inline BOOL heap_free(void *mem)
00314 {
00315     return HeapFree(GetProcessHeap(), 0, mem);
00316 }
00317 
00318 static inline LPWSTR heap_strdupW(LPCWSTR str)
00319 {
00320     LPWSTR ret = NULL;
00321 
00322     if(str) {
00323         DWORD size;
00324 
00325         size = (strlenW(str)+1)*sizeof(WCHAR);
00326         ret = heap_alloc(size);
00327         memcpy(ret, str, size);
00328     }
00329 
00330     return ret;
00331 }
00332 
00333 static inline LPWSTR co_strdupW(LPCWSTR str)
00334 {
00335     WCHAR *ret = CoTaskMemAlloc((strlenW(str) + 1)*sizeof(WCHAR));
00336     if (ret)
00337         lstrcpyW(ret, str);
00338     return ret;
00339 }
00340 
00341 static inline LPWSTR co_strdupAtoW(LPCSTR str)
00342 {
00343     INT len;
00344     WCHAR *ret;
00345     len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
00346     ret = CoTaskMemAlloc(len*sizeof(WCHAR));
00347     if (ret)
00348         MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
00349     return ret;
00350 }
00351 
00352 static inline LPSTR co_strdupWtoA(LPCWSTR str)
00353 {
00354     INT len;
00355     CHAR *ret;
00356     len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
00357     ret = CoTaskMemAlloc(len);
00358     if (ret)
00359         WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
00360     return ret;
00361 }
00362 
00363 #endif /* __WINE_SHDOCVW_H */

Generated on Sat May 19 2012 04:24:02 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.