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
35 #include "wine/debug.h"
37 #include "mshtml_private.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
41 /**********************************************************
42 * IOleInPlaceActiveObject implementation
45 #define ACTOBJ_THIS(iface) DEFINE_THIS(HTMLDocument, OleInPlaceActiveObject, iface)
47 static HRESULT WINAPI OleInPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface, REFIID riid, void **ppvObject)
49 HTMLDocument *This = ACTOBJ_THIS(iface);
50 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
53 static ULONG WINAPI OleInPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface)
55 HTMLDocument *This = ACTOBJ_THIS(iface);
56 return IHTMLDocument2_AddRef(HTMLDOC(This));
59 static ULONG WINAPI OleInPlaceActiveObject_Release(IOleInPlaceActiveObject *iface)
61 HTMLDocument *This = ACTOBJ_THIS(iface);
62 return IHTMLDocument2_Release(HTMLDOC(This));
65 static HRESULT WINAPI OleInPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface, HWND *phwnd)
67 HTMLDocument *This = ACTOBJ_THIS(iface);
69 TRACE("(%p)->(%p)\n", This, phwnd);
74 if(!This->in_place_active) {
83 static HRESULT WINAPI OleInPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface, BOOL fEnterMode)
85 HTMLDocument *This = ACTOBJ_THIS(iface);
86 FIXME("(%p)->(%x)\n", This, fEnterMode);
90 static HRESULT WINAPI OleInPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface, LPMSG lpmsg)
92 HTMLDocument *This = ACTOBJ_THIS(iface);
93 FIXME("(%p)->(%p)\n", This, lpmsg);
97 static HRESULT WINAPI OleInPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate)
99 HTMLDocument *This = ACTOBJ_THIS(iface);
100 FIXME("(%p)->(%x)\n", This, fActivate);
104 static HRESULT WINAPI OleInPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate)
106 HTMLDocument *This = ACTOBJ_THIS(iface);
107 FIXME("(%p)->(%x)\n", This, fActivate);
111 static HRESULT WINAPI OleInPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface, LPCRECT prcBorder,
112 IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow)
114 HTMLDocument *This = ACTOBJ_THIS(iface);
115 FIXME("(%p)->(%p %p %x)\n", This, prcBorder, pUIWindow, fFrameWindow);
119 static HRESULT WINAPI OleInPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface, BOOL fEnable)
121 HTMLDocument *This = ACTOBJ_THIS(iface);
122 FIXME("(%p)->(%x)\n", This, fEnable);
126 static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = {
127 OleInPlaceActiveObject_QueryInterface,
128 OleInPlaceActiveObject_AddRef,
129 OleInPlaceActiveObject_Release,
130 OleInPlaceActiveObject_GetWindow,
131 OleInPlaceActiveObject_ContextSensitiveHelp,
132 OleInPlaceActiveObject_TranslateAccelerator,
133 OleInPlaceActiveObject_OnFrameWindowActivate,
134 OleInPlaceActiveObject_OnDocWindowActivate,
135 OleInPlaceActiveObject_ResizeBorder,
136 OleInPlaceActiveObject_EnableModeless
141 /**********************************************************
142 * IOleInPlaceObjectWindowless implementation
145 #define OLEINPLACEWND_THIS(iface) DEFINE_THIS(HTMLDocument, OleInPlaceObjectWindowless, iface)
147 static HRESULT WINAPI OleInPlaceObjectWindowless_QueryInterface(IOleInPlaceObjectWindowless *iface,
148 REFIID riid, void **ppvObject)
150 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
151 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
154 static ULONG WINAPI OleInPlaceObjectWindowless_AddRef(IOleInPlaceObjectWindowless *iface)
156 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
157 return IHTMLDocument2_AddRef(HTMLDOC(This));
160 static ULONG WINAPI OleInPlaceObjectWindowless_Release(IOleInPlaceObjectWindowless *iface)
162 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
163 return IHTMLDocument2_Release(HTMLDOC(This));
166 static HRESULT WINAPI OleInPlaceObjectWindowless_GetWindow(IOleInPlaceObjectWindowless *iface,
169 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
170 return IOleWindow_GetWindow(OLEWIN(This), phwnd);
173 static HRESULT WINAPI OleInPlaceObjectWindowless_ContextSensitiveHelp(IOleInPlaceObjectWindowless *iface,
176 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
177 return IOleWindow_ContextSensitiveHelp(OLEWIN(This), fEnterMode);
180 static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceObjectWindowless *iface)
182 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
184 TRACE("(%p)\n", This);
186 if(!This->in_place_active)
190 IOleInPlaceFrame_Release(This->frame);
193 ShowWindow(This->hwnd, SW_HIDE);
194 SetWindowPos(This->hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
197 This->in_place_active = FALSE;
199 IOleInPlaceSite_OnInPlaceDeactivate(This->ipsite);
204 static HRESULT WINAPI OleInPlaceObjectWindowless_UIDeactivate(IOleInPlaceObjectWindowless *iface)
206 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
207 FIXME("(%p)\n", This);
211 static HRESULT WINAPI OleInPlaceObjectWindowless_SetObjectRects(IOleInPlaceObjectWindowless *iface,
212 LPCRECT lprcPosRect, LPCRECT lprcClipRect)
214 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
215 FIXME("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect);
219 static HRESULT WINAPI OleInPlaceObjectWindowless_ReactivateAndUndo(IOleInPlaceObjectWindowless *iface)
221 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
222 FIXME("(%p)\n", This);
226 static HRESULT WINAPI OleInPlaceObjectWindowless_OnWindowMessage(IOleInPlaceObjectWindowless *iface,
227 UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *lpResult)
229 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
230 FIXME("(%p)->(%u %u %lu %p)\n", This, msg, wParam, lParam, lpResult);
234 static HRESULT WINAPI OleInPlaceObjectWindowless_GetDropTarget(IOleInPlaceObjectWindowless *iface,
235 IDropTarget **ppDropTarget)
237 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
238 FIXME("(%p)->(%p)\n", This, ppDropTarget);
242 static IOleInPlaceObjectWindowlessVtbl OleInPlaceObjectWindowlessVtbl = {
243 OleInPlaceObjectWindowless_QueryInterface,
244 OleInPlaceObjectWindowless_AddRef,
245 OleInPlaceObjectWindowless_Release,
246 OleInPlaceObjectWindowless_GetWindow,
247 OleInPlaceObjectWindowless_ContextSensitiveHelp,
248 OleInPlaceObjectWindowless_InPlaceDeactivate,
249 OleInPlaceObjectWindowless_UIDeactivate,
250 OleInPlaceObjectWindowless_SetObjectRects,
251 OleInPlaceObjectWindowless_ReactivateAndUndo,
252 OleInPlaceObjectWindowless_OnWindowMessage,
253 OleInPlaceObjectWindowless_GetDropTarget
256 #undef INPLACEWIN_THIS
258 void HTMLDocument_Window_Init(HTMLDocument *This)
260 This->lpOleInPlaceActiveObjectVtbl = &OleInPlaceActiveObjectVtbl;
261 This->lpOleInPlaceObjectWindowlessVtbl = &OleInPlaceObjectWindowlessVtbl;