LibreOffice Module winaccessibility (master) 1
AccObjectManagerAgent.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
22
23#include <UAccCOM.h>
24
25using namespace com::sun::star::uno;
26using namespace com::sun::star::accessibility;
27
34 : pWinManager(new AccObjectWinManager(this))
35{
36}
37
39{
40}
41
47void AccObjectManagerAgent::UpdateAccName( XAccessible* pXAcc )
48{
49 if( pWinManager )
50 pWinManager->UpdateAccName( pXAcc );
51}
52
58void AccObjectManagerAgent::UpdateAction( XAccessible* pXAcc )
59{
60 if( pWinManager )
61 pWinManager->UpdateAction( pXAcc );
62}
63
70void AccObjectManagerAgent::UpdateValue( XAccessible* pXAcc, Any pAny )
71{
72 if( pWinManager )
73 pWinManager->SetValue( pXAcc, pAny );
74}
75
82void AccObjectManagerAgent::UpdateValue( XAccessible* pXAcc )
83{
84 if( pWinManager )
85 pWinManager->UpdateValue( pXAcc );
86}
87
94void AccObjectManagerAgent::UpdateAccName( XAccessible* pXAcc, Any newName)
95{
96 if( pWinManager )
97 pWinManager->SetAccName( pXAcc, newName );
98}
99
108 XAccessible* pXAcc, XAccessible* pParentXAcc, HWND hWnd)
109{
110 if( pWinManager )
111 return pWinManager->InsertAccObj(pXAcc, pParentXAcc, hWnd);
112
113 return false;
114}
115
122void
123AccObjectManagerAgent::SaveTopWindowHandle(HWND hWnd, XAccessible* pXAcc)
124{
125 if( pWinManager )
126 pWinManager->SaveTopWindowHandle(hWnd, pXAcc);
127}
128
129
137bool
139{
140 if( pWinManager )
141 return pWinManager->InsertChildrenAccObj(pXAcc, hWnd);
142
143 return false;
144}
145
152void AccObjectManagerAgent::DeleteAccObj( XAccessible* pXAcc )
153{
154 if( pWinManager )
155 pWinManager->DeleteAccObj( pXAcc );
156}
157
165{
166 if( pWinManager )
167 pWinManager->DeleteChildrenAccObj( pXAcc );
168}
169
176void AccObjectManagerAgent::DecreaseState( XAccessible* pXAcc, sal_Int64 pState )
177{
178 if(pWinManager)
179 {
180 pWinManager->DecreaseState( pXAcc, pState );
181 }
182}
183
190void AccObjectManagerAgent::IncreaseState( XAccessible* pXAcc, sal_Int64 pState )
191{
192 if(pWinManager)
193 {
194 pWinManager->IncreaseState( pXAcc, pState );
195 }
196}
197
198void AccObjectManagerAgent::UpdateState( css::accessibility::XAccessible* pXAcc )
199{
200 if(pWinManager)
201 pWinManager->UpdateState(pXAcc);
202}
203
211{
212 if(pWinManager)
213 return pWinManager->NotifyAccEvent(pXAcc, eEvent);
214
215 return false;
216}
217
223bool AccObjectManagerAgent::IsContainer( XAccessible* pXAcc )
224{
225 if(pWinManager)
227
228 return false;
229}
230
237{
238 if(pWinManager)
239 return pWinManager->GetIMAccByXAcc(pXAcc);
240
241 return nullptr;
242}
243
250{
251 if(pWinManager)
252 pWinManager->NotifyDestroy(pXAcc);
253}
254
261{
262 if(pWinManager)
263 *pIMAcc = pWinManager->GetIAccessibleFromResID(childID);
264}
265
272 XAccessible* pXAcc, IAccessible** ppXI)
273{
274 if(pWinManager)
275 {
276 *ppXI = pWinManager->GetIMAccByXAcc(pXAcc);
277 if(*ppXI)
278 return true;
279 }
280 return false;
281}
282
283XAccessible* AccObjectManagerAgent::GetParentXAccessible( XAccessible* pXAcc )
284{
285 if(pWinManager)
286 return pWinManager->GetParentXAccessible( pXAcc );
287
288 return nullptr;
289}
290
291short AccObjectManagerAgent::GetParentRole( XAccessible* pXAcc )
292{
293 if(pWinManager)
294 return pWinManager->GetParentRole( pXAcc );
295
296 return -1;
297}
298
300{
301 if(pWinManager)
302 pWinManager->UpdateChildState( pXAcc );
303}
304
305
307{
308 if(pWinManager)
309 return pWinManager->IsSpecialToolbarItem(pXAcc);
310
311 return false;
312}
313
314short AccObjectManagerAgent::GetRole(XAccessible* pXAcc)
315{
316 if(pWinManager)
317 return AccObjectWinManager::GetRole( pXAcc );
318
319 return -1;
320}
321
322XAccessible* AccObjectManagerAgent::GetAccDocByAccTopWin( XAccessible* pXAcc )
323{
324 if (pWinManager)
325 {
326 return pWinManager->GetAccDocByAccTopWin( pXAcc );
327 }
328 return nullptr;
329}
331{
332 if (pWinManager)
333 {
334 return pWinManager->IsTopWinAcc( pXAcc );
335 }
336 return false;
337}
338
340{
341 if(pWinManager)
343
344 return false;
345}
346
353 sal_Int64 hWnd, sal_Int64 lParam, sal_Int64 wParam)
354{
355 return static_cast<sal_Int64>(pWinManager->Get_ToATInterface(
356 static_cast<HWND>(reinterpret_cast<void*>(hWnd)), lParam, wParam));
357}
358
359/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
short GetParentRole(css::accessibility::XAccessible *pXAcc)
css::accessibility::XAccessible * GetAccDocByAccTopWin(css::accessibility::XAccessible *pXAcc)
bool IsSpecialToolbarItem(css::accessibility::XAccessible *pXAcc)
virtual void GetIAccessibleFromResID(long childID, IMAccessible **)
Return com object interface by querying child id.
void DecreaseState(css::accessibility::XAccessible *pXAcc, sal_Int64 pState)
Interface of decreasing MSAA state when some UNO state is decreased.
short GetRole(css::accessibility::XAccessible *pXAcc)
virtual void DeleteAccObj(css::accessibility::XAccessible *pXAcc)
When a new UNO XAccessible object is destroyed, we delete its corresponding com object and remove it ...
void UpdateValue(css::accessibility::XAccessible *pXAcc)
virtual bool GetIAccessibleFromXAccessible(css::accessibility::XAccessible *pXAcc, IAccessible **ppIA)
Return object interface by querying interface.
void UpdateAction(css::accessibility::XAccessible *pXAcc)
Interface of updating MSAA name when UNO action changed event occurs.
void UpdateAccName(css::accessibility::XAccessible *pXAcc, css::uno::Any newName)
bool IsStateManageDescendant(css::accessibility::XAccessible *pXAcc)
void SaveTopWindowHandle(HWND hWnd, css::accessibility::XAccessible *pXAcc)
save the pair <topwindowhandle, XAccessible>
void IncreaseState(css::accessibility::XAccessible *pXAcc, sal_Int64 pState)
Interface of increasing MSAA name when some UNO state is increased.
virtual IMAccessible * GetIMAccByXAcc(css::accessibility::XAccessible *pXAcc)
Return com object interface by querying XAccessible interface.
AccObjectManagerAgent()
Construction/Destruction.
sal_Int64 Get_ToATInterface(sal_Int64 hWnd, sal_Int64 lParam, sal_Int64 wParam)
Implementation of interface XMSAAService's method getAccObjectPtr() that returns the corresponding CO...
void DeleteChildrenAccObj(css::accessibility::XAccessible *pXAcc)
When new UNO children XAccessible objects are destroyed, we delete their corresponding com objects an...
virtual bool InsertAccObj(css::accessibility::XAccessible *pXAcc, css::accessibility::XAccessible *pParentXAcc, HWND hWnd=nullptr)
When a new UNO XAccessible object is found by listener, we create a corresponding com object and inse...
bool IsContainer(css::accessibility::XAccessible *pXAcc)
Judge whether a XAccessible object is a container object.
css::accessibility::XAccessible * GetParentXAccessible(css::accessibility::XAccessible *pXAcc)
bool NotifyAccEvent(UnoMSAAEvent eEvent, css::accessibility::XAccessible *pXAcc=nullptr)
Interface of notify MSAA event when some UNO event occurred.
void UpdateChildState(css::accessibility::XAccessible *pXAcc)
bool IsTopWinAcc(css::accessibility::XAccessible *pXAcc)
std::unique_ptr< AccObjectWinManager > pWinManager
void NotifyDestroy(css::accessibility::XAccessible *pXAcc)
Notify manager when a XAccessible object is destroying.
bool InsertChildrenAccObj(css::accessibility::XAccessible *pXAcc, HWND hWnd=nullptr)
When a UNO XAccessible object's new children are found by listener, we create corresponding com objec...
void UpdateState(css::accessibility::XAccessible *pXAcc)
static short GetRole(css::accessibility::XAccessible *pXAcc)
static bool IsStateManageDescendant(css::accessibility::XAccessible *pAccessible)
Judge if a XAccessible object has ManageDescendant event.
static bool IsContainer(css::accessibility::XAccessible *pAccessible)
Judge if a XAccessible object is a container object.
UnoMSAAEvent