solenv/clang-format/excludelist | 2 winaccessibility/Library_winaccessibility.mk | 1 winaccessibility/inc/AccComponentEventListener.hxx | 2 winaccessibility/inc/AccContainerEventListener.hxx | 2 winaccessibility/inc/AccDescendantManagerEventListener.hxx | 2 winaccessibility/inc/AccDialogEventListener.hxx | 2 winaccessibility/inc/AccEventListener.hxx | 8 winaccessibility/inc/AccFrameEventListener.hxx | 2 winaccessibility/inc/AccListEventListener.hxx | 2 winaccessibility/inc/AccMenuEventListener.hxx | 2 winaccessibility/inc/AccObject.hxx | 5 winaccessibility/inc/AccObjectContainerEventListener.hxx | 2 winaccessibility/inc/AccObjectManagerAgent.hxx | 99 --- winaccessibility/inc/AccObjectWinManager.hxx | 19 winaccessibility/inc/AccParagraphEventListener.hxx | 2 winaccessibility/inc/AccTableEventListener.hxx | 2 winaccessibility/inc/AccTextComponentEventListener.hxx | 2 winaccessibility/inc/AccTopWindowListener.hxx | 4 winaccessibility/inc/AccTreeEventListener.hxx | 2 winaccessibility/inc/AccWindowEventListener.hxx | 2 winaccessibility/source/UAccCOM/AccTable.cxx | 4 winaccessibility/source/UAccCOM/AccTableCell.cxx | 4 winaccessibility/source/UAccCOM/EnumVariant.cxx | 4 winaccessibility/source/UAccCOM/EnumVariant.h | 1 winaccessibility/source/UAccCOM/MAccessible.cxx | 30 winaccessibility/source/UAccCOM/MAccessible.h | 10 winaccessibility/source/UAccCOMIDL/UAccCOM.idl | 2 winaccessibility/source/service/AccComponentEventListener.cxx | 100 +-- winaccessibility/source/service/AccContainerEventListener.cxx | 106 +-- winaccessibility/source/service/AccDescendantManagerEventListener.cxx | 34 - winaccessibility/source/service/AccDialogEventListener.cxx | 10 winaccessibility/source/service/AccEventListener.cxx | 46 - winaccessibility/source/service/AccFrameEventListener.cxx | 16 winaccessibility/source/service/AccListEventListener.cxx | 22 winaccessibility/source/service/AccMenuEventListener.cxx | 14 winaccessibility/source/service/AccObject.cxx | 7 winaccessibility/source/service/AccObjectContainerEventListener.cxx | 8 winaccessibility/source/service/AccObjectManagerAgent.cxx | 318 ---------- winaccessibility/source/service/AccObjectWinManager.cxx | 47 - winaccessibility/source/service/AccParagraphEventListener.cxx | 14 winaccessibility/source/service/AccTableEventListener.cxx | 30 winaccessibility/source/service/AccTextComponentEventListener.cxx | 6 winaccessibility/source/service/AccTopWindowListener.cxx | 24 winaccessibility/source/service/AccTreeEventListener.cxx | 12 winaccessibility/source/service/AccWindowEventListener.cxx | 14 45 files changed, 305 insertions(+), 742 deletions(-)
New commits: commit 37b72ba4542ca8dc49d0121be995d9253c65d6ba Author: Michael Weghorn <[email protected]> AuthorDate: Mon Aug 7 21:43:23 2023 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Tue Aug 8 08:18:28 2023 +0200 wina11y: Drop AccObjectManagerAgent indirection `AccObjectManagerAgent` was holding an `AccObjectWinManager` object and forwarding everything to that one and the event listeners were holding a pointer to the `AccObjectManagerAgent` object. Drop this `AccObjectManagerAgent` indirection and let all of the classes that were interacting with the `AccObjectManagerAgent` directly interact with the `AccObjectWinManager` instead. The idea of having the agent seems to have been to have an abstraction layer and implement different accessible object managers for all platforms, but the agent already has quite some Windows-/IAccessible-specific code/interface and by now, the Linux VCL plugins and macOS have their own a11y bridges, so the TODO do implement this here for Linux as well seems outdated to me. Even if implementing this for Linux and/or macOS in a similar way, I don't see the need for the agent layer, but one way might be to just have an abstract base class (e.g. `AccObjectManager`) that `AccObjectWinManager` and implementations for other platforms derive from, and have the SalInstance return the platform-specific implementation that the `AccTopWindowListener` would then retrieve and pass on. Given that `AccObjectManagerAgent` was forwarding all calls to `AccObjectWinManager` and the methods and params are mostly the same by now (s.a. the preparatory commits), this change is mostly straightforward. A few notes: * `AccObjectManagerAgent::InsertAccObj` had a default nullptr value for the HWND that `AccObjectWinManager:InsertAccObj` didn't have yet, so add that. * `AccObjectManagerAgent::GetIAccessibleFromResID` had an out param instead of a return value; call sites were adapted to fit `AccObjectWinManager:GetIAccessibleFromResID`. * The `UpdateValue` and `UpdateAccName` methods taking 2 params are called `SetValue` and `SetAccName` in `AccObjectWinManager` instead, so adapt call sites accordingly. * prewin.h and postwin.h includes had to be added around the windows.h include in AccObjectWinManager.hxx (build would otherwise fail) * A few `AccObjectWinManager` methods had to be made virtual to make linking work. Change-Id: I88741bf416d4db25d78e973c0db060a828f27926 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155440 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index c49000bc3350..64eded82acab 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -15132,7 +15132,6 @@ winaccessibility/inc/AccContainerEventListener.hxx winaccessibility/inc/AccDescendantManagerEventListener.hxx winaccessibility/inc/AccObject.hxx winaccessibility/inc/AccObjectContainerEventListener.hxx -winaccessibility/inc/AccObjectManagerAgent.hxx winaccessibility/inc/AccObjectWinManager.hxx winaccessibility/source/UAccCOM/AccAction.cxx winaccessibility/source/UAccCOM/AccAction.h @@ -15168,7 +15167,6 @@ winaccessibility/source/service/AccFrameEventListener.cxx winaccessibility/source/service/AccListEventListener.cxx winaccessibility/source/service/AccMenuEventListener.cxx winaccessibility/source/service/AccObject.cxx -winaccessibility/source/service/AccObjectManagerAgent.cxx winaccessibility/source/service/AccObjectWinManager.cxx winaccessibility/source/service/AccParagraphEventListener.cxx winaccessibility/source/service/AccTableEventListener.cxx diff --git a/winaccessibility/Library_winaccessibility.mk b/winaccessibility/Library_winaccessibility.mk index 4b182a996419..fd4325845e80 100644 --- a/winaccessibility/Library_winaccessibility.mk +++ b/winaccessibility/Library_winaccessibility.mk @@ -29,7 +29,6 @@ $(eval $(call gb_Library_add_exception_objects,winaccessibility,\ winaccessibility/source/service/AccObject \ winaccessibility/source/service/ResIDGenerator \ winaccessibility/source/service/AccObjectWinManager \ - winaccessibility/source/service/AccObjectManagerAgent \ winaccessibility/source/service/AccEventListener \ winaccessibility/source/service/AccComponentEventListener \ winaccessibility/source/service/AccContainerEventListener \ diff --git a/winaccessibility/inc/AccComponentEventListener.hxx b/winaccessibility/inc/AccComponentEventListener.hxx index 72c4d8af12dc..72666b2a5690 100644 --- a/winaccessibility/inc/AccComponentEventListener.hxx +++ b/winaccessibility/inc/AccComponentEventListener.hxx @@ -36,7 +36,7 @@ class AccComponentEventListener : public AccEventListener private: static FILE *output, *output2, *output3, *outacc; //used for debugging public: - AccComponentEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + AccComponentEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); virtual ~AccComponentEventListener() override; // XAccessibleEventListener diff --git a/winaccessibility/inc/AccContainerEventListener.hxx b/winaccessibility/inc/AccContainerEventListener.hxx index 0ce0c217548a..dd89cb96049c 100644 --- a/winaccessibility/inc/AccContainerEventListener.hxx +++ b/winaccessibility/inc/AccContainerEventListener.hxx @@ -39,7 +39,7 @@ enum class UnoMSAAEvent; class AccContainerEventListener: public AccEventListener { public: - AccContainerEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + AccContainerEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); virtual ~AccContainerEventListener() override; //AccessibleEventListener diff --git a/winaccessibility/inc/AccDescendantManagerEventListener.hxx b/winaccessibility/inc/AccDescendantManagerEventListener.hxx index 4cae3c808dd0..f910c2e6447b 100644 --- a/winaccessibility/inc/AccDescendantManagerEventListener.hxx +++ b/winaccessibility/inc/AccDescendantManagerEventListener.hxx @@ -39,7 +39,7 @@ private: std::vector<com::sun::star::accessibility::XAccessible*> m_aUnselectedChildrenForDeletion; public: - AccDescendantManagerEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + AccDescendantManagerEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); virtual ~AccDescendantManagerEventListener() override; // XAccessibleEventListener diff --git a/winaccessibility/inc/AccDialogEventListener.hxx b/winaccessibility/inc/AccDialogEventListener.hxx index f2d7ff9a0005..8f47fa94ab4e 100644 --- a/winaccessibility/inc/AccDialogEventListener.hxx +++ b/winaccessibility/inc/AccDialogEventListener.hxx @@ -33,7 +33,7 @@ class AccDialogEventListener : public AccEventListener { public: - AccDialogEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + AccDialogEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); virtual ~AccDialogEventListener() override; //AccessibleEventListener diff --git a/winaccessibility/inc/AccEventListener.hxx b/winaccessibility/inc/AccEventListener.hxx index c786b6559ae1..e9dd0e64be2f 100644 --- a/winaccessibility/inc/AccEventListener.hxx +++ b/winaccessibility/inc/AccEventListener.hxx @@ -24,7 +24,7 @@ #include <cppuhelper/implbase.hxx> -class AccObjectManagerAgent; +class AccObjectWinManager; /** * AccEventListener is the general event listener for all controls. It defines the @@ -36,11 +36,11 @@ class AccEventListener : public ::cppu::WeakImplHelper<css::accessibility::XAcce protected: //accessible owner's pointer css::uno::Reference<css::accessibility::XAccessible> m_xAccessible; - //agent pointer for objects' manager - AccObjectManagerAgent* pAgent; + // pointer for object's manager + AccObjectWinManager* m_pObjManager; public: - AccEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + AccEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); virtual ~AccEventListener() override; // XEventListener diff --git a/winaccessibility/inc/AccFrameEventListener.hxx b/winaccessibility/inc/AccFrameEventListener.hxx index 111d1e81ced5..b575b57f50bd 100644 --- a/winaccessibility/inc/AccFrameEventListener.hxx +++ b/winaccessibility/inc/AccFrameEventListener.hxx @@ -33,7 +33,7 @@ class AccFrameEventListener : public AccEventListener { public: - AccFrameEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + AccFrameEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); virtual ~AccFrameEventListener() override; // XAccessibleEventListener diff --git a/winaccessibility/inc/AccListEventListener.hxx b/winaccessibility/inc/AccListEventListener.hxx index bd75a977c531..eb9911308d81 100644 --- a/winaccessibility/inc/AccListEventListener.hxx +++ b/winaccessibility/inc/AccListEventListener.hxx @@ -33,7 +33,7 @@ class AccListEventListener : public AccDescendantManagerEventListener { public: - AccListEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + AccListEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); virtual ~AccListEventListener() override; // XAccessibleEventListener diff --git a/winaccessibility/inc/AccMenuEventListener.hxx b/winaccessibility/inc/AccMenuEventListener.hxx index 354d7166029d..fbe4eb2900c2 100644 --- a/winaccessibility/inc/AccMenuEventListener.hxx +++ b/winaccessibility/inc/AccMenuEventListener.hxx @@ -33,7 +33,7 @@ class AccMenuEventListener : public AccComponentEventListener { public: - AccMenuEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + AccMenuEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); virtual ~AccMenuEventListener() override; //AccessibleEventListener diff --git a/winaccessibility/inc/AccObject.hxx b/winaccessibility/inc/AccObject.hxx index 53b1109b0d0e..65c8f5777331 100644 --- a/winaccessibility/inc/AccObject.hxx +++ b/winaccessibility/inc/AccObject.hxx @@ -37,7 +37,7 @@ #include <UAccCOM.h> class AccEventListener; -class AccObjectManagerAgent; +class AccObjectWinManager; class AccObject; typedef std::vector<AccObject *> IAccChildList; @@ -71,7 +71,8 @@ private: public: - AccObject ( css::accessibility::XAccessible* pXAcc = nullptr,AccObjectManagerAgent* pAgent = nullptr ,AccEventListener* accListener=nullptr); + AccObject(css::accessibility::XAccessible* pXAcc = nullptr, AccObjectWinManager* pManager = nullptr, + AccEventListener* accListener=nullptr); virtual ~AccObject(); bool UpdateAccessibleInfoFromUnoToMSAA( ); //implement accessible information mapping diff --git a/winaccessibility/inc/AccObjectContainerEventListener.hxx b/winaccessibility/inc/AccObjectContainerEventListener.hxx index 41baf99b40e4..37ab738068da 100644 --- a/winaccessibility/inc/AccObjectContainerEventListener.hxx +++ b/winaccessibility/inc/AccObjectContainerEventListener.hxx @@ -34,7 +34,7 @@ class AccObjectContainerEventListener: public AccContainerEventListener { public: - AccObjectContainerEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + AccObjectContainerEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); virtual ~AccObjectContainerEventListener() override; virtual void HandleStateChangedEvent( diff --git a/winaccessibility/inc/AccObjectManagerAgent.hxx b/winaccessibility/inc/AccObjectManagerAgent.hxx deleted file mode 100644 index 8ff8d407dbe8..000000000000 --- a/winaccessibility/inc/AccObjectManagerAgent.hxx +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#pragma once - -#include <memory> - -#include <prewin.h> -#include <Windows.h> -#include <postwin.h> - -#include <com/sun/star/accessibility/XAccessible.hpp> - -struct IMAccessible; -struct IAccessible; -class AccObjectWinManager; -enum class UnoMSAAEvent; - -/**************************************************************** -AccObjectManagerAgent is used for managing AccObjects, which encapsulates -platform differences,and call AccObjectWinManager for Windows platform. To do for -Linux platform -*****************************************************************/ -class AccObjectManagerAgent -{ -private: - - std::unique_ptr<AccObjectWinManager> pWinManager; - -public: - - AccObjectManagerAgent(); - virtual ~AccObjectManagerAgent(); - - virtual bool InsertAccObj(css::accessibility::XAccessible* pXAcc, - css::accessibility::XAccessible* pParentXAcc, - HWND hWnd = nullptr); - virtual void GetIAccessibleFromResID(long childID,IMAccessible**); - virtual bool GetIAccessibleFromXAccessible(css::accessibility::XAccessible* pXAcc, IAccessible** ppIA); - - virtual void DeleteAccObj( css::accessibility::XAccessible* pXAcc ); - virtual IMAccessible* GetIMAccByXAcc(css::accessibility::XAccessible* pXAcc); - - bool NotifyAccEvent(css::accessibility::XAccessible* pXAcc, UnoMSAAEvent eEvent); - - bool InsertChildrenAccObj(css::accessibility::XAccessible* pXAcc, - HWND hWnd = nullptr); - void DeleteChildrenAccObj( css::accessibility::XAccessible* pXAcc ); - - void DecreaseState( css::accessibility::XAccessible* pXAcc, sal_Int64 pState ); - void IncreaseState( css::accessibility::XAccessible* pXAcc, sal_Int64 pState ); - void UpdateState( css::accessibility::XAccessible* pXAcc ); - - void UpdateAction( css::accessibility::XAccessible* pXAcc ); - - void UpdateValue( css::accessibility::XAccessible* pXAcc ); - void UpdateValue( css::accessibility::XAccessible* pXAcc, css::uno::Any ); - - void UpdateAccName( css::accessibility::XAccessible* pXAcc, css::uno::Any newName); - void UpdateAccName( css::accessibility::XAccessible* pXAcc); - - void NotifyDestroy(css::accessibility::XAccessible* pXAcc); - - css::accessibility::XAccessible* GetParentXAccessible( css::accessibility::XAccessible* pXAcc ); - short GetParentRole(css::accessibility::XAccessible* pXAcc ); - bool IsContainer(css::accessibility::XAccessible* pXAcc); - - void SaveTopWindowHandle(HWND hWnd, css::accessibility::XAccessible* pXAcc); - - void UpdateChildState(css::accessibility::XAccessible* pXAcc); - - bool IsSpecialToolbarItem(css::accessibility::XAccessible* pXAcc); - - css::accessibility::XAccessible* GetAccDocByAccTopWin( css::accessibility::XAccessible* pXAcc ); - bool IsTopWinAcc( css::accessibility::XAccessible* pXAcc ); - - bool IsStateManageDescendant(css::accessibility::XAccessible* pXAcc); - - sal_Int64 Get_ToATInterface(sal_Int64 hWnd, sal_Int64 lParam, sal_Int64 wParam); - -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccObjectWinManager.hxx b/winaccessibility/inc/AccObjectWinManager.hxx index b8f6c3bcd0f4..11b65d0325b4 100644 --- a/winaccessibility/inc/AccObjectWinManager.hxx +++ b/winaccessibility/inc/AccObjectWinManager.hxx @@ -25,7 +25,9 @@ #if !defined WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN #endif +#include <prewin.h> #include <windows.h> +#include <postwin.h> #include <rtl/ref.hxx> #include "ResIDGenerator.hxx" #include <UAccCOM.h> @@ -34,7 +36,6 @@ namespace com::sun::star::accessibility { class XAccessible; } class ResIDGenerator; -class AccObjectManagerAgent; class AccEventListener; class AccObject; enum class UnoMSAAEvent; @@ -49,8 +50,6 @@ AccObjectWinManager complete the functions: *******************************************************************/ class AccObjectWinManager { - friend class AccObjectManagerAgent; - private: typedef std::map<com::sun::star::accessibility::XAccessible*, AccObject> XIdToAccObjHash; typedef std::map<HWND, com::sun::star::accessibility::XAccessible*> XHWNDToXAccHash; @@ -76,11 +75,8 @@ private: css::accessibility::XAccessible* oldFocus; - AccObjectManagerAgent* pAgent; ResIDGenerator ResIdGen; - AccObjectWinManager(AccObjectManagerAgent* Agent=nullptr); - private: long ImpleGenerateResID(); AccObject* GetAccObjByXAcc( css::accessibility::XAccessible* pXAcc); @@ -97,8 +93,11 @@ private: ::rtl::Reference<AccEventListener> CreateAccEventListener( css::accessibility::XAccessible* pXAcc); public: + AccObjectWinManager(); virtual ~AccObjectWinManager(); - bool InsertAccObj( css::accessibility::XAccessible* pXAcc,css::accessibility::XAccessible* pParentXAcc,HWND pWnd); + virtual bool InsertAccObj(css::accessibility::XAccessible* pXAcc, + css::accessibility::XAccessible* pParentXAcc, + HWND pWnd = nullptr); bool InsertChildrenAccObj( css::accessibility::XAccessible* pXAcc,HWND pWnd=nullptr); void DeleteAccObj( css::accessibility::XAccessible* pXAcc ); void DeleteChildrenAccObj(css::accessibility::XAccessible* pAccObj); @@ -122,9 +121,9 @@ public: static bool IsContainer( css::accessibility::XAccessible* pAccessible ); - IMAccessible* GetIMAccByXAcc( css::accessibility::XAccessible* pXAcc ); - bool GetIAccessibleFromXAccessible(css::accessibility::XAccessible* pXAcc, IAccessible** ppIA); - IMAccessible* GetIAccessibleFromResID(long resID); + virtual IMAccessible* GetIMAccByXAcc(css::accessibility::XAccessible* pXAcc); + virtual bool GetIAccessibleFromXAccessible(css::accessibility::XAccessible* pXAcc, IAccessible** ppIA); + virtual IMAccessible* GetIAccessibleFromResID(long resID); void NotifyDestroy( css::accessibility::XAccessible* pXAcc ); css::accessibility::XAccessible* GetParentXAccessible( css::accessibility::XAccessible* pXAcc ); diff --git a/winaccessibility/inc/AccParagraphEventListener.hxx b/winaccessibility/inc/AccParagraphEventListener.hxx index 1563270a24dc..daa07603bc19 100644 --- a/winaccessibility/inc/AccParagraphEventListener.hxx +++ b/winaccessibility/inc/AccParagraphEventListener.hxx @@ -33,7 +33,7 @@ class AccParagraphEventListener : public AccContainerEventListener { public: - AccParagraphEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + AccParagraphEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); virtual ~AccParagraphEventListener() override; //AccessibleEventListener diff --git a/winaccessibility/inc/AccTableEventListener.hxx b/winaccessibility/inc/AccTableEventListener.hxx index 01871e35e9d4..ee0738f21a35 100644 --- a/winaccessibility/inc/AccTableEventListener.hxx +++ b/winaccessibility/inc/AccTableEventListener.hxx @@ -33,7 +33,7 @@ class AccTableEventListener : public AccDescendantManagerEventListener { public: - AccTableEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + AccTableEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); virtual ~AccTableEventListener() override; // XAccessibleEventListener diff --git a/winaccessibility/inc/AccTextComponentEventListener.hxx b/winaccessibility/inc/AccTextComponentEventListener.hxx index e174472e5e42..d4b78bcd300f 100644 --- a/winaccessibility/inc/AccTextComponentEventListener.hxx +++ b/winaccessibility/inc/AccTextComponentEventListener.hxx @@ -34,7 +34,7 @@ class AccTextComponentEventListener : public AccComponentEventListener { public: AccTextComponentEventListener(css::accessibility::XAccessible* pAcc, - AccObjectManagerAgent* Agent); + AccObjectWinManager* pManager); virtual ~AccTextComponentEventListener() override; virtual void SetComponentState(sal_Int64 state, bool enable) override; diff --git a/winaccessibility/inc/AccTopWindowListener.hxx b/winaccessibility/inc/AccTopWindowListener.hxx index c88ce5085dc2..d48ad035dd6a 100644 --- a/winaccessibility/inc/AccTopWindowListener.hxx +++ b/winaccessibility/inc/AccTopWindowListener.hxx @@ -25,7 +25,7 @@ #include <cppuhelper/implbase.hxx> -#include "AccObjectManagerAgent.hxx" +#include "AccObjectWinManager.hxx" /** * AccEventListener is the general event listener for all top windows. The top windows defined @@ -37,7 +37,7 @@ class AccTopWindowListener : public ::cppu::WeakImplHelper<css::awt::XTopWindowListener> { private: - AccObjectManagerAgent accManagerAgent; + AccObjectWinManager m_aAccObjectManager; public: AccTopWindowListener(); diff --git a/winaccessibility/inc/AccTreeEventListener.hxx b/winaccessibility/inc/AccTreeEventListener.hxx index bb3574bf0df7..cb6551db448e 100644 --- a/winaccessibility/inc/AccTreeEventListener.hxx +++ b/winaccessibility/inc/AccTreeEventListener.hxx @@ -33,7 +33,7 @@ class AccTreeEventListener : public AccDescendantManagerEventListener { public: - AccTreeEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + AccTreeEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); virtual ~AccTreeEventListener() override; // XAccessibleEventListener diff --git a/winaccessibility/inc/AccWindowEventListener.hxx b/winaccessibility/inc/AccWindowEventListener.hxx index dfc3e2756b2e..595f34099090 100644 --- a/winaccessibility/inc/AccWindowEventListener.hxx +++ b/winaccessibility/inc/AccWindowEventListener.hxx @@ -33,7 +33,7 @@ class AccWindowEventListener : public AccEventListener { public: - AccWindowEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + AccWindowEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); virtual ~AccWindowEventListener() override; // XAccessibleEventListener diff --git a/winaccessibility/source/UAccCOM/AccTable.cxx b/winaccessibility/source/UAccCOM/AccTable.cxx index 2022eb7e24eb..6cb0dd1d26b2 100644 --- a/winaccessibility/source/UAccCOM/AccTable.cxx +++ b/winaccessibility/source/UAccCOM/AccTable.cxx @@ -77,7 +77,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_accessibleAt(long row, long col { Reference<XAccessible> pxTable(pRXTable, UNO_QUERY); - CMAccessible::g_pAgent->InsertAccObj(pRAcc.get(),pxTable.get()); + CMAccessible::g_pAccObjectManager->InsertAccObj(pRAcc.get(),pxTable.get()); isTRUE = CMAccessible::get_IAccessibleFromXAccessible(pRAcc.get(), &pRet); if(isTRUE) @@ -1105,7 +1105,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_selectedCells(IUnknown * * * ce if (!bOK) { Reference<XAccessible> xTable(pRXTable, UNO_QUERY); - CMAccessible::g_pAgent->InsertAccObj(xAcc.get(), xTable.get()); + CMAccessible::g_pAccObjectManager->InsertAccObj(xAcc.get(), xTable.get()); bOK = CMAccessible::get_IAccessibleFromXAccessible(xAcc.get(), &pIAccessible); } diff --git a/winaccessibility/source/UAccCOM/AccTableCell.cxx b/winaccessibility/source/UAccCOM/AccTableCell.cxx index 0a04683ac109..9b8bf21529d5 100644 --- a/winaccessibility/source/UAccCOM/AccTableCell.cxx +++ b/winaccessibility/source/UAccCOM/AccTableCell.cxx @@ -121,7 +121,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTableCell::get_columnHeaderCells(IUnknown* if (!bOK) { Reference<XAccessible> xTableAcc(m_xTable, UNO_QUERY); - CMAccessible::g_pAgent->InsertAccObj(xCell.get(), xTableAcc.get()); + CMAccessible::g_pAccObjectManager->InsertAccObj(xCell.get(), xTableAcc.get()); bOK = CMAccessible::get_IAccessibleFromXAccessible(xCell.get(), &pIAccessible); } assert(bOK && "Couldn't retrieve IAccessible object for cell."); @@ -209,7 +209,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTableCell::get_rowHeaderCells(IUnknown*** if (!bOK) { Reference<XAccessible> xTableAcc(m_xTable, UNO_QUERY); - CMAccessible::g_pAgent->InsertAccObj(xCell.get(), xTableAcc.get()); + CMAccessible::g_pAccObjectManager->InsertAccObj(xCell.get(), xTableAcc.get()); bOK = CMAccessible::get_IAccessibleFromXAccessible(xCell.get(), &pIAccessible); } assert(bOK && "Couldn't retrieve IAccessible object for cell."); diff --git a/winaccessibility/source/UAccCOM/EnumVariant.cxx b/winaccessibility/source/UAccCOM/EnumVariant.cxx index e5d2b9524657..5f26159cef7f 100644 --- a/winaccessibility/source/UAccCOM/EnumVariant.cxx +++ b/winaccessibility/source/UAccCOM/EnumVariant.cxx @@ -75,8 +75,8 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Next(ULONG cElements,VARIANT __RPC_FAR * } else if(pRXAcc.is()) { - if(CMAccessible::g_pAgent) - CMAccessible::g_pAgent->InsertAccObj(pRXAcc.get(),pUNOInterface); + if (CMAccessible::g_pAccObjectManager) + CMAccessible::g_pAccObjectManager->InsertAccObj(pRXAcc.get(),pUNOInterface); isGet = CMAccessible::get_IAccessibleFromXAccessible( pRXAcc.get(), &pChild); if(isGet) diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx index 24e3bde478c2..091acfeb780c 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.cxx +++ b/winaccessibility/source/UAccCOM/MAccessible.cxx @@ -178,7 +178,7 @@ sal_Int64 const UNO_STATES[] = using namespace com::sun::star::accessibility::AccessibleRole; -AccObjectManagerAgent* CMAccessible::g_pAgent = nullptr; +AccObjectWinManager* CMAccessible::g_pAccObjectManager = nullptr; CMAccessible::CMAccessible(): m_pszName(nullptr), @@ -799,8 +799,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accFocus(VARIANT *pvarChild) //if the descendant of current object has focus indicated by m_dFocusChildID, return the IDispatch of this focused object else { - IMAccessible* pIMAcc = nullptr; - g_pAgent->GetIAccessibleFromResID(m_dFocusChildID,&pIMAcc); + IMAccessible* pIMAcc = g_pAccObjectManager->GetIAccessibleFromResID(m_dFocusChildID); if (pIMAcc == nullptr) { return E_FAIL; @@ -1263,15 +1262,15 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Put_XAccChildID(long dChildID) } /** -* Set AccObjectManagerAgent object pointer to COM -* @param pAgent, the AccObjectManagerAgent point. +* Set AccObjectWinManager object pointer to COM +* @param pManager, the AccObjectWinManager pointer. * @return S_OK if successful and E_FAIL if failure. */ -COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Put_XAccAgent(hyper pAgent) +COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::Put_XAccObjectManager(hyper pManager) { // internal IMAccessible - no mutex meeded - g_pAgent = reinterpret_cast<AccObjectManagerAgent*>(pAgent); + g_pAccObjectManager = reinterpret_cast<AccObjectWinManager*>(pManager); return S_OK; } @@ -1303,10 +1302,9 @@ IMAccessible* CMAccessible::GetChildInterface(long dChildID)//for test { if(dChildID<0) { - if(g_pAgent) + if(g_pAccObjectManager) { - IMAccessible* pIMAcc = nullptr; - g_pAgent->GetIAccessibleFromResID(dChildID,&pIMAcc); + IMAccessible* pIMAcc = g_pAccObjectManager->GetIAccessibleFromResID(dChildID); return pIMAcc; } return nullptr; @@ -1330,7 +1328,7 @@ IMAccessible* CMAccessible::GetChildInterface(long dChildID)//for test if(!isGet) { - g_pAgent->InsertAccObj(pXChild.get(), m_xAccessible.get(), m_hwnd); + g_pAccObjectManager->InsertAccObj(pXChild.get(), m_xAccessible.get(), m_hwnd); isGet = get_IAccessibleFromXAccessible(pXChild.get(), &pChild); } @@ -1417,8 +1415,8 @@ IMAccessible* CMAccessible::GetNavigateChildForDM(VARIANT varCur, short flags) return nullptr; } pChildXAcc = pRChildXAcc.get(); - g_pAgent->InsertAccObj(pChildXAcc, m_xAccessible.get()); - return g_pAgent->GetIMAccByXAcc(pChildXAcc); + g_pAccObjectManager->InsertAccObj(pChildXAcc, m_xAccessible.get()); + return g_pAccObjectManager->GetIMAccByXAcc(pChildXAcc); } /** @@ -2454,8 +2452,8 @@ bool CMAccessible::get_IAccessibleFromXAccessible(XAccessible* pXAcc, IAccessibl return false; } bool isGet = false; - if(g_pAgent) - isGet = g_pAgent->GetIAccessibleFromXAccessible(pXAcc, ppIA); + if (g_pAccObjectManager) + isGet = g_pAccObjectManager->GetIAccessibleFromXAccessible(pXAcc, ppIA); return isGet; } @@ -2750,7 +2748,7 @@ void CMAccessible::ConvertAnyToVariant(const css::uno::Any &rAnyVal, VARIANT *pv if(pIAcc == nullptr) { Reference< XAccessibleContext > pXAccContext = pXAcc->getAccessibleContext(); - g_pAgent->InsertAccObj(pXAcc.get(),pXAccContext->getAccessibleParent().get()); + g_pAccObjectManager->InsertAccObj(pXAcc.get(),pXAccContext->getAccessibleParent().get()); get_IAccessibleFromXAccessible(pXAcc.get(), &pIAcc); } if(pIAcc) diff --git a/winaccessibility/source/UAccCOM/MAccessible.h b/winaccessibility/source/UAccCOM/MAccessible.h index baa13b45f2b1..5b42358f505e 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.h +++ b/winaccessibility/source/UAccCOM/MAccessible.h @@ -26,7 +26,7 @@ #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/accessibility/XAccessibleSelection.hpp> #include <com/sun/star/accessibility/XAccessibleAction.hpp> -#include <AccObjectManagerAgent.hxx> +#include <AccObjectWinManager.hxx> #include "EnumVariant.h" #include "acccommon.h" #include <rtl/ustring.hxx> @@ -145,7 +145,7 @@ public: STDMETHOD(Put_XAccParent)(IMAccessible __RPC_FAR *pIParent) override; STDMETHOD(Put_XAccWindowHandle)(HWND hwnd) override; STDMETHOD(Put_XAccChildID)(long dChildID) override; - STDMETHOD(Put_XAccAgent)(hyper pAgent) override; + STDMETHOD(Put_XAccObjectManager)(hyper pManager) override; STDMETHOD(NotifyDestroy)() override; STDMETHOD(Put_ActionDescription)( const OLECHAR* szAction) override; STDMETHOD(SetDefaultAction)(hyper pAction) override; @@ -199,12 +199,12 @@ private: HRESULT WINAPI SmartQI(void* pv, REFIID iid, void** ppvObject); public: - // AccObjectManagerAgent is a management object in UNO, here keep its pointer for + // AccObjectWinManager is a management object in UNO, here keep its pointer for // the implementation of accNavigate when descendant manage happens for List,Tree, or Table - // AccObjectManagerAgent and the following UNO objects XAccessible,XAccessibleSelection, + // AccObjectWinManager and the following UNO objects XAccessible,XAccessibleSelection, // XAccessibleAction are all used to operate UNO accessibility information directly when // implement some specific MSAA methods,such as accSelection,accNavigate - static AccObjectManagerAgent* g_pAgent; + static AccObjectWinManager* g_pAccObjectManager; static bool get_IAccessibleFromXAccessible( css::accessibility::XAccessible * pXAcc, IAccessible** ppIA); diff --git a/winaccessibility/source/UAccCOMIDL/UAccCOM.idl b/winaccessibility/source/UAccCOMIDL/UAccCOM.idl index 4befd13de0bc..871e5c3084c2 100644 --- a/winaccessibility/source/UAccCOMIDL/UAccCOM.idl +++ b/winaccessibility/source/UAccCOMIDL/UAccCOM.idl @@ -46,7 +46,7 @@ import "defines.idl"; [id(20), helpstring("method GetUNOInterface")] HRESULT GetUNOInterface(hyper* UNOInterface); [id(23), helpstring("method SetDefaultAction")] HRESULT SetDefaultAction(hyper pAction); [id(24), helpstring("method Put_ActionDescription")] HRESULT Put_ActionDescription( const OLECHAR* szAction); - [id(25), helpstring("method Put_XAccAgent")] HRESULT Put_XAccAgent(hyper pAgent); + [id(25), helpstring("method Put_XAccObjectManager")] HRESULT Put_XAccObjectManager(hyper pManager); [id(26), helpstring("method NotifyDestroy")] HRESULT NotifyDestroy(); }; [ diff --git a/winaccessibility/source/service/AccComponentEventListener.cxx b/winaccessibility/source/service/AccComponentEventListener.cxx index a4ab118f54e6..e63317b59e82 100644 --- a/winaccessibility/source/service/AccComponentEventListener.cxx +++ b/winaccessibility/source/service/AccComponentEventListener.cxx @@ -26,14 +26,14 @@ #include <vcl/svapp.hxx> #include <AccComponentEventListener.hxx> -#include <AccObjectManagerAgent.hxx> +#include <AccObjectWinManager.hxx> #include <unomsaaevent.hxx> using namespace com::sun::star::uno; using namespace com::sun::star::accessibility; -AccComponentEventListener::AccComponentEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent) - :AccEventListener(pAcc, Agent) +AccComponentEventListener::AccComponentEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager) + :AccEventListener(pAcc, pManager) { } @@ -92,8 +92,8 @@ void AccComponentEventListener::notifyEvent( const css::accessibility::Accessib */ void AccComponentEventListener::HandleValueChangedEvent(Any, Any) { - pAgent->UpdateValue(m_xAccessible.get()); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_VALUECHANGE); + m_pObjManager->UpdateValue(m_xAccessible.get()); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_VALUECHANGE); } /** @@ -101,8 +101,8 @@ void AccComponentEventListener::HandleValueChangedEvent(Any, Any) */ void AccComponentEventListener::HandleActionChangedEvent() { - pAgent->UpdateAction(m_xAccessible.get()); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_DEFACTIONCHANGE); + m_pObjManager->UpdateAction(m_xAccessible.get()); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_DEFACTIONCHANGE); } /** @@ -113,8 +113,8 @@ void AccComponentEventListener::HandleActionChangedEvent() */ void AccComponentEventListener::HandleTextChangedEvent(Any, Any newValue) { - pAgent->UpdateValue(m_xAccessible.get(), newValue); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_VALUECHANGE); + m_pObjManager->SetValue(m_xAccessible.get(), newValue); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_VALUECHANGE); } /** @@ -125,7 +125,7 @@ void AccComponentEventListener::HandleTextChangedEvent(Any, Any newValue) */ void AccComponentEventListener::HandleCaretChangedEvent(Any, Any) { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_CARETCHANGE); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_CARETCHANGE); } /** @@ -152,13 +152,13 @@ void AccComponentEventListener::SetComponentState(sal_Int64 state, bool enable) { if(enable) { - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSABLE); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSABLE); } else { - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSABLE); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSABLE); } } else @@ -172,22 +172,22 @@ void AccComponentEventListener::SetComponentState(sal_Int64 state, bool enable) case AccessibleStateType::ENABLED: if(enable) { - pAgent->UpdateState(m_xAccessible.get()); - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::DEFUNC); + m_pObjManager->UpdateState(m_xAccessible.get()); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::DEFUNC); // 8. label should have no FOCUSABLE state, Firefox has READONLY state, we can also have. if ( GetRole() != AccessibleRole::LABEL && GetRole() != AccessibleRole::STATIC && GetRole() != AccessibleRole::NOTIFICATION && GetRole() != AccessibleRole::SCROLL_BAR) { - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSABLE); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSABLE); } } else { - pAgent->UpdateState(m_xAccessible.get()); - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::DEFUNC); - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSABLE); + m_pObjManager->UpdateState(m_xAccessible.get()); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::DEFUNC); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSABLE); } break; case AccessibleStateType::ACTIVE: @@ -214,34 +214,34 @@ void AccComponentEventListener::FireStatePropertyChange(sal_Int64 state, bool se { case AccessibleStateType::CHECKED: case AccessibleStateType::INDETERMINATE: - pAgent->IncreaseState(m_xAccessible.get(), state); - pAgent->UpdateAction(m_xAccessible.get()); + m_pObjManager->IncreaseState(m_xAccessible.get(), state); + m_pObjManager->UpdateAction(m_xAccessible.get()); - if (!pAgent->IsSpecialToolbarItem(m_xAccessible.get())) + if (!m_pObjManager->IsSpecialToolbarItem(m_xAccessible.get())) { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_CHECKED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_CHECKED); } break; case AccessibleStateType::PRESSED: - pAgent->IncreaseState(m_xAccessible.get(), state); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_PRESSED); + m_pObjManager->IncreaseState(m_xAccessible.get(), state); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_PRESSED); break; case AccessibleStateType::SELECTED: - pAgent->IncreaseState(m_xAccessible.get(), state); + m_pObjManager->IncreaseState(m_xAccessible.get(), state); break; case AccessibleStateType::ARMED: - pAgent->IncreaseState(m_xAccessible.get(), state); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_ARMED); + m_pObjManager->IncreaseState(m_xAccessible.get(), state); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_ARMED); break; case AccessibleStateType::SHOWING: - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::DEFUNC); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::DEFUNC); // UNO !SHOWING == MSAA OFFSCREEN - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::SHOWING ); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_SHOWING); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::SHOWING ); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_SHOWING); break; case AccessibleStateType::VISIBLE: // UNO !VISIBLE == MSAA INVISIBLE - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE ); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE ); break; default: break; @@ -254,38 +254,38 @@ void AccComponentEventListener::FireStatePropertyChange(sal_Int64 state, bool se { case AccessibleStateType::CHECKED: case AccessibleStateType::INDETERMINATE: - pAgent->DecreaseState(m_xAccessible.get(), state); - pAgent->UpdateAction(m_xAccessible.get()); + m_pObjManager->DecreaseState(m_xAccessible.get(), state); + m_pObjManager->UpdateAction(m_xAccessible.get()); - if (!pAgent->IsSpecialToolbarItem(m_xAccessible.get())) + if (!m_pObjManager->IsSpecialToolbarItem(m_xAccessible.get())) { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_CHECKED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_CHECKED); } break; case AccessibleStateType::PRESSED: - pAgent->DecreaseState(m_xAccessible.get(), state); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_PRESSED); + m_pObjManager->DecreaseState(m_xAccessible.get(), state); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_PRESSED); break; case AccessibleStateType::SELECTED: - pAgent->DecreaseState(m_xAccessible.get(), state); + m_pObjManager->DecreaseState(m_xAccessible.get(), state); //if the state is unset, no need to send MSAA SELECTION event - //pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_SELECTED); + //m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_SELECTED); break; case AccessibleStateType::ARMED: { - pAgent->DecreaseState(m_xAccessible.get(), state); + m_pObjManager->DecreaseState(m_xAccessible.get(), state); //if the state is unset, no need to send MSAA MENU event - //pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_ARMED); + //m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_ARMED); } break; case AccessibleStateType::SHOWING: - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::DEFUNC); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::DEFUNC); // UNO !SHOWING == MSAA OFFSCREEN - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::SHOWING); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::SHOWING); break; case AccessibleStateType::VISIBLE: // UNO !VISIBLE == MSAA INVISIBLE - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); break; default: @@ -304,24 +304,24 @@ void AccComponentEventListener::FireStateFocusedChange(bool enable) if(enable) { if (GetParentRole() != AccessibleRole::COMBO_BOX) - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_FOCUSED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_FOCUSED); } else { //if lose focus, no need to send MSAA FOCUS event - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); } } void AccComponentEventListener::HandleSelectionChangedEventNoArgs() { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED); } //add TEXT_SELECTION_CHANGED event void AccComponentEventListener::HandleTextSelectionChangedEvent() { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::TEXT_SELECTION_CHANGED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::TEXT_SELECTION_CHANGED); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/service/AccContainerEventListener.cxx b/winaccessibility/source/service/AccContainerEventListener.cxx index f4ec31d335c4..b634fe7be6b5 100644 --- a/winaccessibility/source/service/AccContainerEventListener.cxx +++ b/winaccessibility/source/service/AccContainerEventListener.cxx @@ -26,14 +26,14 @@ #include <vcl/svapp.hxx> #include <AccContainerEventListener.hxx> -#include <AccObjectManagerAgent.hxx> +#include <AccObjectWinManager.hxx> #include <unomsaaevent.hxx> using namespace com::sun::star::uno; using namespace com::sun::star::accessibility; -AccContainerEventListener::AccContainerEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent) - :AccEventListener(pAcc, Agent) +AccContainerEventListener::AccContainerEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager) + :AccEventListener(pAcc, pManager) { } @@ -125,7 +125,7 @@ void AccContainerEventListener::HandleSelectionChangedEvent(const Any& /*oldValu //menu bar does not process selection change event,just same as word behavior if (GetRole()!=AccessibleRole::MENU_BAR) - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED); } /** @@ -137,10 +137,10 @@ void AccContainerEventListener::HandleAllChildrenChangedEvent() if (m_xAccessible.is()) { //delete all oldValue's existing children - pAgent->DeleteChildrenAccObj(m_xAccessible.get()); + m_pObjManager->DeleteChildrenAccObj(m_xAccessible.get()); //add all oldValue's existing children - pAgent->InsertChildrenAccObj(m_xAccessible.get()); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_REORDER); + m_pObjManager->InsertChildrenAccObj(m_xAccessible.get()); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_REORDER); } } @@ -149,8 +149,8 @@ void AccContainerEventListener::HandleAllChildrenChangedEvent() */ void AccContainerEventListener::HandleTextChangedEvent(Any, Any newValue) { - pAgent->UpdateValue(m_xAccessible.get(), newValue); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_TEXTCHANGE); + m_pObjManager->SetValue(m_xAccessible.get(), newValue); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_TEXTCHANGE); } /** @@ -179,17 +179,17 @@ void AccContainerEventListener::SetComponentState(sal_Int64 state, bool enable ) case AccessibleStateType::ENABLED: if(enable) { - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::DEFUNC); - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSABLE); - pAgent->UpdateState(m_xAccessible.get()); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::DEFUNC); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSABLE); + m_pObjManager->UpdateState(m_xAccessible.get()); UpdateAllChildrenState(m_xAccessible.get()); } else { - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::DEFUNC); - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSABLE); - pAgent->UpdateState(m_xAccessible.get()); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::DEFUNC); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSABLE); + m_pObjManager->UpdateState(m_xAccessible.get()); UpdateAllChildrenState(m_xAccessible.get()); } @@ -202,12 +202,12 @@ void AccContainerEventListener::SetComponentState(sal_Int64 state, bool enable ) { if (!enable) /* get the active state */ { - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); } else /* lose the active state */ { - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); } } break; @@ -216,8 +216,8 @@ void AccContainerEventListener::SetComponentState(sal_Int64 state, bool enable ) case AccessibleStateType::COLLAPSE: case AccessibleStateType::CHECKED: { - pAgent->UpdateState(m_xAccessible.get()); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_BUSY); + m_pObjManager->UpdateState(m_xAccessible.get()); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_BUSY); break; } @@ -239,22 +239,22 @@ void AccContainerEventListener::FireStatePropertyChange(sal_Int64 state, bool se switch(state) { case AccessibleStateType::SELECTED: - pAgent->IncreaseState(m_xAccessible.get(), state); + m_pObjManager->IncreaseState(m_xAccessible.get(), state); break; case AccessibleStateType::INDETERMINATE: case AccessibleStateType::BUSY: case AccessibleStateType::FOCUSABLE: case AccessibleStateType::OFFSCREEN: - pAgent->IncreaseState(m_xAccessible.get(), state); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_BUSY); + m_pObjManager->IncreaseState(m_xAccessible.get(), state); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_BUSY); break; case AccessibleStateType::SHOWING: // UNO !SHOWING == MSAA OFFSCREEN - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::SHOWING); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::SHOWING); break; case AccessibleStateType::VISIBLE: // UNO !VISIBLE == MSAA INVISIBLE - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); break; default: break; @@ -266,22 +266,22 @@ void AccContainerEventListener::FireStatePropertyChange(sal_Int64 state, bool se switch(state) { case AccessibleStateType::SELECTED: - pAgent->DecreaseState(m_xAccessible.get(), state); + m_pObjManager->DecreaseState(m_xAccessible.get(), state); break; case AccessibleStateType::BUSY: case AccessibleStateType::INDETERMINATE: case AccessibleStateType::FOCUSABLE: case AccessibleStateType::OFFSCREEN: - pAgent->DecreaseState(m_xAccessible.get(), state); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_BUSY); + m_pObjManager->DecreaseState(m_xAccessible.get(), state); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_BUSY); break; case AccessibleStateType::SHOWING: // UNO !SHOWING == MSAA OFFSCREEN - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::SHOWING); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::SHOWING); break; case AccessibleStateType::VISIBLE: // UNO !VISIBLE == MSAA INVISIBLE - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); break; default: break; @@ -297,16 +297,16 @@ void AccContainerEventListener::FireStateFocusedChange(bool enable) { if(enable) { - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); // if the acc role is MENU_BAR, UnoMSAAEvent::MENU_START event should be sent // if the acc role is POPUP_MENU, UnoMSAAEvent::MENUPOPUPSTART event should be sent short role = GetRole(); if(role == AccessibleRole::MENU_BAR) { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::MENU_START); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::MENU_START); } else if (role == AccessibleRole::POPUP_MENU) - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::MENUPOPUPSTART); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::MENUPOPUPSTART); //Disable the focused event on option_pane and Panel. //only disable option_pane for toolbar has panel to get focus else if (role == AccessibleRole::PANEL || role == AccessibleRole::OPTION_PANE ) @@ -316,7 +316,7 @@ void AccContainerEventListener::FireStateFocusedChange(bool enable) if (parentRole == AccessibleRole::TOOL_BAR || parentRole == AccessibleRole::SCROLL_PANE // sidebar || parentRole == AccessibleRole::PANEL) // sidebar - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_FOCUSED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_FOCUSED); } else if (role == AccessibleRole::COMBO_BOX ) { @@ -335,32 +335,32 @@ void AccContainerEventListener::FireStateFocusedChange(bool enable) { if (IsEditable(mxChildContext)) { - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); - pAgent->IncreaseState( mxChild.get(), AccessibleStateType::FOCUSED); - pAgent->NotifyAccEvent(mxChild.get(), UnoMSAAEvent::STATE_FOCUSED); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); + m_pObjManager->IncreaseState( mxChild.get(), AccessibleStateType::FOCUSED); + m_pObjManager->NotifyAccEvent(mxChild.get(), UnoMSAAEvent::STATE_FOCUSED); bSendFocusOnCombobox = false; } } } } if (bSendFocusOnCombobox) - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_FOCUSED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_FOCUSED); } else - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_FOCUSED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_FOCUSED); } else { - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); // if the acc role is MENU_BAR, UnoMSAAEvent::MENU_END event should be sent // if the acc role is POPUP_MENU, UnoMSAAEvent::MENUPOPUPEND event should be sent if (GetRole() == AccessibleRole::MENU_BAR) { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::MENU_END); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::MENU_END); } else if (GetRole() == AccessibleRole::POPUP_MENU) { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::MENUPOPUPEND); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::MENUPOPUPEND); } } } @@ -373,8 +373,8 @@ void AccContainerEventListener::FireStateFocusedChange(bool enable) */ void AccContainerEventListener::HandleValueChangedEvent(Any, Any) { - pAgent->UpdateValue(m_xAccessible.get()); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_VALUECHANGE); + m_pObjManager->UpdateValue(m_xAccessible.get()); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_VALUECHANGE); } bool AccContainerEventListener::IsEditable(Reference<XAccessibleContext> const & xContext) @@ -391,7 +391,7 @@ bool AccContainerEventListener::NotifyChildEvent(UnoMSAAEvent eWinEvent, const A if(xChild.is()) { XAccessible* pAcc = xChild.get(); - pAgent->NotifyAccEvent(pAcc, eWinEvent); + m_pObjManager->NotifyAccEvent(pAcc, eWinEvent); return true; } } @@ -404,7 +404,7 @@ void AccContainerEventListener::HandleSelectionChangedAddEvent(const Any& /*oldV { return ; } - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_ADD); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_ADD); } void AccContainerEventListener::HandleSelectionChangedRemoveEvent(const Any& /*oldValue*/, const Any& newValue) @@ -413,7 +413,7 @@ void AccContainerEventListener::HandleSelectionChangedRemoveEvent(const Any& /*o { return ; } - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_REMOVE); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_REMOVE); } void AccContainerEventListener::HandleSelectionChangedWithinEvent(const Any& /*oldValue*/, const Any& newValue) @@ -422,7 +422,7 @@ void AccContainerEventListener::HandleSelectionChangedWithinEvent(const Any& /*o { return ; } - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_WITHIN); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_WITHIN); } void AccContainerEventListener::UpdateAllChildrenState(XAccessible* pXAccessible) @@ -438,7 +438,7 @@ void AccContainerEventListener::UpdateAllChildrenState(XAccessible* pXAccessible return; } - if (pAgent && pAgent->IsStateManageDescendant(pXAccessible)) + if (m_pObjManager && m_pObjManager->IsStateManageDescendant(pXAccessible)) { return; } @@ -452,7 +452,7 @@ void AccContainerEventListener::UpdateAllChildrenState(XAccessible* pXAccessible css::accessibility::XAccessible* mpAccessible = mxAccessible.get(); if(mpAccessible != nullptr) { - pAgent->UpdateState(mpAccessible); + m_pObjManager->UpdateState(mpAccessible); UpdateAllChildrenState(mpAccessible); } } @@ -460,17 +460,17 @@ void AccContainerEventListener::UpdateAllChildrenState(XAccessible* pXAccessible void AccContainerEventListener::HandlePageChangedEvent(const Any& /*oldValue*/, const Any& /*newValue*/) { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_PAGECHANGED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_PAGECHANGED); } void AccContainerEventListener::HandleSectionChangedEvent(const Any& /*oldValue*/, const Any& /*newValue*/ ) { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SECTION_CHANGED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SECTION_CHANGED); } void AccContainerEventListener::HandleColumnChangedEvent(const Any& /*oldValue*/, const Any& /*newValue*/) { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::COLUMN_CHANGED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::COLUMN_CHANGED); } void AccContainerEventListener::HandleNameChangedEvent( Any name ) @@ -487,7 +487,7 @@ void AccContainerEventListener::HandleNameChangedEvent( Any name ) short childrole = mxChildContext->getAccessibleRole(); if (childrole == AccessibleRole::TEXT) { - pAgent->UpdateAccName(mxChild.get(), name); + m_pObjManager->SetAccName(mxChild.get(), name); } } } diff --git a/winaccessibility/source/service/AccDescendantManagerEventListener.cxx b/winaccessibility/source/service/AccDescendantManagerEventListener.cxx index f52ed2933065..b9f4f40b4b71 100644 --- a/winaccessibility/source/service/AccDescendantManagerEventListener.cxx +++ b/winaccessibility/source/service/AccDescendantManagerEventListener.cxx @@ -26,14 +26,14 @@ #include <vcl/svapp.hxx> #include <AccDescendantManagerEventListener.hxx> -#include <AccObjectManagerAgent.hxx> +#include <AccObjectWinManager.hxx> #include <unomsaaevent.hxx> using namespace com::sun::star::uno; using namespace com::sun::star::accessibility; -AccDescendantManagerEventListener::AccDescendantManagerEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent) - : AccComponentEventListener(pAcc, Agent) +AccDescendantManagerEventListener::AccDescendantManagerEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager) + : AccComponentEventListener(pAcc, pManager) { } @@ -88,10 +88,10 @@ void AccDescendantManagerEventListener::HandleSelectionChangedEvent(Any oldValue //if the Role is the SC cell ,don't add the selected state. if (xContext.is() && xContext->getAccessibleRole() != AccessibleRole::TABLE_CELL) { - pAgent->IncreaseState( pAcc, AccessibleStateType::SELECTED); + m_pObjManager->IncreaseState( pAcc, AccessibleStateType::SELECTED); } - pAgent->NotifyAccEvent(pAcc, UnoMSAAEvent::SELECTION_CHANGED); + m_pObjManager->NotifyAccEvent(pAcc, UnoMSAAEvent::SELECTION_CHANGED); bSend=true; } } @@ -100,12 +100,12 @@ void AccDescendantManagerEventListener::HandleSelectionChangedEvent(Any oldValue if(xChild.is()) { XAccessible* pAcc = xChild.get(); - pAgent->DecreaseState( pAcc, AccessibleStateType::SELECTED); + m_pObjManager->DecreaseState( pAcc, AccessibleStateType::SELECTED); } } if (!bSend) { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED); } } @@ -119,8 +119,8 @@ void AccDescendantManagerEventListener::HandleChildChangedNoFocusEvent(Any oldVa { XAccessible* pAcc = xChild.get(); - pAgent->InsertAccObj(pAcc, m_xAccessible.get()); - pAgent->InsertChildrenAccObj(pAcc); + m_pObjManager->InsertAccObj(pAcc, m_xAccessible.get()); + m_pObjManager->InsertChildrenAccObj(pAcc); } } if (oldValue >>= xChild) @@ -128,8 +128,8 @@ void AccDescendantManagerEventListener::HandleChildChangedNoFocusEvent(Any oldVa if(xChild.is()) { XAccessible* pAcc = xChild.get(); - pAgent->DeleteChildrenAccObj( pAcc ); - pAgent->DeleteAccObj( pAcc ); + m_pObjManager->DeleteChildrenAccObj( pAcc ); + m_pObjManager->DeleteAccObj( pAcc ); } } } @@ -142,9 +142,9 @@ bool AccDescendantManagerEventListener::NotifyChildEvent(UnoMSAAEvent eWinEvent, if(xChild.is()) { XAccessible* pAcc = xChild.get(); - pAgent->NotifyAccEvent(pAcc, eWinEvent); + m_pObjManager->NotifyAccEvent(pAcc, eWinEvent); - if (pAgent->IsStateManageDescendant(m_xAccessible.get())) + if (m_pObjManager->IsStateManageDescendant(m_xAccessible.get())) { if (eWinEvent == UnoMSAAEvent::SELECTION_CHANGED_REMOVE) { @@ -159,7 +159,7 @@ bool AccDescendantManagerEventListener::NotifyChildEvent(UnoMSAAEvent eWinEvent, { // handle any pending deletions for objects previously removed from selection for (XAccessible* pAcc2 : m_aUnselectedChildrenForDeletion) - pAgent->DeleteAccObj(pAcc2); + m_pObjManager->DeleteAccObj(pAcc2); m_aUnselectedChildrenForDeletion.clear(); } } @@ -174,7 +174,7 @@ void AccDescendantManagerEventListener::HandleSelectionChangedAddEvent(const Any { return ; } - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_ADD); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_ADD); } void AccDescendantManagerEventListener::HandleSelectionChangedRemoveEvent(const Any& /*oldValue*/, const Any &newValue) @@ -183,7 +183,7 @@ void AccDescendantManagerEventListener::HandleSelectionChangedRemoveEvent(const { return ; } - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_REMOVE); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_REMOVE); } void AccDescendantManagerEventListener::HandleSelectionChangedWithinEvent(const Any& /*oldValue*/, const Any &newValue) @@ -192,7 +192,7 @@ void AccDescendantManagerEventListener::HandleSelectionChangedWithinEvent(const { return ; } - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_WITHIN); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_WITHIN); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/service/AccDialogEventListener.cxx b/winaccessibility/source/service/AccDialogEventListener.cxx index 86b1815c24da..1236fc458aa2 100644 --- a/winaccessibility/source/service/AccDialogEventListener.cxx +++ b/winaccessibility/source/service/AccDialogEventListener.cxx @@ -26,14 +26,14 @@ #include <vcl/svapp.hxx> #include <AccDialogEventListener.hxx> -#include <AccObjectManagerAgent.hxx> +#include <AccObjectWinManager.hxx> #include <unomsaaevent.hxx> using namespace com::sun::star::uno; using namespace com::sun::star::accessibility; -AccDialogEventListener::AccDialogEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent) - :AccEventListener(pAcc, Agent) +AccDialogEventListener::AccDialogEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager) + :AccEventListener(pAcc, pManager) {} AccDialogEventListener::~AccDialogEventListener() { @@ -77,9 +77,9 @@ void AccDialogEventListener::SetComponentState(sal_Int64 state, bool enable) case AccessibleStateType::VISIBLE: // UNO !VISIBLE == MSAA INVISIBLE if( enable ) - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); else - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); break; case AccessibleStateType::ACTIVE: // Only frames should be active diff --git a/winaccessibility/source/service/AccEventListener.cxx b/winaccessibility/source/service/AccEventListener.cxx index 8b06d1872bd5..d8e6223403a3 100644 --- a/winaccessibility/source/service/AccEventListener.cxx +++ b/winaccessibility/source/service/AccEventListener.cxx @@ -24,7 +24,7 @@ #include <vcl/svapp.hxx> #include <AccEventListener.hxx> -#include <AccObjectManagerAgent.hxx> +#include <AccObjectWinManager.hxx> #include <unomsaaevent.hxx> #include <com/sun/star/accessibility/XAccessible.hpp> @@ -41,9 +41,9 @@ using namespace com::sun::star::accessibility; using namespace cppu; AccEventListener::AccEventListener(css::accessibility::XAccessible* pAcc, - AccObjectManagerAgent* Agent) + AccObjectWinManager* pManager) : m_xAccessible(pAcc) - , pAgent(Agent) + , m_pObjManager(pManager) { } @@ -82,18 +82,18 @@ void AccEventListener::notifyEvent(const css::accessibility::AccessibleEventObje */ void AccEventListener::HandleNameChangedEvent(Any name) { - if (pAgent->IsTopWinAcc(m_xAccessible.get())) + if (m_pObjManager->IsTopWinAcc(m_xAccessible.get())) { - XAccessible* pAccDoc = pAgent->GetAccDocByAccTopWin(m_xAccessible.get()); + XAccessible* pAccDoc = m_pObjManager->GetAccDocByAccTopWin(m_xAccessible.get()); if (pAccDoc) { - pAgent->UpdateAccName(pAccDoc); - pAgent->NotifyAccEvent(pAccDoc, UnoMSAAEvent::OBJECT_NAMECHANGE); + m_pObjManager->UpdateAccName(pAccDoc); + m_pObjManager->NotifyAccEvent(pAccDoc, UnoMSAAEvent::OBJECT_NAMECHANGE); } } - pAgent->UpdateAccName(m_xAccessible.get(), name); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_NAMECHANGE); + m_pObjManager->SetAccName(m_xAccessible.get(), name); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_NAMECHANGE); } /** @@ -110,9 +110,9 @@ void AccEventListener::HandleChildChangedEvent(com::sun::star::uno::Any oldValue if (xChild.is()) { XAccessible* pAcc = xChild.get(); - pAgent->InsertAccObj(pAcc, m_xAccessible.get()); - pAgent->InsertChildrenAccObj(pAcc); - pAgent->NotifyAccEvent(pAcc, UnoMSAAEvent::CHILD_ADDED); + m_pObjManager->InsertAccObj(pAcc, m_xAccessible.get()); + m_pObjManager->InsertChildrenAccObj(pAcc); + m_pObjManager->NotifyAccEvent(pAcc, UnoMSAAEvent::CHILD_ADDED); } } else if (oldValue >>= xChild) @@ -120,9 +120,9 @@ void AccEventListener::HandleChildChangedEvent(com::sun::star::uno::Any oldValue if (xChild.is()) { XAccessible* pAcc = xChild.get(); - pAgent->NotifyAccEvent(pAcc, UnoMSAAEvent::CHILD_REMOVED); - pAgent->DeleteChildrenAccObj(pAcc); - pAgent->DeleteAccObj(pAcc); + m_pObjManager->NotifyAccEvent(pAcc, UnoMSAAEvent::CHILD_REMOVED); + m_pObjManager->DeleteChildrenAccObj(pAcc); + m_pObjManager->DeleteAccObj(pAcc); } } } @@ -132,7 +132,7 @@ void AccEventListener::HandleChildChangedEvent(com::sun::star::uno::Any oldValue */ void AccEventListener::HandleDescriptionChangedEvent() { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_DESCRIPTIONCHANGE); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::OBJECT_DESCRIPTIONCHANGE); } /** @@ -140,7 +140,7 @@ void AccEventListener::HandleDescriptionChangedEvent() */ void AccEventListener::HandleBoundrectChangedEvent() { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::BOUNDRECT_CHANGED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::BOUNDRECT_CHANGED); } /** @@ -148,8 +148,8 @@ void AccEventListener::HandleBoundrectChangedEvent() */ void AccEventListener::HandleVisibleDataChangedEvent() { - pAgent->UpdateValue(m_xAccessible.get()); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::VISIBLE_DATA_CHANGED); + m_pObjManager->UpdateValue(m_xAccessible.get()); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::VISIBLE_DATA_CHANGED); } /** @@ -196,8 +196,8 @@ void AccEventListener::FireStateFocusedChange(bool enable) { if (enable) { - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_FOCUSED); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::FOCUSED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::STATE_FOCUSED); } else { @@ -243,7 +243,7 @@ short AccEventListener::GetParentRole() { if (m_xAccessible.is()) { - return pAgent->GetParentRole(m_xAccessible.get()); + return m_pObjManager->GetParentRole(m_xAccessible.get()); } return -1; } @@ -273,7 +273,7 @@ void AccEventListener::RemoveMeFromBroadcaster(bool const isNotifyDestroy) } if (isNotifyDestroy) { - pAgent->NotifyDestroy(m_xAccessible.get()); + m_pObjManager->NotifyDestroy(m_xAccessible.get()); } m_xAccessible.clear(); // release cyclic reference } diff --git a/winaccessibility/source/service/AccFrameEventListener.cxx b/winaccessibility/source/service/AccFrameEventListener.cxx index d693b2c37c65..9d2bd0cf30d2 100644 --- a/winaccessibility/source/service/AccFrameEventListener.cxx +++ b/winaccessibility/source/service/AccFrameEventListener.cxx @@ -26,7 +26,7 @@ #include <vcl/svapp.hxx> #include <AccFrameEventListener.hxx> -#include <AccObjectManagerAgent.hxx> +#include <AccObjectWinManager.hxx> #include <unomsaaevent.hxx> using namespace com::sun::star::uno; @@ -36,8 +36,8 @@ using namespace com::sun::star::accessibility; #include <toolkit/awt/vclxwindow.hxx> #include <vcl/sysdata.hxx> -AccFrameEventListener::AccFrameEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent) - :AccEventListener(pAcc, Agent) +AccFrameEventListener::AccFrameEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager) + :AccEventListener(pAcc, pManager) { } @@ -85,9 +85,9 @@ void AccFrameEventListener::HandleChildChangedEvent(Any oldValue, Any newValue) const SystemEnvData* systemdata = pvclwindow->GetWindow()->GetSystemData(); - pAgent->InsertAccObj(pAcc, m_xAccessible.get(), systemdata->hWnd); - pAgent->InsertChildrenAccObj(pAcc); - pAgent->NotifyAccEvent(pAcc, UnoMSAAEvent::CHILD_ADDED); + m_pObjManager->InsertAccObj(pAcc, m_xAccessible.get(), systemdata->hWnd); + m_pObjManager->InsertChildrenAccObj(pAcc); + m_pObjManager->NotifyAccEvent(pAcc, UnoMSAAEvent::CHILD_ADDED); } } else if (oldValue >>= xChild) @@ -112,9 +112,9 @@ void AccFrameEventListener::SetComponentState(sal_Int64 state, bool enable ) case AccessibleStateType::VISIBLE: // UNO !VISIBLE == MSAA INVISIBLE if( enable ) - pAgent->IncreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); + m_pObjManager->IncreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); else - pAgent->DecreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); + m_pObjManager->DecreaseState(m_xAccessible.get(), AccessibleStateType::VISIBLE); break; case AccessibleStateType::ACTIVE: // Only frames should be active diff --git a/winaccessibility/source/service/AccListEventListener.cxx b/winaccessibility/source/service/AccListEventListener.cxx index 802693016e44..9eaab9fd0c95 100644 --- a/winaccessibility/source/service/AccListEventListener.cxx +++ b/winaccessibility/source/service/AccListEventListener.cxx @@ -26,14 +26,14 @@ #include <vcl/svapp.hxx> #include <AccListEventListener.hxx> -#include <AccObjectManagerAgent.hxx> +#include <AccObjectWinManager.hxx> #include <unomsaaevent.hxx> using namespace com::sun::star::uno; using namespace com::sun::star::accessibility; -AccListEventListener::AccListEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent) - :AccDescendantManagerEventListener(pAcc, Agent) +AccListEventListener::AccListEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager) + :AccDescendantManagerEventListener(pAcc, pManager) { } @@ -84,15 +84,15 @@ void AccListEventListener::HandleActiveDescendantChangedEvent(Any oldValue, Any XAccessible* pAcc = xChild.get(); // Valueset has cache the child item xacc,Update state if no insert obj - bool bHasCache = pAgent->InsertAccObj(pAcc, m_xAccessible.get()); + bool bHasCache = m_pObjManager->InsertAccObj(pAcc, m_xAccessible.get()); if (!bHasCache) { - pAgent->UpdateState(pAcc); + m_pObjManager->UpdateState(pAcc); } - pAgent->IncreaseState( pAcc, AccessibleStateType::FOCUSED); + m_pObjManager->IncreaseState( pAcc, AccessibleStateType::FOCUSED); - pAgent->NotifyAccEvent(pAcc, UnoMSAAEvent::ACTIVE_DESCENDANT_CHANGED); + m_pObjManager->NotifyAccEvent(pAcc, UnoMSAAEvent::ACTIVE_DESCENDANT_CHANGED); } } if (oldValue >>= xChild) @@ -100,7 +100,7 @@ void AccListEventListener::HandleActiveDescendantChangedEvent(Any oldValue, Any if(xChild.is()) { XAccessible* pAcc = xChild.get(); - pAgent->DeleteAccObj( pAcc ); + m_pObjManager->DeleteAccObj( pAcc ); } } } @@ -117,9 +117,9 @@ void AccListEventListener::HandleValueChangedEvent(Any, Any) if (GetParentRole() == AccessibleRole::COMBO_BOX) { XAccessible* pParentAcc = - pAgent->GetParentXAccessible(m_xAccessible.get()); - pAgent->UpdateValue(pParentAcc); - pAgent->NotifyAccEvent(pParentAcc, UnoMSAAEvent::OBJECT_VALUECHANGE); + m_pObjManager->GetParentXAccessible(m_xAccessible.get()); + m_pObjManager->UpdateValue(pParentAcc); + m_pObjManager->NotifyAccEvent(pParentAcc, UnoMSAAEvent::OBJECT_VALUECHANGE); } } diff --git a/winaccessibility/source/service/AccMenuEventListener.cxx b/winaccessibility/source/service/AccMenuEventListener.cxx index a21610109b33..25b347ebc868 100644 --- a/winaccessibility/source/service/AccMenuEventListener.cxx +++ b/winaccessibility/source/service/AccMenuEventListener.cxx @@ -26,14 +26,14 @@ #include <vcl/svapp.hxx> #include <AccMenuEventListener.hxx> -#include <AccObjectManagerAgent.hxx> +#include <AccObjectWinManager.hxx> #include <unomsaaevent.hxx> using namespace com::sun::star::uno; using namespace com::sun::star::accessibility; -AccMenuEventListener::AccMenuEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent) - :AccComponentEventListener(pAcc, Agent) +AccMenuEventListener::AccMenuEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager) + :AccComponentEventListener(pAcc, pManager) {} AccMenuEventListener::~AccMenuEventListener() { @@ -64,7 +64,7 @@ void AccMenuEventListener::notifyEvent( const css::accessibility::AccessibleEve */ void AccMenuEventListener::HandleSelectionChangedEventNoArgs() { - pAgent->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED); + m_pObjManager->NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED); } /** @@ -79,8 +79,8 @@ void AccMenuEventListener::FireStatePropertyChange(sal_Int64 state, bool set) { //for sub menu is popup, there is a menu selected event. case AccessibleStateType::SELECTED: - pAgent->IncreaseState(m_xAccessible.get(), state); - pAgent->UpdateChildState(m_xAccessible.get()); + m_pObjManager->IncreaseState(m_xAccessible.get(), state); + m_pObjManager->UpdateChildState(m_xAccessible.get()); break; default: AccComponentEventListener::FireStatePropertyChange(state, set); @@ -93,7 +93,7 @@ void AccMenuEventListener::FireStatePropertyChange(sal_Int64 state, bool set) { //for sub menu is popup, there is a menu selected event. case AccessibleStateType::SELECTED: - pAgent->DecreaseState(m_xAccessible.get(), state); + m_pObjManager->DecreaseState(m_xAccessible.get(), state); break; default: diff --git a/winaccessibility/source/service/AccObject.cxx b/winaccessibility/source/service/AccObject.cxx index 68dcc10105f2..d84e684b012b 100644 --- a/winaccessibility/source/service/AccObject.cxx +++ b/winaccessibility/source/service/AccObject.cxx @@ -153,12 +153,11 @@ const short ROLE_TABLE[][2] = /** * Constructor. * @param pXAcc Uno XAccessible interface of control. - * @param Agent The agent kept in all listeners,it's the sole interface by which - * listener communicate with windows manager. + * @param pManager The accessible object manager kept in all listeners. * @param listener listener that registers in UNO system. * @return. */ -AccObject::AccObject(XAccessible* pAcc, AccObjectManagerAgent* pAgent, +AccObject::AccObject(XAccessible* pAcc, AccObjectWinManager* pManager, AccEventListener* pListener) : m_resID (0), m_pParantID (nullptr), @@ -175,7 +174,7 @@ AccObject::AccObject(XAccessible* pAcc, AccObjectManagerAgent* pAgent, if( m_pIMAcc ) { m_pIMAcc->SetXAccessible(reinterpret_cast<hyper>(m_xAccRef.get())); - m_pIMAcc->Put_XAccAgent(reinterpret_cast<hyper>(pAgent)); + m_pIMAcc->Put_XAccObjectManager(reinterpret_cast<hyper>(pManager)); m_pIMAcc->SetDefaultAction(reinterpret_cast<hyper>(m_xAccActionRef.get())); } } diff --git a/winaccessibility/source/service/AccObjectContainerEventListener.cxx b/winaccessibility/source/service/AccObjectContainerEventListener.cxx index 71c6aa6d12b1..137b498a2cdc 100644 --- a/winaccessibility/source/service/AccObjectContainerEventListener.cxx +++ b/winaccessibility/source/service/AccObjectContainerEventListener.cxx @@ -26,15 +26,15 @@ #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> #include <AccObjectContainerEventListener.hxx> -#include <AccObjectManagerAgent.hxx> +#include <AccObjectWinManager.hxx> #include <unomsaaevent.hxx> using namespace com::sun::star::uno; using namespace com::sun::star::accessibility; AccObjectContainerEventListener::AccObjectContainerEventListener( - css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent) - : AccContainerEventListener(pAcc, Agent) + css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager) + : AccContainerEventListener(pAcc, pManager) { } AccObjectContainerEventListener::~AccObjectContainerEventListener() {} @@ -51,7 +51,7 @@ void AccObjectContainerEventListener::HandleStateChangedEvent(Any oldValue, Any { if (newV == AccessibleStateType::FOCUSED) { - pAgent->UpdateAccName(m_xAccessible.get()); + m_pObjManager->UpdateAccName(m_xAccessible.get()); } } AccContainerEventListener::HandleStateChangedEvent(oldValue, newValue); diff --git a/winaccessibility/source/service/AccObjectManagerAgent.cxx b/winaccessibility/source/service/AccObjectManagerAgent.cxx deleted file mode 100644 index 65aa77ab3ed7..000000000000 --- a/winaccessibility/source/service/AccObjectManagerAgent.cxx +++ /dev/null @@ -1,318 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <AccObjectManagerAgent.hxx> -#include <AccObjectWinManager.hxx> - -#include <UAccCOM.h> - -using namespace com::sun::star::uno; -using namespace com::sun::star::accessibility; - -/** - * Construction/Destruction. - * @param - * @return - */ -AccObjectManagerAgent::AccObjectManagerAgent() - : pWinManager(new AccObjectWinManager(this)) -{ -} - -AccObjectManagerAgent::~AccObjectManagerAgent() -{ -} - -/** - * Interface of updating MSAA name when UNO name_changed event occurs. - * @param pXAcc Uno XAccessible interface of control. - * @return - */ -void AccObjectManagerAgent::UpdateAccName( XAccessible* pXAcc ) -{ - assert(pWinManager); - pWinManager->UpdateAccName( pXAcc ); -} - -/** - * Interface of updating MSAA name when UNO action changed event occurs. - * @param pXAcc Uno XAccessible interface of control. - * @return - */ -void AccObjectManagerAgent::UpdateAction( XAccessible* pXAcc ) -{ - assert(pWinManager); - pWinManager->UpdateAction( pXAcc ); -} - -/** - * Interface of updating MSAA value when UNO value_changed event occurs. - * @param pXAcc Uno XAccessible interface of control. - * @param pAny New value. - * @return - */ -void AccObjectManagerAgent::UpdateValue( XAccessible* pXAcc, Any pAny ) -{ - assert(pWinManager); - pWinManager->SetValue( pXAcc, pAny ); -} - -/** - * Interface of updating MSAA value when UNO value_changed event occurs. If we can not - * find new value, we'll get new value from pXAcc to update com value. - * @param pXAcc Uno XAccessible interface of control. - * @return - */ -void AccObjectManagerAgent::UpdateValue( XAccessible* pXAcc ) -{ - assert(pWinManager); - pWinManager->UpdateValue( pXAcc ); -} - -/** - * Interface of updating MSAA name when UNO name_changed event occurs. - * @param pXAcc Uno XAccessible interface of control. - * @param newName New UNO accessible name. - * @return - */ -void AccObjectManagerAgent::UpdateAccName( XAccessible* pXAcc, Any newName) -{ - assert(pWinManager); - pWinManager->SetAccName( pXAcc, newName ); -} - -/** - * When a new UNO XAccessible object is found by listener, we create a corresponding - * com object and insert it to our manager list. - * @param pXAcc Uno XAccessible interface of control. - * @param pWnd The top window handle containing control. - * @return If the method is correctly processed. - */ -bool AccObjectManagerAgent::InsertAccObj( - XAccessible* pXAcc, XAccessible* pParentXAcc, HWND hWnd) -{ - assert(pWinManager); - return pWinManager->InsertAccObj(pXAcc, pParentXAcc, hWnd); -} - -/** - * save the pair <topwindowhandle, XAccessible> - * @param hWnd, top window handle - * @param pXAcc XAccessible interface for top window - * @return void - */ -void -AccObjectManagerAgent::SaveTopWindowHandle(HWND hWnd, XAccessible* pXAcc) -{ - assert(pWinManager); - pWinManager->SaveTopWindowHandle(hWnd, pXAcc); -} - - -/** - * When a UNO XAccessible object's new children are found by listener, we create - * corresponding com objects and insert them to our manager list. - * @param pXAcc Uno XAccessible interface of control. - * @param pWnd The top window handle containing control. - * @return If the method is correctly processed. - */ -bool -AccObjectManagerAgent::InsertChildrenAccObj(XAccessible* pXAcc, HWND hWnd) -{ - assert(pWinManager); - return pWinManager->InsertChildrenAccObj(pXAcc, hWnd); -} - -/** - * When a new UNO XAccessible object is destroyed, we delete its corresponding - * com object and remove it from our manager list. - * @param pXAcc Uno XAccessible interface of control. - * @return - */ -void AccObjectManagerAgent::DeleteAccObj( XAccessible* pXAcc ) -{ - assert(pWinManager); - pWinManager->DeleteAccObj( pXAcc ); -} - -/** - * When new UNO children XAccessible objects are destroyed, we delete their - * corresponding com objects and remove them from our manager list. - * @param pXAcc Uno XAccessible interface of control. - * @return - */ -void AccObjectManagerAgent::DeleteChildrenAccObj( XAccessible* pXAcc ) -{ - assert(pWinManager); - pWinManager->DeleteChildrenAccObj( pXAcc ); -} - -/** - * Interface of decreasing MSAA state when some UNO state is decreased. - * @param pXAcc Uno XAccessible interface of control. - * @param pState The lost state of control. - * @return - */ -void AccObjectManagerAgent::DecreaseState( XAccessible* pXAcc, sal_Int64 pState ) -{ - assert(pWinManager); - pWinManager->DecreaseState( pXAcc, pState ); -} - -/** - * Interface of increasing MSAA name when some UNO state is increased. - * @param pXAcc Uno XAccessible interface of control. - * @param pState The new state of control. - * @return - */ -void AccObjectManagerAgent::IncreaseState( XAccessible* pXAcc, sal_Int64 pState ) -{ - assert(pWinManager); - pWinManager->IncreaseState( pXAcc, pState ); -} - -void AccObjectManagerAgent::UpdateState( css::accessibility::XAccessible* pXAcc ) -{ - assert(pWinManager); - pWinManager->UpdateState(pXAcc); -} - -/** - * Interface of notify MSAA event when some UNO event occurred. - * @param pXAcc Uno XAccessible interface of control. - * @param eEvent event type. - * @return If the method is correctly processed. - */ -bool AccObjectManagerAgent::NotifyAccEvent(XAccessible* pXAcc, UnoMSAAEvent eEvent) -{ - assert(pWinManager); - return pWinManager->NotifyAccEvent(pXAcc, eEvent); -} - -/** - * Judge whether a XAccessible object is a container object. - * @param pXAcc Uno XAccessible interface of control. - * @return If the method is correctly processed. - */ -bool AccObjectManagerAgent::IsContainer( XAccessible* pXAcc ) -{ - assert(pWinManager); - return AccObjectWinManager::IsContainer(pXAcc); -} - -/** - * Return com object interface by querying XAccessible interface. - * @param pXAcc Uno XAccessible interface of control. - * @return Com interface. - */ -IMAccessible* AccObjectManagerAgent::GetIMAccByXAcc(XAccessible* pXAcc) -{ - assert(pWinManager); - return pWinManager->GetIMAccByXAcc(pXAcc); -} - -/** - * Notify manager when a XAccessible object is destroying. - * @param pXAcc Uno XAccessible interface of control. - * @return. - */ -void AccObjectManagerAgent::NotifyDestroy(XAccessible* pXAcc) -{ - assert(pWinManager); - pWinManager->NotifyDestroy(pXAcc); -} - -/** - * Return com object interface by querying child id. - * @param pXAcc Uno XAccessible interface of control. - * @return Com interface. - */ -void AccObjectManagerAgent::GetIAccessibleFromResID(long childID,IMAccessible** pIMAcc) -{ - assert(pWinManager); - *pIMAcc = pWinManager->GetIAccessibleFromResID(childID); -} - -/** - * Return object interface by querying interface. - * @param pXAcc Uno XAccessible interface of control. - * @return Com interface. - */ -bool AccObjectManagerAgent::GetIAccessibleFromXAccessible( - XAccessible* pXAcc, IAccessible** ppXI) -{ - assert(pWinManager); - return pWinManager->GetIAccessibleFromXAccessible(pXAcc, ppXI); -} - -XAccessible* AccObjectManagerAgent::GetParentXAccessible( XAccessible* pXAcc ) -{ - assert(pWinManager); - return pWinManager->GetParentXAccessible( pXAcc ); -} - -short AccObjectManagerAgent::GetParentRole( XAccessible* pXAcc ) -{ - assert(pWinManager); - return pWinManager->GetParentRole( pXAcc ); -} - -void AccObjectManagerAgent::UpdateChildState(XAccessible* pXAcc) -{ - assert(pWinManager); - pWinManager->UpdateChildState( pXAcc ); -} - - -bool AccObjectManagerAgent::IsSpecialToolbarItem(XAccessible* pXAcc) -{ - assert(pWinManager); - return pWinManager->IsSpecialToolbarItem(pXAcc); -} - -XAccessible* AccObjectManagerAgent::GetAccDocByAccTopWin( XAccessible* pXAcc ) -{ - assert(pWinManager); - return pWinManager->GetAccDocByAccTopWin( pXAcc ); -} - -bool AccObjectManagerAgent::IsTopWinAcc(XAccessible* pXAcc) -{ - assert(pWinManager); - return pWinManager->IsTopWinAcc( pXAcc ); -} - -bool AccObjectManagerAgent::IsStateManageDescendant(XAccessible* pXAcc) -{ - assert(pWinManager); - return AccObjectWinManager::IsStateManageDescendant( pXAcc ); -} - -/** - * Implementation of interface XMSAAService's method getAccObjectPtr() - * that returns the corresponding COM interface with the MS event. - * @return Com interface. - */ -sal_Int64 AccObjectManagerAgent::Get_ToATInterface( - sal_Int64 hWnd, sal_Int64 lParam, sal_Int64 wParam) -{ - return pWinManager->Get_ToATInterface(hWnd, lParam, wParam); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/service/AccObjectWinManager.cxx b/winaccessibility/source/service/AccObjectWinManager.cxx index 9299c9a61887..963573628372 100644 --- a/winaccessibility/source/service/AccObjectWinManager.cxx +++ b/winaccessibility/source/service/AccObjectWinManager.cxx @@ -48,21 +48,8 @@ using namespace com::sun::star::accessibility; using namespace com::sun::star::uno; -/** - * constructor - * @param Agent The agent kept in all listeners,it's the sole interface by which - * listener communicate with windows manager. - * pEventAccObj The present event accobject. - * oldFocus Last focused object. - * isSelectionChanged flag that identifies if there is selection changed. - * selectionChildObj Selected object. - * dChildID Chile resource ID. - * hAcc TopWindowHWND - * @return - */ -AccObjectWinManager::AccObjectWinManager( AccObjectManagerAgent* Agent ): - oldFocus( nullptr ), - pAgent( Agent ) +AccObjectWinManager::AccObjectWinManager(): + oldFocus(nullptr) { } @@ -640,7 +627,7 @@ bool AccObjectWinManager::InsertAccObj( XAccessible* pXAcc,XAccessible* pParentX return false; } - AccObject pObj( pXAcc,pAgent ); + AccObject pObj(pXAcc, this); if( pObj.GetIMAccessible() == nullptr ) return false; pObj.SetResID( this->ImpleGenerateResID()); @@ -724,16 +711,16 @@ AccObjectWinManager::CreateAccEventListener(XAccessible* pXAcc) switch( xContext->getAccessibleRole() ) { case AccessibleRole::DIALOG: - pRet = new AccDialogEventListener(pXAcc,pAgent); + pRet = new AccDialogEventListener(pXAcc, this); break; case AccessibleRole::FRAME: - pRet = new AccFrameEventListener(pXAcc,pAgent); + pRet = new AccFrameEventListener(pXAcc, this); break; case AccessibleRole::WINDOW: - pRet = new AccWindowEventListener(pXAcc,pAgent); + pRet = new AccWindowEventListener(pXAcc, this); break; case AccessibleRole::ROOT_PANE: - pRet = new AccFrameEventListener(pXAcc,pAgent); + pRet = new AccFrameEventListener(pXAcc, this); break; //Container case AccessibleRole::CANVAS: @@ -760,11 +747,11 @@ AccObjectWinManager::CreateAccEventListener(XAccessible* pXAcc) case AccessibleRole::TABLE_CELL: case AccessibleRole::TOOL_BAR: case AccessibleRole::VIEW_PORT: - pRet = new AccContainerEventListener(pXAcc,pAgent); + pRet = new AccContainerEventListener(pXAcc, this); break; case AccessibleRole::PARAGRAPH: case AccessibleRole::HEADING: - pRet = new AccParagraphEventListener(pXAcc,pAgent); + pRet = new AccParagraphEventListener(pXAcc, this); break; //Component case AccessibleRole::CHECK_BOX: @@ -784,15 +771,15 @@ AccObjectWinManager::CreateAccEventListener(XAccessible* pXAcc) case AccessibleRole::TOOL_TIP: case AccessibleRole::SPIN_BOX: case AccessibleRole::DATE_EDITOR: - pRet = new AccComponentEventListener(pXAcc,pAgent); + pRet = new AccComponentEventListener(pXAcc, this); break; //text component case AccessibleRole::TEXT: - pRet = new AccTextComponentEventListener(pXAcc,pAgent); + pRet = new AccTextComponentEventListener(pXAcc, this); break; //menu case AccessibleRole::MENU: - pRet = new AccMenuEventListener(pXAcc,pAgent); + pRet = new AccMenuEventListener(pXAcc, this); break; //object container case AccessibleRole::SHAPE: @@ -800,22 +787,22 @@ AccObjectWinManager::CreateAccEventListener(XAccessible* pXAcc) case AccessibleRole::EMBEDDED_OBJECT: case AccessibleRole::GRAPHIC: case AccessibleRole::TEXT_FRAME: - pRet = new AccObjectContainerEventListener(pXAcc,pAgent); + pRet = new AccObjectContainerEventListener(pXAcc, this); break; //descendmanager case AccessibleRole::LIST: - pRet = new AccListEventListener(pXAcc,pAgent); + pRet = new AccListEventListener(pXAcc, this); break; case AccessibleRole::TREE: - pRet = new AccTreeEventListener(pXAcc,pAgent); + pRet = new AccTreeEventListener(pXAcc, this); break; //special case AccessibleRole::COLUMN_HEADER: case AccessibleRole::TABLE: - pRet = new AccTableEventListener(pXAcc,pAgent); + pRet = new AccTableEventListener(pXAcc, this); break; default: - pRet = new AccContainerEventListener(pXAcc,pAgent); + pRet = new AccContainerEventListener(pXAcc, this); break; } } ... etc. - the rest is truncated
