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)
81 static HRESULT WINAPI OleInPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface, BOOL fEnterMode)
83 HTMLDocument *This = ACTOBJ_THIS(iface);
84 FIXME("(%p)->(%x)\n", This, fEnterMode);
88 static HRESULT WINAPI OleInPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface, LPMSG lpmsg)
90 HTMLDocument *This = ACTOBJ_THIS(iface);
91 FIXME("(%p)->(%p)\n", This, lpmsg);
95 static HRESULT WINAPI OleInPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate)
97 HTMLDocument *This = ACTOBJ_THIS(iface);
98 FIXME("(%p)->(%x)\n", This, fActivate);
102 static HRESULT WINAPI OleInPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate)
104 HTMLDocument *This = ACTOBJ_THIS(iface);
105 FIXME("(%p)->(%x)\n", This, fActivate);
109 static HRESULT WINAPI OleInPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface, LPCRECT prcBorder,
110 IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow)
112 HTMLDocument *This = ACTOBJ_THIS(iface);
113 FIXME("(%p)->(%p %p %x)\n", This, prcBorder, pUIWindow, fFrameWindow);
117 static HRESULT WINAPI OleInPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface, BOOL fEnable)
119 HTMLDocument *This = ACTOBJ_THIS(iface);
120 FIXME("(%p)->(%x)\n", This, fEnable);
124 static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = {
125 OleInPlaceActiveObject_QueryInterface,
126 OleInPlaceActiveObject_AddRef,
127 OleInPlaceActiveObject_Release,
128 OleInPlaceActiveObject_GetWindow,
129 OleInPlaceActiveObject_ContextSensitiveHelp,
130 OleInPlaceActiveObject_TranslateAccelerator,
131 OleInPlaceActiveObject_OnFrameWindowActivate,
132 OleInPlaceActiveObject_OnDocWindowActivate,
133 OleInPlaceActiveObject_ResizeBorder,
134 OleInPlaceActiveObject_EnableModeless
139 /**********************************************************
140 * IOleInPlaceObjectWindowless implementation
143 #define OLEINPLACEWND_THIS(iface) DEFINE_THIS(HTMLDocument, OleInPlaceObjectWindowless, iface)
145 static HRESULT WINAPI OleInPlaceObjectWindowless_QueryInterface(IOleInPlaceObjectWindowless *iface,
146 REFIID riid, void **ppvObject)
148 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
149 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
152 static ULONG WINAPI OleInPlaceObjectWindowless_AddRef(IOleInPlaceObjectWindowless *iface)
154 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
155 return IHTMLDocument2_AddRef(HTMLDOC(This));
158 static ULONG WINAPI OleInPlaceObjectWindowless_Release(IOleInPlaceObjectWindowless *iface)
160 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
161 return IHTMLDocument2_Release(HTMLDOC(This));
164 static HRESULT WINAPI OleInPlaceObjectWindowless_GetWindow(IOleInPlaceObjectWindowless *iface,
167 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
168 return IOleWindow_GetWindow(OLEWIN(This), phwnd);
171 static HRESULT WINAPI OleInPlaceObjectWindowless_ContextSensitiveHelp(IOleInPlaceObjectWindowless *iface,
174 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
175 return IOleWindow_ContextSensitiveHelp(OLEWIN(This), fEnterMode);
178 static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceObjectWindowless *iface)
180 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
182 TRACE("(%p)\n", This);
184 if(!This->in_place_active)
188 IOleInPlaceFrame_Release(This->frame);
191 ShowWindow(This->hwnd, SW_HIDE);
192 SetWindowPos(This->hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
195 This->in_place_active = FALSE;
197 IOleInPlaceSite_OnInPlaceDeactivate(This->ipsite);
202 static HRESULT WINAPI OleInPlaceObjectWindowless_UIDeactivate(IOleInPlaceObjectWindowless *iface)
204 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
205 FIXME("(%p)\n", This);
209 static HRESULT WINAPI OleInPlaceObjectWindowless_SetObjectRects(IOleInPlaceObjectWindowless *iface,
210 LPCRECT lprcPosRect, LPCRECT lprcClipRect)
212 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
213 FIXME("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect);
217 static HRESULT WINAPI OleInPlaceObjectWindowless_ReactivateAndUndo(IOleInPlaceObjectWindowless *iface)
219 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
220 FIXME("(%p)\n", This);
224 static HRESULT WINAPI OleInPlaceObjectWindowless_OnWindowMessage(IOleInPlaceObjectWindowless *iface,
225 UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *lpResult)
227 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
228 FIXME("(%p)->(%u %u %lu %p)\n", This, msg, wParam, lParam, lpResult);
232 static HRESULT WINAPI OleInPlaceObjectWindowless_GetDropTarget(IOleInPlaceObjectWindowless *iface,
233 IDropTarget **ppDropTarget)
235 HTMLDocument *This = OLEINPLACEWND_THIS(iface);
236 FIXME("(%p)->(%p)\n", This, ppDropTarget);
240 static IOleInPlaceObjectWindowlessVtbl OleInPlaceObjectWindowlessVtbl = {
241 OleInPlaceObjectWindowless_QueryInterface,
242 OleInPlaceObjectWindowless_AddRef,
243 OleInPlaceObjectWindowless_Release,
244 OleInPlaceObjectWindowless_GetWindow,
245 OleInPlaceObjectWindowless_ContextSensitiveHelp,
246 OleInPlaceObjectWindowless_InPlaceDeactivate,
247 OleInPlaceObjectWindowless_UIDeactivate,
248 OleInPlaceObjectWindowless_SetObjectRects,
249 OleInPlaceObjectWindowless_ReactivateAndUndo,
250 OleInPlaceObjectWindowless_OnWindowMessage,
251 OleInPlaceObjectWindowless_GetDropTarget
254 #undef INPLACEWIN_THIS
256 void HTMLDocument_Window_Init(HTMLDocument *This)
258 This->lpOleInPlaceActiveObjectVtbl = &OleInPlaceActiveObjectVtbl;
259 This->lpOleInPlaceObjectWindowlessVtbl = &OleInPlaceObjectWindowlessVtbl;