ReactOS 0.4.15-dev-8058-ga7cbb60
olewnd.c
Go to the documentation of this file.
1/*
2 * Copyright 2005 Jacek Caban
3 *
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.
8 *
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.
13 *
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include "mshtml_private.h"
20
21/**********************************************************
22 * IOleInPlaceActiveObject implementation
23 */
24
26{
27 return CONTAINING_RECORD(iface, HTMLDocument, IOleInPlaceActiveObject_iface);
28}
29
31{
34}
35
37{
39 return htmldoc_addref(This);
40}
41
43{
45 return htmldoc_release(This);
46}
47
49{
51
52 TRACE("(%p)->(%p)\n", This, phwnd);
53
54 if(!phwnd)
55 return E_INVALIDARG;
56
57 if(!This->doc_obj->in_place_active) {
58 *phwnd = NULL;
59 return E_FAIL;
60 }
61
62 *phwnd = This->doc_obj->hwnd;
63 return S_OK;
64}
65
67{
69 FIXME("(%p)->(%x)\n", This, fEnterMode);
70 return E_NOTIMPL;
71}
72
74{
76 FIXME("(%p)->(%p)\n", This, lpmsg);
77 return E_NOTIMPL;
78}
79
81 BOOL fActivate)
82{
84
85 TRACE("(%p)->(%x)\n", This, fActivate);
86
87 if(This->doc_obj->hostui)
88 IDocHostUIHandler_OnFrameWindowActivate(This->doc_obj->hostui, fActivate);
89
90 return S_OK;
91}
92
94{
96 FIXME("(%p)->(%x)\n", This, fActivate);
97 return E_NOTIMPL;
98}
99
101 IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow)
102{
104 FIXME("(%p)->(%p %p %x)\n", This, prcBorder, pUIWindow, fFrameWindow);
105 return E_NOTIMPL;
106}
107
109{
111 FIXME("(%p)->(%x)\n", This, fEnable);
112 return E_NOTIMPL;
113}
114
115static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = {
126};
127
128/**********************************************************
129 * IOleInPlaceObjectWindowless implementation
130 */
131
133{
134 return CONTAINING_RECORD(iface, HTMLDocument, IOleInPlaceObjectWindowless_iface);
135}
136
138 REFIID riid, void **ppv)
139{
142}
143
145{
147 return htmldoc_addref(This);
148}
149
151{
153 return htmldoc_release(This);
154}
155
157 HWND *phwnd)
158{
160 return IOleInPlaceActiveObject_GetWindow(&This->IOleInPlaceActiveObject_iface, phwnd);
161}
162
164 BOOL fEnterMode)
165{
167 return IOleInPlaceActiveObject_ContextSensitiveHelp(&This->IOleInPlaceActiveObject_iface, fEnterMode);
168}
169
171{
173
174 TRACE("(%p)\n", This);
175
176 if(This->doc_obj->ui_active)
177 IOleDocumentView_UIActivate(&This->IOleDocumentView_iface, FALSE);
178 This->doc_obj->window_active = FALSE;
179
180 if(!This->doc_obj->in_place_active)
181 return S_OK;
182
183 if(This->doc_obj->frame) {
184 IOleInPlaceFrame_Release(This->doc_obj->frame);
185 This->doc_obj->frame = NULL;
186 }
187
188 if(This->doc_obj->hwnd) {
189 ShowWindow(This->doc_obj->hwnd, SW_HIDE);
190 SetWindowPos(This->doc_obj->hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
191 }
192
193 This->doc_obj->focus = FALSE;
194 notif_focus(This->doc_obj);
195
196 This->doc_obj->in_place_active = FALSE;
197 if(This->doc_obj->ipsite) {
198 IOleInPlaceSiteEx *ipsiteex;
200
201 hres = IOleInPlaceSite_QueryInterface(This->doc_obj->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex);
202 if(SUCCEEDED(hres)) {
203 IOleInPlaceSiteEx_OnInPlaceDeactivateEx(ipsiteex, TRUE);
204 IOleInPlaceSiteEx_Release(ipsiteex);
205 }else {
206 IOleInPlaceSite_OnInPlaceDeactivate(This->doc_obj->ipsite);
207 }
208 }
209
210 return S_OK;
211}
212
214{
216 FIXME("(%p)\n", This);
217 return E_NOTIMPL;
218}
219
221 LPCRECT lprcPosRect, LPCRECT lprcClipRect)
222{
224 FIXME("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect);
225 return E_NOTIMPL;
226}
227
229{
231 FIXME("(%p)\n", This);
232 return E_NOTIMPL;
233}
234
237{
239 FIXME("(%p)->(%u %lu %lu %p)\n", This, msg, wParam, lParam, lpResult);
240 return E_NOTIMPL;
241}
242
244 IDropTarget **ppDropTarget)
245{
247 FIXME("(%p)->(%p)\n", This, ppDropTarget);
248 return E_NOTIMPL;
249}
250
251static const IOleInPlaceObjectWindowlessVtbl OleInPlaceObjectWindowlessVtbl = {
263};
264
266{
267 This->IOleInPlaceActiveObject_iface.lpVtbl = &OleInPlaceActiveObjectVtbl;
268 This->IOleInPlaceObjectWindowless_iface.lpVtbl = &OleInPlaceObjectWindowlessVtbl;
269}
#define msg(x)
Definition: auth_time.c:54
#define FIXME(fmt,...)
Definition: debug.h:114
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hres
Definition: protocol.c:465
static HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv)
static ULONG htmldoc_addref(HTMLDocument *This)
void notif_focus(HTMLDocumentObj *) DECLSPEC_HIDDEN
Definition: view.c:130
static ULONG htmldoc_release(HTMLDocument *This)
unsigned int UINT
Definition: ndis.h:50
static ULONG WINAPI OleInPlaceObjectWindowless_Release(IOleInPlaceObjectWindowless *iface)
Definition: olewnd.c:150
static HRESULT WINAPI OleInPlaceObjectWindowless_GetDropTarget(IOleInPlaceObjectWindowless *iface, IDropTarget **ppDropTarget)
Definition: olewnd.c:243
static HRESULT WINAPI OleInPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate)
Definition: olewnd.c:80
static ULONG WINAPI OleInPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface)
Definition: olewnd.c:36
static HRESULT WINAPI OleInPlaceObjectWindowless_ContextSensitiveHelp(IOleInPlaceObjectWindowless *iface, BOOL fEnterMode)
Definition: olewnd.c:163
static HRESULT WINAPI OleInPlaceObjectWindowless_GetWindow(IOleInPlaceObjectWindowless *iface, HWND *phwnd)
Definition: olewnd.c:156
static HRESULT WINAPI OleInPlaceObjectWindowless_OnWindowMessage(IOleInPlaceObjectWindowless *iface, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *lpResult)
Definition: olewnd.c:235
static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl
Definition: olewnd.c:115
static const IOleInPlaceObjectWindowlessVtbl OleInPlaceObjectWindowlessVtbl
Definition: olewnd.c:251
static HTMLDocument * impl_from_IOleInPlaceActiveObject(IOleInPlaceActiveObject *iface)
Definition: olewnd.c:25
static HRESULT WINAPI OleInPlaceObjectWindowless_UIDeactivate(IOleInPlaceObjectWindowless *iface)
Definition: olewnd.c:213
static ULONG WINAPI OleInPlaceActiveObject_Release(IOleInPlaceActiveObject *iface)
Definition: olewnd.c:42
static HRESULT WINAPI OleInPlaceObjectWindowless_SetObjectRects(IOleInPlaceObjectWindowless *iface, LPCRECT lprcPosRect, LPCRECT lprcClipRect)
Definition: olewnd.c:220
static HRESULT WINAPI OleInPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface, BOOL fEnable)
Definition: olewnd.c:108
static HRESULT WINAPI OleInPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate)
Definition: olewnd.c:93
static ULONG WINAPI OleInPlaceObjectWindowless_AddRef(IOleInPlaceObjectWindowless *iface)
Definition: olewnd.c:144
static HRESULT WINAPI OleInPlaceObjectWindowless_QueryInterface(IOleInPlaceObjectWindowless *iface, REFIID riid, void **ppv)
Definition: olewnd.c:137
static HRESULT WINAPI OleInPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface, LPMSG lpmsg)
Definition: olewnd.c:73
static HRESULT WINAPI OleInPlaceObjectWindowless_ReactivateAndUndo(IOleInPlaceObjectWindowless *iface)
Definition: olewnd.c:228
static HRESULT WINAPI OleInPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface, LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow)
Definition: olewnd.c:100
static HRESULT WINAPI OleInPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface, HWND *phwnd)
Definition: olewnd.c:48
static HTMLDocument * impl_from_IOleInPlaceObjectWindowless(IOleInPlaceObjectWindowless *iface)
Definition: olewnd.c:132
static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceObjectWindowless *iface)
Definition: olewnd.c:170
static HRESULT WINAPI OleInPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface, BOOL fEnterMode)
Definition: olewnd.c:66
void HTMLDocument_Window_Init(HTMLDocument *This)
Definition: olewnd.c:265
static HRESULT WINAPI OleInPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface, REFIID riid, void **ppv)
Definition: olewnd.c:30
#define REFIID
Definition: guiddef.h:118
#define TRACE(s)
Definition: solgame.cpp:4
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define SW_HIDE
Definition: winuser.h:768
#define SWP_NOACTIVATE
Definition: winuser.h:1242
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define HWND_TOPMOST
Definition: winuser.h:1208
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOMOVE
Definition: winuser.h:1244
#define SWP_NOSIZE
Definition: winuser.h:1245