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
31 #include "wine/debug.h"
33 #include "mshtml_private.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37 /**********************************************************
38 * IOleInPlaceActiveObject implementation
41 #define ACTOBJ_THIS(iface) DEFINE_THIS(HTMLDocument, OleInPlaceActiveObject, iface)
43 static HRESULT WINAPI OleInPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface, REFIID riid, void **ppvObject)
45 HTMLDocument *This = ACTOBJ_THIS(iface);
46 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
49 static ULONG WINAPI OleInPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface)
51 HTMLDocument *This = ACTOBJ_THIS(iface);
52 return IHTMLDocument2_AddRef(HTMLDOC(This));
55 static ULONG WINAPI OleInPlaceActiveObject_Release(IOleInPlaceActiveObject *iface)
57 HTMLDocument *This = ACTOBJ_THIS(iface);
58 return IHTMLDocument2_Release(HTMLDOC(This));
61 static HRESULT WINAPI OleInPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface, HWND *phwnd)
63 HTMLDocument *This = ACTOBJ_THIS(iface);
65 TRACE("(%p)->(%p)\n", This, phwnd);
70 if(!This->in_place_active) {
79 static HRESULT WINAPI OleInPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface, BOOL fEnterMode)
81 HTMLDocument *This = ACTOBJ_THIS(iface);
82 FIXME("(%p)->(%x)\n", This, fEnterMode);
86 static HRESULT WINAPI OleInPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface, LPMSG lpmsg)
88 HTMLDocument *This = ACTOBJ_THIS(iface);
89 FIXME("(%p)->(%p)\n", This, lpmsg);
93 static HRESULT WINAPI OleInPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate)
95 HTMLDocument *This = ACTOBJ_THIS(iface);
96 FIXME("(%p)->(%x)\n", This, fActivate);
100 static HRESULT WINAPI OleInPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate)
102 HTMLDocument *This = ACTOBJ_THIS(iface);
103 FIXME("(%p)->(%x)\n", This, fActivate);
107 static HRESULT WINAPI OleInPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface, LPCRECT prcBorder,
108 IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow)
110 HTMLDocument *This = ACTOBJ_THIS(iface);
111 FIXME("(%p)->(%p %p %x)\n", This, prcBorder, pUIWindow, fFrameWindow);
115 static HRESULT WINAPI OleInPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface, BOOL fEnable)
117 HTMLDocument *This = ACTOBJ_THIS(iface);
118 FIXME("(%p)->(%x)\n", This, fEnable);
122 static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = {
123 OleInPlaceActiveObject_QueryInterface,
124 OleInPlaceActiveObject_AddRef,
125 OleInPlaceActiveObject_Release,
126 OleInPlaceActiveObject_GetWindow,
127 OleInPlaceActiveObject_ContextSensitiveHelp,
128 OleInPlaceActiveObject_TranslateAccelerator,
129 OleInPlaceActiveObject_OnFrameWindowActivate,
130 OleInPlaceActiveObject_OnDocWindowActivate,
131 OleInPlaceActiveObject_ResizeBorder,
132 OleInPlaceActiveObject_EnableModeless
137 /**********************************************************
138 * IOleInPlaceObjectWindowless implementation
141 #define OLEINPLACEWND_THIS(iface) DEFINE_THIS(HTMLDocument, OleInPlaceObjectWindowless, iface)
143 static HRESULT WINAPI OleInPlaceObjectWindowless_QueryInterface(IOleInPlaceObjectWindowless *iface,
144 REFIID riid, void **ppvObject)
146 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
147 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
150 static ULONG WINAPI OleInPlaceObjectWindowless_AddRef(IOleInPlaceObjectWindowless *iface)
152 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
153 return IHTMLDocument2_AddRef(HTMLDOC(This));
156 static ULONG WINAPI OleInPlaceObjectWindowless_Release(IOleInPlaceObjectWindowless *iface)
158 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
159 return IHTMLDocument2_Release(HTMLDOC(This));
162 static HRESULT WINAPI OleInPlaceObjectWindowless_GetWindow(IOleInPlaceObjectWindowless *iface,
165 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
166 return IOleWindow_GetWindow(OLEWIN(This), phwnd);
169 static HRESULT WINAPI OleInPlaceObjectWindowless_ContextSensitiveHelp(IOleInPlaceObjectWindowless *iface,
172 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
173 return IOleWindow_ContextSensitiveHelp(OLEWIN(This), fEnterMode);
176 static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceObjectWindowless *iface)
178 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
180 TRACE("(%p)\n", This);
183 IOleDocumentView_UIActivate(DOCVIEW(This), FALSE);
184 This->window_active = FALSE;
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;