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
);
182 if(!This
->in_place_active
)
186 IOleInPlaceFrame_Release(This
->frame
);
189 ShowWindow(This
->hwnd
, SW_HIDE
);
190 SetWindowPos(This
->hwnd
, HWND_TOPMOST
, 0, 0, 0, 0, SWP_NOSIZE
| SWP_NOMOVE
| SWP_NOACTIVATE
);
193 This
->in_place_active
= FALSE
;
195 IOleInPlaceSite_OnInPlaceDeactivate(This
->ipsite
);
200 static HRESULT WINAPI
OleInPlaceObjectWindowless_UIDeactivate(IOleInPlaceObjectWindowless
*iface
)
202 HTMLDocument
*This
= OLEINPLACEWND_THIS(iface
);
203 FIXME("(%p)\n", This
);
207 static HRESULT WINAPI
OleInPlaceObjectWindowless_SetObjectRects(IOleInPlaceObjectWindowless
*iface
,
208 LPCRECT lprcPosRect
, LPCRECT lprcClipRect
)
210 HTMLDocument
*This
= OLEINPLACEWND_THIS(iface
);
211 FIXME("(%p)->(%p %p)\n", This
, lprcPosRect
, lprcClipRect
);
215 static HRESULT WINAPI
OleInPlaceObjectWindowless_ReactivateAndUndo(IOleInPlaceObjectWindowless
*iface
)
217 HTMLDocument
*This
= OLEINPLACEWND_THIS(iface
);
218 FIXME("(%p)\n", This
);
222 static HRESULT WINAPI
OleInPlaceObjectWindowless_OnWindowMessage(IOleInPlaceObjectWindowless
*iface
,
223 UINT msg
, WPARAM wParam
, LPARAM lParam
, LRESULT
*lpResult
)
225 HTMLDocument
*This
= OLEINPLACEWND_THIS(iface
);
226 FIXME("(%p)->(%u %u %lu %p)\n", This
, msg
, wParam
, lParam
, lpResult
);
230 static HRESULT WINAPI
OleInPlaceObjectWindowless_GetDropTarget(IOleInPlaceObjectWindowless
*iface
,
231 IDropTarget
**ppDropTarget
)
233 HTMLDocument
*This
= OLEINPLACEWND_THIS(iface
);
234 FIXME("(%p)->(%p)\n", This
, ppDropTarget
);
238 static IOleInPlaceObjectWindowlessVtbl OleInPlaceObjectWindowlessVtbl
= {
239 OleInPlaceObjectWindowless_QueryInterface
,
240 OleInPlaceObjectWindowless_AddRef
,
241 OleInPlaceObjectWindowless_Release
,
242 OleInPlaceObjectWindowless_GetWindow
,
243 OleInPlaceObjectWindowless_ContextSensitiveHelp
,
244 OleInPlaceObjectWindowless_InPlaceDeactivate
,
245 OleInPlaceObjectWindowless_UIDeactivate
,
246 OleInPlaceObjectWindowless_SetObjectRects
,
247 OleInPlaceObjectWindowless_ReactivateAndUndo
,
248 OleInPlaceObjectWindowless_OnWindowMessage
,
249 OleInPlaceObjectWindowless_GetDropTarget
252 #undef INPLACEWIN_THIS
254 void HTMLDocument_Window_Init(HTMLDocument
*This
)
256 This
->lpOleInPlaceActiveObjectVtbl
= &OleInPlaceActiveObjectVtbl
;
257 This
->lpOleInPlaceObjectWindowlessVtbl
= &OleInPlaceObjectWindowlessVtbl
;