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
21 #include "oleacc_private.h"
23 #include "wine/unicode.h"
24 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(oleacc
);
29 IAccessible IAccessible_iface
;
30 IOleWindow IOleWindow_iface
;
35 static inline Window
* impl_from_Window(IAccessible
*iface
)
37 return CONTAINING_RECORD(iface
, Window
, IAccessible_iface
);
40 static HRESULT WINAPI
Window_QueryInterface(IAccessible
*iface
, REFIID riid
, void **ppv
)
42 Window
*This
= impl_from_Window(iface
);
44 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
46 if(IsEqualIID(riid
, &IID_IAccessible
) ||
47 IsEqualIID(riid
, &IID_IDispatch
) ||
48 IsEqualIID(riid
, &IID_IUnknown
)) {
50 }else if(IsEqualIID(riid
, &IID_IOleWindow
)) {
51 *ppv
= &This
->IOleWindow_iface
;
53 WARN("no interface: %s\n", debugstr_guid(riid
));
58 IAccessible_AddRef(iface
);
62 static ULONG WINAPI
Window_AddRef(IAccessible
*iface
)
64 Window
*This
= impl_from_Window(iface
);
65 ULONG ref
= InterlockedIncrement(&This
->ref
);
67 TRACE("(%p) ref = %u\n", This
, ref
);
71 static ULONG WINAPI
Window_Release(IAccessible
*iface
)
73 Window
*This
= impl_from_Window(iface
);
74 ULONG ref
= InterlockedDecrement(&This
->ref
);
76 TRACE("(%p) ref = %u\n", This
, ref
);
83 static HRESULT WINAPI
Window_GetTypeInfoCount(IAccessible
*iface
, UINT
*pctinfo
)
85 Window
*This
= impl_from_Window(iface
);
86 FIXME("(%p)->(%p)\n", This
, pctinfo
);
90 static HRESULT WINAPI
Window_GetTypeInfo(IAccessible
*iface
,
91 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
93 Window
*This
= impl_from_Window(iface
);
94 FIXME("(%p)->(%u %x %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
98 static HRESULT WINAPI
Window_GetIDsOfNames(IAccessible
*iface
, REFIID riid
,
99 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
101 Window
*This
= impl_from_Window(iface
);
102 FIXME("(%p)->(%s %p %u %x %p)\n", This
, debugstr_guid(riid
),
103 rgszNames
, cNames
, lcid
, rgDispId
);
107 static HRESULT WINAPI
Window_Invoke(IAccessible
*iface
, DISPID dispIdMember
,
108 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
109 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
111 Window
*This
= impl_from_Window(iface
);
112 FIXME("(%p)->(%x %s %x %x %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
113 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
117 static HRESULT WINAPI
Window_get_accParent(IAccessible
*iface
, IDispatch
**ppdispParent
)
119 Window
*This
= impl_from_Window(iface
);
120 FIXME("(%p)->(%p)\n", This
, ppdispParent
);
124 static HRESULT WINAPI
Window_get_accChildCount(IAccessible
*iface
, LONG
*pcountChildren
)
126 Window
*This
= impl_from_Window(iface
);
127 FIXME("(%p)->(%p)\n", This
, pcountChildren
);
131 static HRESULT WINAPI
Window_get_accChild(IAccessible
*iface
,
132 VARIANT varChildID
, IDispatch
**ppdispChild
)
134 Window
*This
= impl_from_Window(iface
);
135 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varChildID
), ppdispChild
);
139 static HRESULT WINAPI
Window_get_accName(IAccessible
*iface
, VARIANT varID
, BSTR
*pszName
)
141 Window
*This
= impl_from_Window(iface
);
142 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pszName
);
146 static HRESULT WINAPI
Window_get_accValue(IAccessible
*iface
, VARIANT varID
, BSTR
*pszValue
)
148 Window
*This
= impl_from_Window(iface
);
149 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pszValue
);
153 static HRESULT WINAPI
Window_get_accDescription(IAccessible
*iface
,
154 VARIANT varID
, BSTR
*pszDescription
)
156 Window
*This
= impl_from_Window(iface
);
157 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pszDescription
);
161 static HRESULT WINAPI
Window_get_accRole(IAccessible
*iface
, VARIANT varID
, VARIANT
*pvarRole
)
163 Window
*This
= impl_from_Window(iface
);
164 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pvarRole
);
168 static HRESULT WINAPI
Window_get_accState(IAccessible
*iface
, VARIANT varID
, VARIANT
*pvarState
)
170 Window
*This
= impl_from_Window(iface
);
171 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pvarState
);
175 static HRESULT WINAPI
Window_get_accHelp(IAccessible
*iface
, VARIANT varID
, BSTR
*pszHelp
)
177 Window
*This
= impl_from_Window(iface
);
178 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pszHelp
);
182 static HRESULT WINAPI
Window_get_accHelpTopic(IAccessible
*iface
,
183 BSTR
*pszHelpFile
, VARIANT varID
, LONG
*pidTopic
)
185 Window
*This
= impl_from_Window(iface
);
186 FIXME("(%p)->(%p %s %p)\n", This
, pszHelpFile
, debugstr_variant(&varID
), pidTopic
);
190 static HRESULT WINAPI
Window_get_accKeyboardShortcut(IAccessible
*iface
,
191 VARIANT varID
, BSTR
*pszKeyboardShortcut
)
193 Window
*This
= impl_from_Window(iface
);
194 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pszKeyboardShortcut
);
198 static HRESULT WINAPI
Window_get_accFocus(IAccessible
*iface
, VARIANT
*pvarID
)
200 Window
*This
= impl_from_Window(iface
);
201 FIXME("(%p)->(%p)\n", This
, pvarID
);
205 static HRESULT WINAPI
Window_get_accSelection(IAccessible
*iface
, VARIANT
*pvarID
)
207 Window
*This
= impl_from_Window(iface
);
208 FIXME("(%p)->(%p)\n", This
, pvarID
);
212 static HRESULT WINAPI
Window_get_accDefaultAction(IAccessible
*iface
,
213 VARIANT varID
, BSTR
*pszDefaultAction
)
215 Window
*This
= impl_from_Window(iface
);
216 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&varID
), pszDefaultAction
);
220 static HRESULT WINAPI
Window_accSelect(IAccessible
*iface
, LONG flagsSelect
, VARIANT varID
)
222 Window
*This
= impl_from_Window(iface
);
223 FIXME("(%p)->(%x %s)\n", This
, flagsSelect
, debugstr_variant(&varID
));
227 static HRESULT WINAPI
Window_accLocation(IAccessible
*iface
, LONG
*pxLeft
,
228 LONG
*pyTop
, LONG
*pcxWidth
, LONG
*pcyHeight
, VARIANT varID
)
230 Window
*This
= impl_from_Window(iface
);
231 FIXME("(%p)->(%p %p %p %p %s)\n", This
, pxLeft
, pyTop
,
232 pcxWidth
, pcyHeight
, debugstr_variant(&varID
));
236 static HRESULT WINAPI
Window_accNavigate(IAccessible
*iface
,
237 LONG navDir
, VARIANT varStart
, VARIANT
*pvarEnd
)
239 Window
*This
= impl_from_Window(iface
);
240 FIXME("(%p)->(%d %s %p)\n", This
, navDir
, debugstr_variant(&varStart
), pvarEnd
);
244 static HRESULT WINAPI
Window_accHitTest(IAccessible
*iface
,
245 LONG xLeft
, LONG yTop
, VARIANT
*pvarID
)
247 Window
*This
= impl_from_Window(iface
);
248 FIXME("(%p)->(%d %d %p)\n", This
, xLeft
, yTop
, pvarID
);
252 static HRESULT WINAPI
Window_accDoDefaultAction(IAccessible
*iface
, VARIANT varID
)
254 Window
*This
= impl_from_Window(iface
);
255 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&varID
));
259 static HRESULT WINAPI
Window_put_accName(IAccessible
*iface
, VARIANT varID
, BSTR pszName
)
261 Window
*This
= impl_from_Window(iface
);
262 FIXME("(%p)->(%s %s)\n", This
, debugstr_variant(&varID
), debugstr_w(pszName
));
266 static HRESULT WINAPI
Window_put_accValue(IAccessible
*iface
, VARIANT varID
, BSTR pszValue
)
268 Window
*This
= impl_from_Window(iface
);
269 FIXME("(%p)->(%s %s)\n", This
, debugstr_variant(&varID
), debugstr_w(pszValue
));
273 static const IAccessibleVtbl WindowVtbl
= {
274 Window_QueryInterface
,
277 Window_GetTypeInfoCount
,
279 Window_GetIDsOfNames
,
281 Window_get_accParent
,
282 Window_get_accChildCount
,
286 Window_get_accDescription
,
290 Window_get_accHelpTopic
,
291 Window_get_accKeyboardShortcut
,
293 Window_get_accSelection
,
294 Window_get_accDefaultAction
,
299 Window_accDoDefaultAction
,
304 static inline Window
* impl_from_Window_OleWindow(IOleWindow
*iface
)
306 return CONTAINING_RECORD(iface
, Window
, IOleWindow_iface
);
309 static HRESULT WINAPI
Window_OleWindow_QueryInterface(IOleWindow
*iface
, REFIID riid
, void **ppv
)
311 Window
*This
= impl_from_Window_OleWindow(iface
);
312 return IAccessible_QueryInterface(&This
->IAccessible_iface
, riid
, ppv
);
315 static ULONG WINAPI
Window_OleWindow_AddRef(IOleWindow
*iface
)
317 Window
*This
= impl_from_Window_OleWindow(iface
);
318 return IAccessible_AddRef(&This
->IAccessible_iface
);
321 static ULONG WINAPI
Window_OleWindow_Release(IOleWindow
*iface
)
323 Window
*This
= impl_from_Window_OleWindow(iface
);
324 return IAccessible_Release(&This
->IAccessible_iface
);
327 static HRESULT WINAPI
Window_OleWindow_GetWindow(IOleWindow
*iface
, HWND
*phwnd
)
329 Window
*This
= impl_from_Window_OleWindow(iface
);
330 FIXME("(%p)->(%p)\n", This
, phwnd
);
334 static HRESULT WINAPI
Window_OleWindow_ContextSensitiveHelp(IOleWindow
*iface
, BOOL fEnterMode
)
336 Window
*This
= impl_from_Window_OleWindow(iface
);
337 FIXME("(%p)->(%x)\n", This
, fEnterMode
);
341 static const IOleWindowVtbl WindowOleWindowVtbl
= {
342 Window_OleWindow_QueryInterface
,
343 Window_OleWindow_AddRef
,
344 Window_OleWindow_Release
,
345 Window_OleWindow_GetWindow
,
346 Window_OleWindow_ContextSensitiveHelp
349 HRESULT
create_window_object(HWND hwnd
, const IID
*iid
, void **obj
)
357 window
= heap_alloc_zero(sizeof(Window
));
359 return E_OUTOFMEMORY
;
361 window
->IAccessible_iface
.lpVtbl
= &WindowVtbl
;
362 window
->IOleWindow_iface
.lpVtbl
= &WindowOleWindowVtbl
;
365 hres
= IAccessible_QueryInterface(&window
->IAccessible_iface
, iid
, obj
);
366 IAccessible_Release(&window
->IAccessible_iface
);