Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenolewnd.c
Go to the documentation of this file.
00001 /* 00002 * Copyright 2005 Jacek Caban 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00017 */ 00018 00019 #include "config.h" 00020 00021 #include <stdarg.h> 00022 #include <stdio.h> 00023 00024 #define COBJMACROS 00025 00026 #include "windef.h" 00027 #include "winbase.h" 00028 #include "winuser.h" 00029 #include "ole2.h" 00030 00031 #include "wine/debug.h" 00032 00033 #include "mshtml_private.h" 00034 #include "resource.h" 00035 00036 WINE_DEFAULT_DEBUG_CHANNEL(mshtml); 00037 00038 /********************************************************** 00039 * IOleInPlaceActiveObject implementation 00040 */ 00041 00042 #define ACTOBJ_THIS(iface) DEFINE_THIS(HTMLDocument, OleInPlaceActiveObject, iface) 00043 00044 static HRESULT WINAPI OleInPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface, REFIID riid, void **ppvObject) 00045 { 00046 HTMLDocument *This = ACTOBJ_THIS(iface); 00047 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject); 00048 } 00049 00050 static ULONG WINAPI OleInPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface) 00051 { 00052 HTMLDocument *This = ACTOBJ_THIS(iface); 00053 return IHTMLDocument2_AddRef(HTMLDOC(This)); 00054 } 00055 00056 static ULONG WINAPI OleInPlaceActiveObject_Release(IOleInPlaceActiveObject *iface) 00057 { 00058 HTMLDocument *This = ACTOBJ_THIS(iface); 00059 return IHTMLDocument2_Release(HTMLDOC(This)); 00060 } 00061 00062 static HRESULT WINAPI OleInPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface, HWND *phwnd) 00063 { 00064 HTMLDocument *This = ACTOBJ_THIS(iface); 00065 00066 TRACE("(%p)->(%p)\n", This, phwnd); 00067 00068 if(!phwnd) 00069 return E_INVALIDARG; 00070 00071 if(!This->doc_obj->in_place_active) { 00072 *phwnd = NULL; 00073 return E_FAIL; 00074 } 00075 00076 *phwnd = This->doc_obj->hwnd; 00077 return S_OK; 00078 } 00079 00080 static HRESULT WINAPI OleInPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface, BOOL fEnterMode) 00081 { 00082 HTMLDocument *This = ACTOBJ_THIS(iface); 00083 FIXME("(%p)->(%x)\n", This, fEnterMode); 00084 return E_NOTIMPL; 00085 } 00086 00087 static HRESULT WINAPI OleInPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface, LPMSG lpmsg) 00088 { 00089 HTMLDocument *This = ACTOBJ_THIS(iface); 00090 FIXME("(%p)->(%p)\n", This, lpmsg); 00091 return E_NOTIMPL; 00092 } 00093 00094 static HRESULT WINAPI OleInPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface, 00095 BOOL fActivate) 00096 { 00097 HTMLDocument *This = ACTOBJ_THIS(iface); 00098 00099 TRACE("(%p)->(%x)\n", This, fActivate); 00100 00101 if(This->doc_obj->hostui) 00102 IDocHostUIHandler_OnFrameWindowActivate(This->doc_obj->hostui, fActivate); 00103 00104 return S_OK; 00105 } 00106 00107 static HRESULT WINAPI OleInPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate) 00108 { 00109 HTMLDocument *This = ACTOBJ_THIS(iface); 00110 FIXME("(%p)->(%x)\n", This, fActivate); 00111 return E_NOTIMPL; 00112 } 00113 00114 static HRESULT WINAPI OleInPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface, LPCRECT prcBorder, 00115 IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow) 00116 { 00117 HTMLDocument *This = ACTOBJ_THIS(iface); 00118 FIXME("(%p)->(%p %p %x)\n", This, prcBorder, pUIWindow, fFrameWindow); 00119 return E_NOTIMPL; 00120 } 00121 00122 static HRESULT WINAPI OleInPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface, BOOL fEnable) 00123 { 00124 HTMLDocument *This = ACTOBJ_THIS(iface); 00125 FIXME("(%p)->(%x)\n", This, fEnable); 00126 return E_NOTIMPL; 00127 } 00128 00129 static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = { 00130 OleInPlaceActiveObject_QueryInterface, 00131 OleInPlaceActiveObject_AddRef, 00132 OleInPlaceActiveObject_Release, 00133 OleInPlaceActiveObject_GetWindow, 00134 OleInPlaceActiveObject_ContextSensitiveHelp, 00135 OleInPlaceActiveObject_TranslateAccelerator, 00136 OleInPlaceActiveObject_OnFrameWindowActivate, 00137 OleInPlaceActiveObject_OnDocWindowActivate, 00138 OleInPlaceActiveObject_ResizeBorder, 00139 OleInPlaceActiveObject_EnableModeless 00140 }; 00141 00142 #undef ACTOBJ_THIS 00143 00144 /********************************************************** 00145 * IOleInPlaceObjectWindowless implementation 00146 */ 00147 00148 #define OLEINPLACEWND_THIS(iface) DEFINE_THIS(HTMLDocument, OleInPlaceObjectWindowless, iface) 00149 00150 static HRESULT WINAPI OleInPlaceObjectWindowless_QueryInterface(IOleInPlaceObjectWindowless *iface, 00151 REFIID riid, void **ppvObject) 00152 { 00153 HTMLDocument *This = OLEINPLACEWND_THIS(iface); 00154 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject); 00155 } 00156 00157 static ULONG WINAPI OleInPlaceObjectWindowless_AddRef(IOleInPlaceObjectWindowless *iface) 00158 { 00159 HTMLDocument *This = OLEINPLACEWND_THIS(iface); 00160 return IHTMLDocument2_AddRef(HTMLDOC(This)); 00161 } 00162 00163 static ULONG WINAPI OleInPlaceObjectWindowless_Release(IOleInPlaceObjectWindowless *iface) 00164 { 00165 HTMLDocument *This = OLEINPLACEWND_THIS(iface); 00166 return IHTMLDocument2_Release(HTMLDOC(This)); 00167 } 00168 00169 static HRESULT WINAPI OleInPlaceObjectWindowless_GetWindow(IOleInPlaceObjectWindowless *iface, 00170 HWND *phwnd) 00171 { 00172 HTMLDocument *This = OLEINPLACEWND_THIS(iface); 00173 return IOleWindow_GetWindow(OLEWIN(This), phwnd); 00174 } 00175 00176 static HRESULT WINAPI OleInPlaceObjectWindowless_ContextSensitiveHelp(IOleInPlaceObjectWindowless *iface, 00177 BOOL fEnterMode) 00178 { 00179 HTMLDocument *This = OLEINPLACEWND_THIS(iface); 00180 return IOleWindow_ContextSensitiveHelp(OLEWIN(This), fEnterMode); 00181 } 00182 00183 static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceObjectWindowless *iface) 00184 { 00185 HTMLDocument *This = OLEINPLACEWND_THIS(iface); 00186 00187 TRACE("(%p)\n", This); 00188 00189 if(This->doc_obj->ui_active) 00190 IOleDocumentView_UIActivate(DOCVIEW(This), FALSE); 00191 This->doc_obj->window_active = FALSE; 00192 00193 if(!This->doc_obj->in_place_active) 00194 return S_OK; 00195 00196 if(This->doc_obj->frame) 00197 IOleInPlaceFrame_Release(This->doc_obj->frame); 00198 00199 if(This->doc_obj->hwnd) { 00200 ShowWindow(This->doc_obj->hwnd, SW_HIDE); 00201 SetWindowPos(This->doc_obj->hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); 00202 } 00203 00204 This->doc_obj->focus = FALSE; 00205 notif_focus(This->doc_obj); 00206 00207 This->doc_obj->in_place_active = FALSE; 00208 if(This->doc_obj->ipsite) { 00209 IOleInPlaceSiteEx *ipsiteex; 00210 HRESULT hres; 00211 00212 hres = IOleInPlaceSite_QueryInterface(This->doc_obj->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex); 00213 if(SUCCEEDED(hres)) { 00214 IOleInPlaceSiteEx_OnInPlaceDeactivateEx(ipsiteex, TRUE); 00215 IOleInPlaceSiteEx_Release(ipsiteex); 00216 }else { 00217 IOleInPlaceSite_OnInPlaceDeactivate(This->doc_obj->ipsite); 00218 } 00219 } 00220 00221 return S_OK; 00222 } 00223 00224 static HRESULT WINAPI OleInPlaceObjectWindowless_UIDeactivate(IOleInPlaceObjectWindowless *iface) 00225 { 00226 HTMLDocument *This = OLEINPLACEWND_THIS(iface); 00227 FIXME("(%p)\n", This); 00228 return E_NOTIMPL; 00229 } 00230 00231 static HRESULT WINAPI OleInPlaceObjectWindowless_SetObjectRects(IOleInPlaceObjectWindowless *iface, 00232 LPCRECT lprcPosRect, LPCRECT lprcClipRect) 00233 { 00234 HTMLDocument *This = OLEINPLACEWND_THIS(iface); 00235 FIXME("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect); 00236 return E_NOTIMPL; 00237 } 00238 00239 static HRESULT WINAPI OleInPlaceObjectWindowless_ReactivateAndUndo(IOleInPlaceObjectWindowless *iface) 00240 { 00241 HTMLDocument *This = OLEINPLACEWND_THIS(iface); 00242 FIXME("(%p)\n", This); 00243 return E_NOTIMPL; 00244 } 00245 00246 static HRESULT WINAPI OleInPlaceObjectWindowless_OnWindowMessage(IOleInPlaceObjectWindowless *iface, 00247 UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *lpResult) 00248 { 00249 HTMLDocument *This = OLEINPLACEWND_THIS(iface); 00250 FIXME("(%p)->(%u %lu %lu %p)\n", This, msg, wParam, lParam, lpResult); 00251 return E_NOTIMPL; 00252 } 00253 00254 static HRESULT WINAPI OleInPlaceObjectWindowless_GetDropTarget(IOleInPlaceObjectWindowless *iface, 00255 IDropTarget **ppDropTarget) 00256 { 00257 HTMLDocument *This = OLEINPLACEWND_THIS(iface); 00258 FIXME("(%p)->(%p)\n", This, ppDropTarget); 00259 return E_NOTIMPL; 00260 } 00261 00262 static const IOleInPlaceObjectWindowlessVtbl OleInPlaceObjectWindowlessVtbl = { 00263 OleInPlaceObjectWindowless_QueryInterface, 00264 OleInPlaceObjectWindowless_AddRef, 00265 OleInPlaceObjectWindowless_Release, 00266 OleInPlaceObjectWindowless_GetWindow, 00267 OleInPlaceObjectWindowless_ContextSensitiveHelp, 00268 OleInPlaceObjectWindowless_InPlaceDeactivate, 00269 OleInPlaceObjectWindowless_UIDeactivate, 00270 OleInPlaceObjectWindowless_SetObjectRects, 00271 OleInPlaceObjectWindowless_ReactivateAndUndo, 00272 OleInPlaceObjectWindowless_OnWindowMessage, 00273 OleInPlaceObjectWindowless_GetDropTarget 00274 }; 00275 00276 #undef INPLACEWIN_THIS 00277 00278 void HTMLDocument_Window_Init(HTMLDocument *This) 00279 { 00280 This->lpOleInPlaceActiveObjectVtbl = &OleInPlaceActiveObjectVtbl; 00281 This->lpOleInPlaceObjectWindowlessVtbl = &OleInPlaceObjectWindowlessVtbl; 00282 } Generated on Fri May 25 2012 04:23:14 for ReactOS by
1.7.6.1
|