diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:54:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:54:39 +0000 |
commit | 267c6f2ac71f92999e969232431ba04678e7437e (patch) | |
tree | 358c9467650e1d0a1d7227a21dac2e3d08b622b2 /winaccessibility/inc | |
parent | Initial commit. (diff) | |
download | libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip |
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'winaccessibility/inc')
21 files changed, 1292 insertions, 0 deletions
diff --git a/winaccessibility/inc/AccComponentEventListener.hxx b/winaccessibility/inc/AccComponentEventListener.hxx new file mode 100644 index 0000000000..72666b2a56 --- /dev/null +++ b/winaccessibility/inc/AccComponentEventListener.hxx @@ -0,0 +1,68 @@ +/* -*- 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 <stdio.h> +#include "AccEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +/** + * AccComponentEventListener is inherited from AccEventListener. It handles the events + * generated by component controls. The accessible roles are: CHECK_BOX, ICON, LABEL, + * MENU_ITEM, PUSH_BUTTON, RADIO_BUTTON, SCROLL_BAR, SEPARATOR, TOGGLE_BUTTON, TOOL_TIP, SPIN_BOX. + * It defines the procedure of specific event handling related with components and provides + * the detailed support for some related methods. + */ +class AccComponentEventListener : public AccEventListener +{ +private: + static FILE *output, *output2, *output3, *outacc; //used for debugging +public: + AccComponentEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); + virtual ~AccComponentEventListener() override; + + // XAccessibleEventListener + virtual void SAL_CALL + notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) override; + + //for value changed event + virtual void HandleValueChangedEvent(css::uno::Any oldValue, css::uno::Any newValue); + + //for action changed event + virtual void HandleActionChangedEvent(); + + //for text changed event + virtual void HandleTextChangedEvent(css::uno::Any oldValue, css::uno::Any newValue); + + //for caret changed event + virtual void HandleCaretChangedEvent(css::uno::Any oldValue, css::uno::Any newValue); + + virtual void SetComponentState(sal_Int64 state, bool enable) override; + virtual void FireStatePropertyChange(sal_Int64 state, bool set) override; + virtual void FireStateFocusedChange(bool enable) override; + + void HandleSelectionChangedEventNoArgs(); + + //add TEXT_SELECTION_CHANGED event + void HandleTextSelectionChangedEvent(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccContainerEventListener.hxx b/winaccessibility/inc/AccContainerEventListener.hxx new file mode 100644 index 0000000000..e6d284e75a --- /dev/null +++ b/winaccessibility/inc/AccContainerEventListener.hxx @@ -0,0 +1,95 @@ +/* -*- 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 + +enum class UnoMSAAEvent; + +#include <stdio.h> +#include "AccEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + + +/** + * AccContainerEventListener is inherited from AccEventListener. It handles the events + * generated by container controls. The accessible roles are: CANVAS, COMBO_BOX, DOCUMENT, + * EMBEDDED_OBJECT, END_NOTE, FILLER, FOOTNOTE, FOOTER, GRAPHIC, HEADER, LAYERED_PANE, + * MENU_BAR, POPUP_MENU, OPTION_PANE, PAGE_TAB, PAGE_TAB_LIST, PANEL, SCROLL_PANE, SPLIT_PANE, + * STATUS_BAR, TABLE_CELL, TEXT_FRAME, TOOL_BAR, VIEW_PORT. + * It defines the procedure of specific event handling related with containers and provides + * the detailed support for some related methods. + */ +class AccContainerEventListener: public AccEventListener +{ +public: + AccContainerEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); + virtual ~AccContainerEventListener() override; + + //AccessibleEventListener + virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) override; + + //for selection changed event + virtual void HandleSelectionChangedEvent( + const css::uno::Any &oldValue, const css::uno::Any &newValue); + + //for all children changed event + virtual void HandleAllChildrenChangedEvent(); + + //for text changed event + virtual void HandleTextChangedEvent( + css::uno::Any oldValue, css::uno::Any newValue); + virtual void HandleStateChangedEvent( + css::uno::Any oldValue, css::uno::Any newValue) override; + + //for value changed event + virtual void HandleValueChangedEvent( + css::uno::Any oldValue, css::uno::Any newValue); + + //state changed + virtual void SetComponentState(sal_Int64 state, bool enable) override; + virtual void FireStatePropertyChange(sal_Int64 state, bool set) override; + virtual void FireStateFocusedChange(bool enable) override; + virtual bool IsEditable(css::uno::Reference<css::accessibility::XAccessibleContext> const & xContext); + + // update all children's state + void UpdateAllChildrenState( css::accessibility::XAccessible* pXAccessible); + + bool NotifyChildEvent(UnoMSAAEvent eWinEvent, const css::uno::Any& Value); + + virtual void HandleSelectionChangedAddEvent( + const css::uno::Any &oldValue, const css::uno::Any &newValue); + virtual void HandleSelectionChangedRemoveEvent( + const css::uno::Any &oldValue, const css::uno::Any &newValue); + virtual void HandleSelectionChangedWithinEvent( + const css::uno::Any &oldValue, const css::uno::Any &newValue); + + virtual void HandlePageChangedEvent( + const css::uno::Any &oldValue, const css::uno::Any &newValue); + + virtual void HandleSectionChangedEvent( + const css::uno::Any &oldValue, const css::uno::Any &newValue); + virtual void HandleColumnChangedEvent( + const css::uno::Any &oldValue, const css::uno::Any &newValue); + + //for name changed event + virtual void HandleNameChangedEvent(css::uno::Any name) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccDescendantManagerEventListener.hxx b/winaccessibility/inc/AccDescendantManagerEventListener.hxx new file mode 100644 index 0000000000..f910c2e644 --- /dev/null +++ b/winaccessibility/inc/AccDescendantManagerEventListener.hxx @@ -0,0 +1,65 @@ +/* -*- 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 + +enum class UnoMSAAEvent; + +#include <stdio.h> +#include <vector> +#include "AccComponentEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +/** + * AccDescendantManagerEventListener is inherited from AccComponentEventListener. It handles + * the events generated by active descendant controls. They are: TREE, LIST, and TABLE. + * It defines the procedure of specific event handling related with active descendant components + * and provides the detailed support for some related methods. + */ +class AccDescendantManagerEventListener: public AccComponentEventListener +{ +private: + std::vector<com::sun::star::accessibility::XAccessible*> m_aUnselectedChildrenForDeletion; + +public: + AccDescendantManagerEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); + virtual ~AccDescendantManagerEventListener() override; + + // XAccessibleEventListener + virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) override; + + //for selection changed event + virtual void HandleSelectionChangedEvent( + css::uno::Any oldValue, css::uno::Any newValue); + + virtual void HandleChildChangedNoFocusEvent( + css::uno::Any oldValue, css::uno::Any newValue); + + bool NotifyChildEvent(UnoMSAAEvent eWinEvent, const css::uno::Any& Value); + + virtual void HandleSelectionChangedAddEvent( + const css::uno::Any &oldValue, const css::uno::Any &newValue); + virtual void HandleSelectionChangedRemoveEvent( + const css::uno::Any &oldValue, const css::uno::Any &newValue); + virtual void HandleSelectionChangedWithinEvent( + const css::uno::Any &oldValue, const css::uno::Any &newValue); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccDialogEventListener.hxx b/winaccessibility/inc/AccDialogEventListener.hxx new file mode 100644 index 0000000000..8f47fa94ab --- /dev/null +++ b/winaccessibility/inc/AccDialogEventListener.hxx @@ -0,0 +1,47 @@ +/* -*- 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 <stdio.h> +#include "AccEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +/** + * AccDialogEventListener is inherited from AccEventListener. It handles the events + * generated by Dialogs. The accessible role is: DIALOG. + * It defines the procedure of specific event handling related with dialogs and provides + * the detailed support for some related methods. + */ +class AccDialogEventListener : public AccEventListener +{ +public: + AccDialogEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); + virtual ~AccDialogEventListener() override; + + //AccessibleEventListener + virtual void SAL_CALL + notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) override; + + //state changed + virtual void SetComponentState(sal_Int64 state, bool enable) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccEventListener.hxx b/winaccessibility/inc/AccEventListener.hxx new file mode 100644 index 0000000000..e9dd0e64be --- /dev/null +++ b/winaccessibility/inc/AccEventListener.hxx @@ -0,0 +1,79 @@ +/* -*- 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 <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +#include <cppuhelper/implbase.hxx> + +class AccObjectWinManager; + +/** + * AccEventListener is the general event listener for all controls. It defines the + * procedure of all the event handling and provides the basic support for some simple + * methods. + */ +class AccEventListener : public ::cppu::WeakImplHelper<css::accessibility::XAccessibleEventListener> +{ +protected: + //accessible owner's pointer + css::uno::Reference<css::accessibility::XAccessible> m_xAccessible; + // pointer for object's manager + AccObjectWinManager* m_pObjManager; + +public: + AccEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); + virtual ~AccEventListener() override; + + // XEventListener + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + + // XAccessibleEventListener + virtual void SAL_CALL + notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) override; + + //for name changed event + virtual void HandleNameChangedEvent(css::uno::Any name); + + virtual void HandleChildChangedEvent(css::uno::Any oldValue, css::uno::Any newValue); + virtual void HandleDescriptionChangedEvent(); + + //for state changed event + virtual void HandleStateChangedEvent(css::uno::Any oldValue, css::uno::Any newValue); + virtual void SetComponentState(sal_Int64 state, bool enable); + virtual void FireStatePropertyChange(sal_Int64 state, bool set); + virtual void FireStateFocusedChange(bool enable); + + //for bound rect changed event + virtual void HandleBoundrectChangedEvent(); + + //for visible data changed event + virtual void HandleVisibleDataChangedEvent(); + + // get the accessible role of m_xAccessible + virtual short GetRole(); + //get the accessible parent's role + virtual short GetParentRole(); + + void RemoveMeFromBroadcaster(bool isNotifyDestroy); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccFrameEventListener.hxx b/winaccessibility/inc/AccFrameEventListener.hxx new file mode 100644 index 0000000000..b575b57f50 --- /dev/null +++ b/winaccessibility/inc/AccFrameEventListener.hxx @@ -0,0 +1,50 @@ +/* -*- 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 <stdio.h> +#include "AccEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +/** + * AccFrameEventListener is inherited from AccEventListener. It handles the events + * generated by Dialogs. The accessible roles are: FRAME and ROOT_PANE. + * It defines the procedure of specific event handling related with frames and provides + * the detailed support for some related methods. + */ +class AccFrameEventListener : public AccEventListener +{ +public: + AccFrameEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); + virtual ~AccFrameEventListener() override; + + // XAccessibleEventListener + virtual void SAL_CALL + notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) override; + + //for child changed event + virtual void HandleChildChangedEvent(css::uno::Any oldValue, css::uno::Any newValue) override; + + //state changed + virtual void SetComponentState(sal_Int64 state, bool enable) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccListEventListener.hxx b/winaccessibility/inc/AccListEventListener.hxx new file mode 100644 index 0000000000..eb9911308d --- /dev/null +++ b/winaccessibility/inc/AccListEventListener.hxx @@ -0,0 +1,49 @@ +/* -*- 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 <stdio.h> +#include "AccDescendantManagerEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +/** + * AccListEventListener is inherited from AccDescendantManagerEventListener. It handles + * the events generated by tree controls. The accessible role is: LIST. + * It defines the procedure of specific event handling related with list components + * and provides the detailed support for some related methods. + */ +class AccListEventListener : public AccDescendantManagerEventListener +{ +public: + AccListEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); + virtual ~AccListEventListener() override; + + // XAccessibleEventListener + virtual void SAL_CALL + notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) override; + + //for active descendant changed event + virtual void HandleActiveDescendantChangedEvent(css::uno::Any oldValue, css::uno::Any newValue); + //for value changed event + virtual void HandleValueChangedEvent(css::uno::Any oldValue, css::uno::Any newValue) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccMenuEventListener.hxx b/winaccessibility/inc/AccMenuEventListener.hxx new file mode 100644 index 0000000000..fbe4eb2900 --- /dev/null +++ b/winaccessibility/inc/AccMenuEventListener.hxx @@ -0,0 +1,50 @@ +/* -*- 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 <stdio.h> +#include "AccComponentEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +/** + * AccMenuEventListener is inherited from AccComponentEventListener. It handles the events + * generated by container controls. The accessible role is: MENU + * It defines the procedure of specific event handling related with menus and provides + * the detailed support for some related methods. + */ +class AccMenuEventListener : public AccComponentEventListener +{ +public: + AccMenuEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); + virtual ~AccMenuEventListener() override; + + //AccessibleEventListener + virtual void SAL_CALL + notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) override; + + //for selection changed event + virtual void HandleSelectionChangedEventNoArgs(); + + //for state changed event + virtual void FireStatePropertyChange(sal_Int64 state, bool set) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccObject.hxx b/winaccessibility/inc/AccObject.hxx new file mode 100644 index 0000000000..65c8f57773 --- /dev/null +++ b/winaccessibility/inc/AccObject.hxx @@ -0,0 +1,123 @@ +/* -*- 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 <vector> +#include <map> +#if !defined WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#include <windows.h> +#include <oleacc.h> + +#include <rtl/ref.hxx> + +#include <com/sun/star/accessibility/XAccessible.hpp> +#include <com/sun/star/accessibility/XAccessibleSelection.hpp> +#include <com/sun/star/accessibility/XAccessibleAction.hpp> + +#include "accHelper.hxx" +#include <UAccCOM.h> + +class AccEventListener; +class AccObjectWinManager; +class AccObject; + +typedef std::vector<AccObject *> IAccChildList; + + +class AccObject +{ +private: + + short m_accRole; + long m_resID; + HWND m_pParantID; + IMAccessible* const m_pIMAcc; // AccObjectManager::GetTopWindowIMAccessible relies on this being const + AccObject* m_pParentObj; + IAccChildList m_childrenList; + ::rtl::Reference<AccEventListener> m_pListener; + + css::uno::Reference < css::accessibility::XAccessible > m_xAccRef; + css::uno::Reference < css::accessibility::XAccessibleAction > m_xAccActionRef; + css::uno::Reference < css::accessibility::XAccessibleContext > m_xAccContextRef; + + void ImplInitializeCreateObj();//create COM object + + void UpdateActionDesc(); + void UpdateRole(); + + DWORD GetMSAAStateFromUNO(sal_Int64 xState);//translate state from UNO to MSAA value + css::accessibility::XAccessibleSelection* GetXAccessibleSelection(); + void GetExpandedState(sal_Bool* isExpandable, sal_Bool* isExpanded); + OUString GetMAccessibleValueFromAny(css::uno::Any pAny); + +public: + + AccObject(css::accessibility::XAccessible* pXAcc = nullptr, AccObjectWinManager* pManager = nullptr, + AccEventListener* accListener=nullptr); + virtual ~AccObject(); + + bool UpdateAccessibleInfoFromUnoToMSAA( ); //implement accessible information mapping + void UpdateDefaultAction(); + + IMAccessible* GetIMAccessible(); //return COM interface in acc object + css::uno::Reference<css::accessibility::XAccessible> const& GetXAccessible(); + + void SetResID(long id);//ResID means ChildID in MSAA + long GetResID(); + + + void SetParentHWND(HWND hWnd);//need to set top window handle when send event to AT + HWND GetParentHWND(); + + ::rtl::Reference<AccEventListener> SetListener(::rtl::Reference<AccEventListener> const& pListener); + AccEventListener* getListener(); + + void SetParentObj(AccObject* pParentAccObj); + AccObject* GetParentObj(); + + void InsertChild( AccObject* pChild,short pos = LAST_CHILD); + void DeleteChild( AccObject* pChild ); + AccObject* NextChild(); + + void NotifyDestroy(); + + void DecreaseState( sal_Int64 xState );//call COM interface DecreaseState method + void IncreaseState( sal_Int64 xState );//call COM interface IncreaseState method + + void SetName( css::uno::Any newName); + void SetValue( css::uno::Any pAny ); + + short GetRole() const; + + void UpdateState(); + void UpdateName(); + void UpdateValue(); + void UpdateAction(); + void UpdateValidWindow(); + + void setFocus(); + void unsetFocus(); + + void setLocalizedResourceString(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccObjectContainerEventListener.hxx b/winaccessibility/inc/AccObjectContainerEventListener.hxx new file mode 100644 index 0000000000..37ab738068 --- /dev/null +++ b/winaccessibility/inc/AccObjectContainerEventListener.hxx @@ -0,0 +1,47 @@ +/* -*- 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 <stdio.h> +#include "AccContainerEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + + +/** + * AccObjectContainerEventListener is inherited from AccContainerEventListener. It handles the events + * generated by container controls. The accessible role is: SHAPE + * It defines the procedure of specific event handling related with shapes and provides + * the detailed support for some related methods. + */ +class AccObjectContainerEventListener: public AccContainerEventListener +{ +public: + AccObjectContainerEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); + virtual ~AccObjectContainerEventListener() override; + + virtual void HandleStateChangedEvent( + css::uno::Any oldValue, css::uno::Any newValue) override; + + //for visible data changed event, for shapes, the visibledatachanged should be mapped to LOCATION_CHANGED + virtual void HandleVisibleDataChangedEvent() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccObjectWinManager.hxx b/winaccessibility/inc/AccObjectWinManager.hxx new file mode 100644 index 0000000000..024a58fc86 --- /dev/null +++ b/winaccessibility/inc/AccObjectWinManager.hxx @@ -0,0 +1,146 @@ +/* -*- 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 <map> +#include <mutex> + +#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> + +namespace com::sun::star::accessibility { +class XAccessible; +} +class ResIDGenerator; +class AccEventListener; +class AccObject; +enum class UnoMSAAEvent; + +/******************************************************************* +AccObjectWinManager complete the functions: +1. Insert, delete,query,update Acc objects +2. Create, delete,fire AccEventLister, the lifecycle of AccEventListener is as same as + Acc Object + 3.Return COM interface for AT,by the call back in salframe + 4.Pass accessible information to Acc objects + *******************************************************************/ +class AccObjectWinManager +{ +private: + typedef std::map<com::sun::star::accessibility::XAccessible*, AccObject> XIdToAccObjHash; + typedef std::map<HWND, com::sun::star::accessibility::XAccessible*> XHWNDToXAccHash; + typedef std::map<const long, AccObject*> XResIdToAccObjHash; + + typedef std::map<const HWND, css::accessibility::XAccessible* > + XHWNDToDocumentHash; + + // guard any access to XIdAccList and HwndXAcc + std::recursive_mutex m_Mutex; + + //XAccessible to AccObject + XIdToAccObjHash XIdAccList; + + //HWND to All XAccessible pointer + XHWNDToXAccHash HwndXAcc; + + //id_Child to AccObject + XResIdToAccObjHash XResIdAccList; + + //for file name support + XHWNDToDocumentHash XHWNDDocList; + + css::accessibility::XAccessible* oldFocus; + + ResIDGenerator ResIdGen; + +private: + long ImpleGenerateResID(); + AccObject* GetAccObjByXAcc( css::accessibility::XAccessible* pXAcc); + + IMAccessible* GetTopWindowIMAccessible(HWND hWnd); + + css::accessibility::XAccessible* GetAccDocByHWND(HWND hWnd); + + static rtl::Reference<AccEventListener> DeleteAccListener(AccObject* pAccObj); + static void InsertAccChildNode(AccObject* pCurObj,AccObject* pParentObj,HWND pWnd); + static void DeleteAccChildNode(AccObject* pChild); + void DeleteFromHwndXAcc(css::accessibility::XAccessible const * pXAcc ); + + ::rtl::Reference<AccEventListener> CreateAccEventListener( + css::accessibility::XAccessible* pXAcc); +public: + AccObjectWinManager(); + virtual ~AccObjectWinManager(); + 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); + + bool NotifyAccEvent(css::accessibility::XAccessible* pXAcc, UnoMSAAEvent eEvent); + + sal_Int64 Get_ToATInterface(sal_Int64 nHWnd, long lParam, WPARAM wParam); + + void DecreaseState(css::accessibility::XAccessible* pXAcc, sal_Int64 nState); + void IncreaseState(css::accessibility::XAccessible* pXAcc, sal_Int64 nState); + void UpdateState( css::accessibility::XAccessible* pXAcc ); + + void SetValue( css::accessibility::XAccessible* pXAcc, css::uno::Any pAny ); + void UpdateValue( css::accessibility::XAccessible* pXAcc ); + + void SetAccName( css::accessibility::XAccessible* pXAcc, css::uno::Any newName); + void UpdateAccName( css::accessibility::XAccessible* pXAcc ); + + void UpdateAccFocus( css::accessibility::XAccessible* newFocus ); + void UpdateAction( css::accessibility::XAccessible* pXAcc ); + + static bool IsContainer( css::accessibility::XAccessible* pAccessible ); + + virtual IMAccessible* GetIAccessibleFromXAccessible(css::accessibility::XAccessible* pXAcc); + virtual IMAccessible* GetIAccessibleFromResID(long resID); + + void NotifyDestroy( css::accessibility::XAccessible* pXAcc ); + css::accessibility::XAccessible* GetParentXAccessible( css::accessibility::XAccessible* pXAcc ); + short GetParentRole( css::accessibility::XAccessible* pXAcc ); + + void SaveTopWindowHandle(HWND hWnd, css::accessibility::XAccessible* pXAcc); + + void UpdateChildState(css::accessibility::XAccessible* pXAcc); + + bool IsSpecialToolbarItem(css::accessibility::XAccessible* pXAcc); + + static short GetRole(css::accessibility::XAccessible* pXAcc); + + css::accessibility::XAccessible* GetAccDocByAccTopWin( css::accessibility::XAccessible* pXAcc ); + bool IsTopWinAcc( css::accessibility::XAccessible* pXAcc ); + + static bool IsStateManageDescendant(css::accessibility::XAccessible* pAccessible); + +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccParagraphEventListener.hxx b/winaccessibility/inc/AccParagraphEventListener.hxx new file mode 100644 index 0000000000..d2f5457e1b --- /dev/null +++ b/winaccessibility/inc/AccParagraphEventListener.hxx @@ -0,0 +1,52 @@ +/* -*- 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 <stdio.h> +#include "AccContainerEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +/** + * AccParagraphEventListener is inherited from AccContainerEventListener. It handles the events + * generated by container controls. The accessible roles are: PARAGRAPH, HEADING and BLOCK_QUOTE. + * It defines the procedure of specific event handling related with text containers and provides + * the detailed support for some related methods. + */ +class AccParagraphEventListener : public AccContainerEventListener +{ +public: + AccParagraphEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); + virtual ~AccParagraphEventListener() override; + + //AccessibleEventListener + virtual void SAL_CALL + notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) override; + + //for caret changed event + virtual void HandleCaretChangedEvent(css::uno::Any oldValue, css::uno::Any newValue); + + virtual void SetComponentState(sal_Int64 state, bool enable) override; + + //add TEXT_SELECTION_CHANGED event + void HandleTextSelectionChangedEvent(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccTableEventListener.hxx b/winaccessibility/inc/AccTableEventListener.hxx new file mode 100644 index 0000000000..ee0738f21a --- /dev/null +++ b/winaccessibility/inc/AccTableEventListener.hxx @@ -0,0 +1,49 @@ +/* -*- 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 <stdio.h> +#include "AccDescendantManagerEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +/** + * AccTableEventListener is inherited from AccDescendantManagerEventListener. It handles + * the events generated by tree controls. The accessible role is: TABLE. + * It defines the procedure of specific event handling related with table components + * and provides the detailed support for some related methods. + */ +class AccTableEventListener : public AccDescendantManagerEventListener +{ +public: + AccTableEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); + virtual ~AccTableEventListener() override; + + // XAccessibleEventListener + virtual void SAL_CALL + notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) override; + + //for active descendant changed event + virtual void HandleActiveDescendantChangedEvent(css::uno::Any oldValue, css::uno::Any newValue); + + void HandleTableModelChangeEvent(css::uno::Any newValue); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccTextComponentEventListener.hxx b/winaccessibility/inc/AccTextComponentEventListener.hxx new file mode 100644 index 0000000000..d4b78bcd30 --- /dev/null +++ b/winaccessibility/inc/AccTextComponentEventListener.hxx @@ -0,0 +1,43 @@ +/* -*- 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 <stdio.h> +#include "AccComponentEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +/** + * AccTextComponentEventListener is inherited from AccComponentEventListener. It handles the events + * generated by container controls. The accessible role is: TEXT + * It defines the procedure of specific event handling related with text components and provides + * the detailed support for some related methods. + */ +class AccTextComponentEventListener : public AccComponentEventListener +{ +public: + AccTextComponentEventListener(css::accessibility::XAccessible* pAcc, + AccObjectWinManager* pManager); + virtual ~AccTextComponentEventListener() override; + + virtual void SetComponentState(sal_Int64 state, bool enable) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccTopWindowListener.hxx b/winaccessibility/inc/AccTopWindowListener.hxx new file mode 100644 index 0000000000..d48ad035dd --- /dev/null +++ b/winaccessibility/inc/AccTopWindowListener.hxx @@ -0,0 +1,66 @@ +/* -*- 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 <com/sun/star/awt/XTopWindowListener.hpp> +#include <com/sun/star/awt/XExtendedToolkit.hpp> +#include <com/sun/star/accessibility/XAccessibleContext.hpp> + +#include <cppuhelper/implbase.hxx> + +#include "AccObjectWinManager.hxx" + +/** + * AccEventListener is the general event listener for all top windows. The top windows defined + * in UNO are: FRAME, WINDOW, DIALOG, MENU, TOOLTIP. + * It implements the methods of XTopWindowListener and the most important method is windowOpened(). + * In this method, all the accessible objects (including COM object and Uno objects) are created and + * cached into bridge managers, and they are monitored by listeners for later accessible event handling. + */ +class AccTopWindowListener : public ::cppu::WeakImplHelper<css::awt::XTopWindowListener> +{ +private: + AccObjectWinManager m_aAccObjectManager; + +public: + AccTopWindowListener(); + virtual ~AccTopWindowListener() override; + + // XTopWindowListener + virtual void SAL_CALL windowOpened(const css::lang::EventObject& e) override; + virtual void SAL_CALL windowClosing(const css::lang::EventObject& e) override; + virtual void SAL_CALL windowClosed(const css::lang::EventObject& e) override; + virtual void SAL_CALL windowMinimized(const css::lang::EventObject& e) override; + virtual void SAL_CALL windowNormalized(const css::lang::EventObject& e) override; + virtual void SAL_CALL windowActivated(const css::lang::EventObject& e) override; + virtual void SAL_CALL windowDeactivated(const css::lang::EventObject& e) override; + + // XEventListener + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + + virtual void AddAllListeners(css::accessibility::XAccessible* pAccessible, + css::accessibility::XAccessible* pParentXAcc, HWND pWND); + //for On-Demand load. + virtual void HandleWindowOpened(css::accessibility::XAccessible* pAccessible); + + sal_Int64 GetMSComPtr(sal_Int64 hWnd, sal_Int64 lParam, sal_Int64 wParam); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccTreeEventListener.hxx b/winaccessibility/inc/AccTreeEventListener.hxx new file mode 100644 index 0000000000..cb6551db44 --- /dev/null +++ b/winaccessibility/inc/AccTreeEventListener.hxx @@ -0,0 +1,47 @@ +/* -*- 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 <stdio.h> +#include "AccDescendantManagerEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +/** + * AccTreeEventListener is inherited from AccDescendantManagerEventListener. It handles + * the events generated by tree controls. The accessible role is: TREE. + * It defines the procedure of specific event handling related with tree components + * and provides the detailed support for some related methods. + */ +class AccTreeEventListener : public AccDescendantManagerEventListener +{ +public: + AccTreeEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); + virtual ~AccTreeEventListener() override; + + // XAccessibleEventListener + virtual void SAL_CALL + notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) override; + + //for active descendant changed event + virtual void HandleActiveDescendantChangedEvent(css::uno::Any oldValue, css::uno::Any newValue); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccWindowEventListener.hxx b/winaccessibility/inc/AccWindowEventListener.hxx new file mode 100644 index 0000000000..595f340990 --- /dev/null +++ b/winaccessibility/inc/AccWindowEventListener.hxx @@ -0,0 +1,47 @@ +/* -*- 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 <stdio.h> +#include "AccEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +/** + * AccWindowEventListener is inherited from AccEventListener. It handles the events + * generated by Dialogs. The accessible role is: WINDOW. + * It defines the procedure of specific event handling related with windows and provides + * the detailed support for some related methods. + */ +class AccWindowEventListener : public AccEventListener +{ +public: + AccWindowEventListener(css::accessibility::XAccessible* pAcc, AccObjectWinManager* pManager); + virtual ~AccWindowEventListener() override; + + // XAccessibleEventListener + virtual void SAL_CALL + notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) override; + + //state changed + virtual void SetComponentState(sal_Int64 state, bool enable) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/ResIDGenerator.hxx b/winaccessibility/inc/ResIDGenerator.hxx new file mode 100644 index 0000000000..400f58a2e6 --- /dev/null +++ b/winaccessibility/inc/ResIDGenerator.hxx @@ -0,0 +1,45 @@ +/* -*- 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 <deque> + +//ResID i.e. MSAA child ID, +//this class is responsible for generating a child ID +// +// In IAccessible2, negative child IDs are commonly used to +// indicate unique resource IDs. +class ResIDGenerator +{ +private: + long m_nMin; + std::deque<long> subList; + +public: + ResIDGenerator() + : m_nMin(-1) + { + } + ~ResIDGenerator(); + long GenerateNewResID(); + void SetSub(long number) { subList.push_back(number); }; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/UAccCOMdllapi.h b/winaccessibility/inc/UAccCOMdllapi.h new file mode 100644 index 0000000000..50f705c6da --- /dev/null +++ b/winaccessibility/inc/UAccCOMdllapi.h @@ -0,0 +1,20 @@ +/* -*- 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/. + */ + +#pragma once + +#include <sal/types.h> + +#if defined(UACCCOM_DLLIMPLEMENTATION) +#define UACCCOM_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define UACCCOM_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/accHelper.hxx b/winaccessibility/inc/accHelper.hxx new file mode 100644 index 0000000000..4e2d941c41 --- /dev/null +++ b/winaccessibility/inc/accHelper.hxx @@ -0,0 +1,37 @@ +/* -*- 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 "UAccCOMdllapi.h" + +enum DIRECTION +{ + FIRST_CHILD = 0, + LAST_CHILD = -1, + BEFORE_CHILD = 1, + AFTER_CHILD = 2 +}; + +#define UNO_MSAA_UNMAPPING 0x00000000 + +struct IMAccessible; +UACCCOM_DLLPUBLIC IMAccessible* UAccCOMCreateInstance(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/unomsaaevent.hxx b/winaccessibility/inc/unomsaaevent.hxx new file mode 100644 index 0000000000..e8d77d7cdc --- /dev/null +++ b/winaccessibility/inc/unomsaaevent.hxx @@ -0,0 +1,67 @@ +/* -*- 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 + +enum class UnoMSAAEvent +{ + STATE_FOCUSED, + STATE_CHECKED, + STATE_ARMED, + STATE_PRESSED, + STATE_SELECTED, + STATE_SHOWING, + MENU_START, + MENU_END, + MENUPOPUPSTART, + MENUPOPUPEND, + SELECTION_CHANGED, + INVALIDATE_ALL_CHILDREN, + OBJECT_VALUECHANGE, + OBJECT_NAMECHANGE, + OBJECT_DESCRIPTIONCHANGE, + OBJECT_DEFACTIONCHANGE, + OBJECT_CARETCHANGE, + OBJECT_TEXTCHANGE, + ACTIVE_DESCENDANT_CHANGED, + BOUNDRECT_CHANGED, + VISIBLE_DATA_CHANGED, + SHOW, + STATE_BUSY, + TABLE_CAPTION_CHANGED, + TABLE_COLUMN_DESCRIPTION_CHANGED, + TABLE_COLUMN_HEADER_CHANGED, + TABLE_MODEL_CHANGED, + TABLE_ROW_HEADER_CHANGED, + TABLE_SUMMARY_CHANGED, + OBJECT_REORDER, + PAGE_CHANGED, + CHILD_ADDED, + CHILD_REMOVED, + TABLE_ROW_DESCRIPTION_CHANGED, + SELECTION_CHANGED_ADD, + SELECTION_CHANGED_REMOVE, + SELECTION_CHANGED_WITHIN, + OBJECT_PAGECHANGED, + TEXT_SELECTION_CHANGED, + SECTION_CHANGED, + COLUMN_CHANGED +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |