2 * Copyright 2014 Piotr Caban for CodeWeavers
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "oleacc_private.h"
22 IAccessible IAccessible_iface
;
23 IOleWindow IOleWindow_iface
;
28 static inline Window
* impl_from_Window(IAccessible
*iface
)
30 return CONTAINING_RECORD(iface
, Window
, IAccessible_iface
);
33 static HRESULT WINAPI
Window_QueryInterface(IAccessible
*iface
, REFIID riid
, void **ppv
)
35 Window
*This
= impl_from_Window(iface
);
37 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
39 if(IsEqualIID(riid
, &IID_IAccessible
) ||
40 IsEqualIID(riid
, &IID_IDispatch
) ||
41 IsEqualIID(riid
, &IID_IUnknown
)) {
43 }else if(IsEqualIID(riid
, &IID_IOleWindow
)) {
44 *ppv
= &This
->IOleWindow_iface
;
46 WARN("no interface: %s\n", debugstr_guid(riid
));
51 IAccessible_AddRef(iface
);
55 static ULONG WINAPI
Window_AddRef(IAccessible
*iface
)
57 Window
*This
= impl_from_Window(iface
);
58 ULONG ref
= InterlockedIncrement(&This
->ref
);
60 TRACE("(%p) ref = %u\n", This
, ref
);
64 static ULONG WINAPI
Window_Release(IAccessible
*iface
)
66 Window
*This
= impl_from_Window(iface
);
67 ULONG ref
= InterlockedDecrement(&This
->ref
);
69 TRACE("(%p) ref = %u\n", This
, ref
);
76 static HRESULT WINAPI
Window_GetTypeInfoCount(IAccessible
*iface
, UINT
*pctinfo
)
78 Window
*This
= impl_from_Window(iface
);
79 FIXME("(%p)->(%p)\n", This
, pctinfo
);
83 static HRESULT WINAPI
Window_GetTypeInfo(IAccessible
*iface
,
84 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
86 Window
*This
= impl_from_Window(iface
);
87 FIXME("(%p)->(%u %x %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
91 static HRESULT WINAPI
Window_GetIDsOfNames(IAccessible
*iface
, REFIID riid
,
92 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
94 Window
*This
= impl_from_Window(iface
);
95 FIXME("(%p)->(%s %p %u %x %p)\n", This
, debugstr_guid(riid
),
96 rgszNames
, cNames
, lcid
, rgDispId
);
100 static HRESULT WINAPI
Window_Invoke(IAccessible
*iface
, DISPID dispIdMember
,
101 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
102 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
104 Window
*This
= impl_from_Window(iface
);
105 FIXME("(%p)->(%x %s %x %x %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
106 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
110 static HRESULT WINAPI
Window_get_accParent(IAccessible
*iface
, IDispatch
**ppdispParent
)
112 Window
*This
= impl_from_Window(iface
);
113 FIXME("(%p)->(%p)\n", This
, ppdispParent
);
117 static HRESULT WINAPI
Window_get_accChildCount(IAccessible
*iface
, LONG
*pcountChildren
)
119 Window
*This
= impl_from_Window(iface
);
120 FIXME("(%p)->(%p)\n", This
, pcountChildren
);
124 static HRESULT WINAPI
Window_get_accChild(IAccessible
*iface
,
125 VARIANT varChildID
, IDispatch
**ppdispChild
)
127 Window
*This
= impl_from_Window(iface
);
128 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varChildID
), ppdispChild
);
132 static HRESULT WINAPI
Window_get_accName(IAccessible
*iface
, VARIANT varID
, BSTR
*pszName
)
134 Window
*This
= impl_from_Window(iface
);
135 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pszName
);
139 static HRESULT WINAPI
Window_get_accValue(IAccessible
*iface
, VARIANT varID
, BSTR
*pszValue
)
141 Window
*This
= impl_from_Window(iface
);
142 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pszValue
);
146 static HRESULT WINAPI
Window_get_accDescription(IAccessible
*iface
,
147 VARIANT varID
, BSTR
*pszDescription
)
149 Window
*This
= impl_from_Window(iface
);
150 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pszDescription
);
154 static HRESULT WINAPI
Window_get_accRole(IAccessible
*iface
, VARIANT varID
, VARIANT
*pvarRole
)
156 Window
*This
= impl_from_Window(iface
);
157 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pvarRole
);
161 static HRESULT WINAPI
Window_get_accState(IAccessible
*iface
, VARIANT varID
, VARIANT
*pvarState
)
163 Window
*This
= impl_from_Window(iface
);
164 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pvarState
);
168 static HRESULT WINAPI
Window_get_accHelp(IAccessible
*iface
, VARIANT varID
, BSTR
*pszHelp
)
170 Window
*This
= impl_from_Window(iface
);
171 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pszHelp
);
175 static HRESULT WINAPI
Window_get_accHelpTopic(IAccessible
*iface
,
176 BSTR
*pszHelpFile
, VARIANT varID
, LONG
*pidTopic
)
178 Window
*This
= impl_from_Window(iface
);
179 FIXME("(%p)->(%p %s %p)\n", This
, pszHelpFile
, debugstr_variant(&varID
), pidTopic
);
183 static HRESULT WINAPI
Window_get_accKeyboardShortcut(IAccessible
*iface
,
184 VARIANT varID
, BSTR
*pszKeyboardShortcut
)
186 Window
*This
= impl_from_Window(iface
);
187 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pszKeyboardShortcut
);
191 static HRESULT WINAPI
Window_get_accFocus(IAccessible
*iface
, VARIANT
*pvarID
)
193 Window
*This
= impl_from_Window(iface
);
194 FIXME("(%p)->(%p)\n", This
, pvarID
);
198 static HRESULT WINAPI
Window_get_accSelection(IAccessible
*iface
, VARIANT
*pvarID
)
200 Window
*This
= impl_from_Window(iface
);
201 FIXME("(%p)->(%p)\n", This
, pvarID
);
205 static HRESULT WINAPI
Window_get_accDefaultAction(IAccessible
*iface
,
206 VARIANT varID
, BSTR
*pszDefaultAction
)
208 Window
*This
= impl_from_Window(iface
);
209 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pszDefaultAction
);
213 static HRESULT WINAPI
Window_accSelect(IAccessible
*iface
, LONG flagsSelect
, VARIANT varID
)
215 Window
*This
= impl_from_Window(iface
);
216 FIXME("(%p)->(%x %s)\n", This
, flagsSelect
, debugstr_variant(&varID
));
220 static HRESULT WINAPI
Window_accLocation(IAccessible
*iface
, LONG
*pxLeft
,
221 LONG
*pyTop
, LONG
*pcxWidth
, LONG
*pcyHeight
, VARIANT varID
)
223 Window
*This
= impl_from_Window(iface
);
224 FIXME("(%p)->(%p %p %p %p %s)\n", This
, pxLeft
, pyTop
,
225 pcxWidth
, pcyHeight
, debugstr_variant(&varID
));
229 static HRESULT WINAPI
Window_accNavigate(IAccessible
*iface
,
230 LONG navDir
, VARIANT varStart
, VARIANT
*pvarEnd
)
232 Window
*This
= impl_from_Window(iface
);
233 FIXME("(%p)->(%d %s %p)\n", This
, navDir
, debugstr_variant(&varStart
), pvarEnd
);
237 static HRESULT WINAPI
Window_accHitTest(IAccessible
*iface
,
238 LONG xLeft
, LONG yTop
, VARIANT
*pvarID
)
240 Window
*This
= impl_from_Window(iface
);
241 FIXME("(%p)->(%d %d %p)\n", This
, xLeft
, yTop
, pvarID
);
245 static HRESULT WINAPI
Window_accDoDefaultAction(IAccessible
*iface
, VARIANT varID
)
247 Window
*This
= impl_from_Window(iface
);
248 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&varID
));
252 static HRESULT WINAPI
Window_put_accName(IAccessible
*iface
, VARIANT varID
, BSTR pszName
)
254 Window
*This
= impl_from_Window(iface
);
255 FIXME("(%p)->(%s %s)\n", This
, debugstr_variant(&varID
), debugstr_w(pszName
));
259 static HRESULT WINAPI
Window_put_accValue(IAccessible
*iface
, VARIANT varID
, BSTR pszValue
)
261 Window
*This
= impl_from_Window(iface
);
262 FIXME("(%p)->(%s %s)\n", This
, debugstr_variant(&varID
), debugstr_w(pszValue
));
266 static const IAccessibleVtbl WindowVtbl
= {
267 Window_QueryInterface
,
270 Window_GetTypeInfoCount
,
272 Window_GetIDsOfNames
,
274 Window_get_accParent
,
275 Window_get_accChildCount
,
279 Window_get_accDescription
,
283 Window_get_accHelpTopic
,
284 Window_get_accKeyboardShortcut
,
286 Window_get_accSelection
,
287 Window_get_accDefaultAction
,
292 Window_accDoDefaultAction
,
297 static inline Window
* impl_from_Window_OleWindow(IOleWindow
*iface
)
299 return CONTAINING_RECORD(iface
, Window
, IOleWindow_iface
);
302 static HRESULT WINAPI
Window_OleWindow_QueryInterface(IOleWindow
*iface
, REFIID riid
, void **ppv
)
304 Window
*This
= impl_from_Window_OleWindow(iface
);
305 return IAccessible_QueryInterface(&This
->IAccessible_iface
, riid
, ppv
);
308 static ULONG WINAPI
Window_OleWindow_AddRef(IOleWindow
*iface
)
310 Window
*This
= impl_from_Window_OleWindow(iface
);
311 return IAccessible_AddRef(&This
->IAccessible_iface
);
314 static ULONG WINAPI
Window_OleWindow_Release(IOleWindow
*iface
)
316 Window
*This
= impl_from_Window_OleWindow(iface
);
317 return IAccessible_Release(&This
->IAccessible_iface
);
320 static HRESULT WINAPI
Window_OleWindow_GetWindow(IOleWindow
*iface
, HWND
*phwnd
)
322 Window
*This
= impl_from_Window_OleWindow(iface
);
323 FIXME("(%p)->(%p)\n", This
, phwnd
);
327 static HRESULT WINAPI
Window_OleWindow_ContextSensitiveHelp(IOleWindow
*iface
, BOOL fEnterMode
)
329 Window
*This
= impl_from_Window_OleWindow(iface
);
330 FIXME("(%p)->(%x)\n", This
, fEnterMode
);
334 static const IOleWindowVtbl WindowOleWindowVtbl
= {
335 Window_OleWindow_QueryInterface
,
336 Window_OleWindow_AddRef
,
337 Window_OleWindow_Release
,
338 Window_OleWindow_GetWindow
,
339 Window_OleWindow_ContextSensitiveHelp
342 HRESULT
create_window_object(HWND hwnd
, const IID
*iid
, void **obj
)
350 window
= heap_alloc_zero(sizeof(Window
));
352 return E_OUTOFMEMORY
;
354 window
->IAccessible_iface
.lpVtbl
= &WindowVtbl
;
355 window
->IOleWindow_iface
.lpVtbl
= &WindowOleWindowVtbl
;
358 hres
= IAccessible_QueryInterface(&window
->IAccessible_iface
, iid
, obj
);
359 IAccessible_Release(&window
->IAccessible_iface
);