From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- winaccessibility/inc/AccComponentEventListener.hxx | 74 ++++++++++ winaccessibility/inc/AccContainerEventListener.hxx | 100 +++++++++++++ .../inc/AccDescendantManagerEventListener.hxx | 67 +++++++++ winaccessibility/inc/AccDialogEventListener.hxx | 54 +++++++ winaccessibility/inc/AccEventListener.hxx | 83 +++++++++++ winaccessibility/inc/AccFrameEventListener.hxx | 55 ++++++++ winaccessibility/inc/AccListEventListener.hxx | 54 +++++++ winaccessibility/inc/AccMenuEventListener.hxx | 57 ++++++++ winaccessibility/inc/AccObject.hxx | 143 +++++++++++++++++++ .../inc/AccObjectContainerEventListener.hxx | 50 +++++++ winaccessibility/inc/AccObjectManagerAgent.hxx | 105 ++++++++++++++ winaccessibility/inc/AccObjectWinManager.hxx | 157 +++++++++++++++++++++ winaccessibility/inc/AccParagraphEventListener.hxx | 56 ++++++++ winaccessibility/inc/AccTableEventListener.hxx | 54 +++++++ .../inc/AccTextComponentEventListener.hxx | 47 ++++++ winaccessibility/inc/AccTopWindowListener.hxx | 68 +++++++++ winaccessibility/inc/AccTreeEventListener.hxx | 51 +++++++ winaccessibility/inc/AccWindowEventListener.hxx | 55 ++++++++ winaccessibility/inc/ResIDGenerator.hxx | 50 +++++++ winaccessibility/inc/UAccCOMdllapi.h | 23 +++ winaccessibility/inc/accHelper.hxx | 40 ++++++ winaccessibility/inc/unomsaaevent.hxx | 110 +++++++++++++++ 22 files changed, 1553 insertions(+) create mode 100644 winaccessibility/inc/AccComponentEventListener.hxx create mode 100644 winaccessibility/inc/AccContainerEventListener.hxx create mode 100644 winaccessibility/inc/AccDescendantManagerEventListener.hxx create mode 100644 winaccessibility/inc/AccDialogEventListener.hxx create mode 100644 winaccessibility/inc/AccEventListener.hxx create mode 100644 winaccessibility/inc/AccFrameEventListener.hxx create mode 100644 winaccessibility/inc/AccListEventListener.hxx create mode 100644 winaccessibility/inc/AccMenuEventListener.hxx create mode 100644 winaccessibility/inc/AccObject.hxx create mode 100644 winaccessibility/inc/AccObjectContainerEventListener.hxx create mode 100644 winaccessibility/inc/AccObjectManagerAgent.hxx create mode 100644 winaccessibility/inc/AccObjectWinManager.hxx create mode 100644 winaccessibility/inc/AccParagraphEventListener.hxx create mode 100644 winaccessibility/inc/AccTableEventListener.hxx create mode 100644 winaccessibility/inc/AccTextComponentEventListener.hxx create mode 100644 winaccessibility/inc/AccTopWindowListener.hxx create mode 100644 winaccessibility/inc/AccTreeEventListener.hxx create mode 100644 winaccessibility/inc/AccWindowEventListener.hxx create mode 100644 winaccessibility/inc/ResIDGenerator.hxx create mode 100644 winaccessibility/inc/UAccCOMdllapi.h create mode 100644 winaccessibility/inc/accHelper.hxx create mode 100644 winaccessibility/inc/unomsaaevent.hxx (limited to 'winaccessibility/inc') diff --git a/winaccessibility/inc/AccComponentEventListener.hxx b/winaccessibility/inc/AccComponentEventListener.hxx new file mode 100644 index 000000000..a7fd6fffd --- /dev/null +++ b/winaccessibility/inc/AccComponentEventListener.hxx @@ -0,0 +1,74 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCCOMPONENTEVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCCOMPONENTEVENTLISTENER_HXX + +#include +#include "AccEventListener.hxx" +#include +#include + + +/** + * 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, AccObjectManagerAgent* Agent); + 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(short state, bool enable) override; + virtual void FireStatePropertyChange(short state, bool set) override; + virtual void FireStateFocusedChange(bool enable) override; + + void HandleSelectionChangedEventNoArgs(); + + //add TEXT_SELECTION_CHANGED event + void HandleTextSelectionChangedEvent(); +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCCOMPONENTEVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccContainerEventListener.hxx b/winaccessibility/inc/AccContainerEventListener.hxx new file mode 100644 index 000000000..2bd797a60 --- /dev/null +++ b/winaccessibility/inc/AccContainerEventListener.hxx @@ -0,0 +1,100 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCCONTAINEREVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCCONTAINEREVENTLISTENER_HXX + +#include +#include "AccEventListener.hxx" +#include +#include + + +/** + * 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 containsers and provides + * the detailed support for some related methods. + */ +class AccContainerEventListener: public AccEventListener +{ +public: + AccContainerEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccContainerEventListener() override; + + //AccessibleEventListener + 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); + + //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(short state, bool enable) override; + virtual void FireStatePropertyChange(short state, bool set) override; + virtual void FireStateFocusedChange(bool enable) override; + virtual bool IsEditable(css::uno::Reference const & xContext); + + // update all children's state + void UpdateAllChildrenState( css::accessibility::XAccessible* pXAccessible); + + bool NotifyChildEvent(short nWinEvent, 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; +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCCONTAINEREVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccDescendantManagerEventListener.hxx b/winaccessibility/inc/AccDescendantManagerEventListener.hxx new file mode 100644 index 000000000..ad4ee3542 --- /dev/null +++ b/winaccessibility/inc/AccDescendantManagerEventListener.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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCDESCENDANTMANAGEREVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCDESCENDANTMANAGEREVENTLISTENER_HXX + +#include +#include "AccComponentEventListener.hxx" +#include +#include + +/** + * 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 +{ + +public: + AccDescendantManagerEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + 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); + + //for child changed event + virtual void HandleChildChangedEvent( + css::uno::Any oldValue, css::uno::Any newValue); + + virtual void HandleChildChangedNoFocusEvent( + css::uno::Any oldValue, css::uno::Any newValue); + + bool NotifyChildEvent(short nWinEvent,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); +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCDESCENDANTMANAGEREVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccDialogEventListener.hxx b/winaccessibility/inc/AccDialogEventListener.hxx new file mode 100644 index 000000000..af8a6f0ec --- /dev/null +++ b/winaccessibility/inc/AccDialogEventListener.hxx @@ -0,0 +1,54 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCDIALOGEVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCDIALOGEVENTLISTENER_HXX + +#include +#include "AccEventListener.hxx" +#include +#include + +/** + * 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, AccObjectManagerAgent* Agent); + virtual ~AccDialogEventListener() override; + + //AccessibleEventListener + 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); + + //state changed + virtual void SetComponentState(short state, bool enable) override; + +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCDIALOGEVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccEventListener.hxx b/winaccessibility/inc/AccEventListener.hxx new file mode 100644 index 000000000..9c5515529 --- /dev/null +++ b/winaccessibility/inc/AccEventListener.hxx @@ -0,0 +1,83 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCEVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCEVENTLISTENER_HXX + +#include +#include + +#include + +class AccObjectManagerAgent; + +/** + * 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 m_xAccessible; + //agent pointer for objects' manager + AccObjectManagerAgent* pAgent; +public: + AccEventListener( css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + 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); + + //for description changed event + virtual void HandleDescriptionChangedEvent(css::uno::Any desc); + + //for state changed event + virtual void HandleStateChangedEvent( + css::uno::Any oldValue, css::uno::Any newValue); + virtual void SetComponentState(short state, bool enable); + virtual void FireStatePropertyChange(short 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(); +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCEVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccFrameEventListener.hxx b/winaccessibility/inc/AccFrameEventListener.hxx new file mode 100644 index 000000000..6c8e54fb3 --- /dev/null +++ b/winaccessibility/inc/AccFrameEventListener.hxx @@ -0,0 +1,55 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCFRAMEEVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCFRAMEEVENTLISTENER_HXX + +#include +#include "AccEventListener.hxx" +#include +#include + + +/** + * 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, AccObjectManagerAgent* Agent); + 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); + + //state changed + virtual void SetComponentState(short state, bool enable) override; + +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCFRAMEEVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccListEventListener.hxx b/winaccessibility/inc/AccListEventListener.hxx new file mode 100644 index 000000000..ffa7871de --- /dev/null +++ b/winaccessibility/inc/AccListEventListener.hxx @@ -0,0 +1,54 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCLISTEVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCLISTEVENTLISTENER_HXX + +#include +#include "AccDescendantManagerEventListener.hxx" +#include +#include + + +/** + * 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, AccObjectManagerAgent* Agent); + 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; +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCLISTEVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccMenuEventListener.hxx b/winaccessibility/inc/AccMenuEventListener.hxx new file mode 100644 index 000000000..834b5ca3f --- /dev/null +++ b/winaccessibility/inc/AccMenuEventListener.hxx @@ -0,0 +1,57 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCMENUEVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCMENUEVENTLISTENER_HXX + +#include +#include "AccComponentEventListener.hxx" +#include +#include + + +/** + * 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, AccObjectManagerAgent* Agent); + virtual ~AccMenuEventListener() override; + + //AccessibleEventListener + 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); + + //for selection changed event + virtual void HandleSelectionChangedEventNoArgs(); + + //for state changed event + virtual void FireStatePropertyChange(short state, bool set) override; +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCMENUEVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccObject.hxx b/winaccessibility/inc/AccObject.hxx new file mode 100644 index 000000000..2a024642d --- /dev/null +++ b/winaccessibility/inc/AccObject.hxx @@ -0,0 +1,143 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCOBJECT_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCOBJECT_HXX + +#include +#include +#if !defined WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#include +#include + +#include + +#include +#include +#include + +#include "accHelper.hxx" + +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif +#include +#if defined __clang__ +#pragma clang diagnostic pop +#endif + +class AccEventListener; +class AccObjectManagerAgent; +class AccObject; + +typedef std::map IAccSelectionList; +typedef std::vector IAccChildList; + + +class AccObject +{ +private: + + short m_accRole; + long m_resID; + HWND m_pParantID; + bool m_bShouldDestroy; //avoid access COM interface when acc object is deleted + IMAccessible* m_pIMAcc; + AccObject* m_pParentObj; + IAccChildList m_childrenList; + ::rtl::Reference m_pListener; + IAccSelectionList m_selectionList; + + 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(short 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,AccObjectManagerAgent* pAgent = 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 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(); + + void SetListener(::rtl::Reference 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(bool ifDelete); + bool ifShouldDestroy(); + + void DecreaseState(short xState );//call COM interface DecreaseState method + void IncreaseState( short xState );//call COM interface IncreaseState method + + void SetName( css::uno::Any newName); + void SetValue( css::uno::Any pAny ); + void SetDescription( css::uno::Any newDesc ); + void SetRole( short Role ); + + short GetRole() const; + + void UpdateState(); + void UpdateName(); + void UpdateValue(); + void UpdateAction(); + void UpdateDescription(); + void UpdateValidWindow(); + void UpdateLocation(); + + void setFocus(); + void unsetFocus(); + + void AddSelect(long index, AccObject* accObj); + IAccSelectionList& GetSelection(); + void setLocalizedResourceString(); +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCOBJECT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccObjectContainerEventListener.hxx b/winaccessibility/inc/AccObjectContainerEventListener.hxx new file mode 100644 index 000000000..ec606f56c --- /dev/null +++ b/winaccessibility/inc/AccObjectContainerEventListener.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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCOBJECTCONTAINEREVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCOBJECTCONTAINEREVENTLISTENER_HXX + +#include +#include "AccContainerEventListener.hxx" +#include +#include + + +/** + * 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, AccObjectManagerAgent* Agent); + 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; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccObjectManagerAgent.hxx b/winaccessibility/inc/AccObjectManagerAgent.hxx new file mode 100644 index 000000000..065210512 --- /dev/null +++ b/winaccessibility/inc/AccObjectManagerAgent.hxx @@ -0,0 +1,105 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCOBJECTMANAGERAGENT_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCOBJECTMANAGERAGENT_HXX + +#include + +#include + +struct IMAccessible; +struct IAccessible; +class AccObjectWinManager; + +/**************************************************************** +AccObjectMangerAgent 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 pWinManager; + +public: + + AccObjectManagerAgent(); + virtual ~AccObjectManagerAgent(); + + virtual bool InsertAccObj(css::accessibility::XAccessible* pXAcc, + css::accessibility::XAccessible* pParentXAcc, + sal_Int64 pWnd=0); + 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(short pEvent = 0, css::accessibility::XAccessible* pXAcc = nullptr); + + bool InsertChildrenAccObj(css::accessibility::XAccessible* pXAcc, + sal_Int64 pWnd=0); + void DeleteChildrenAccObj( css::accessibility::XAccessible* pXAcc ); + + void DecreaseState( css::accessibility::XAccessible* pXAcc,unsigned short pState ); + void IncreaseState( css::accessibility::XAccessible* pXAcc,unsigned short pState ); + void UpdateState( css::accessibility::XAccessible* pXAcc ); + + static void UpdateLocation( css::accessibility::XAccessible* pXAcc, + long Top = 0,long left = 0,long width = 0,long height = 0 ); + 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 UpdateDescription( css::accessibility::XAccessible* pXAcc, css::uno::Any newDesc ); + void UpdateDescription( 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(sal_Int64 hWnd, + css::accessibility::XAccessible* pXAcc); + + void UpdateChildState(css::accessibility::XAccessible* pXAcc); + + bool IsSpecialToolboItem(css::accessibility::XAccessible* pXAcc); + + short GetRole(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); + +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccObjectWinManager.hxx b/winaccessibility/inc/AccObjectWinManager.hxx new file mode 100644 index 000000000..1529bc40e --- /dev/null +++ b/winaccessibility/inc/AccObjectWinManager.hxx @@ -0,0 +1,157 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCOBJECTWINMANAGER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCOBJECTWINMANAGER_HXX + +#include +#include +#if !defined WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#include +#include +#include "ResIDGenerator.hxx" + +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif +#include +#if defined __clang__ +#pragma clang diagnostic pop +#endif + +class ResIDGenerator; +class AccObjectManagerAgent; +class AccEventListener; +class AccObject; + +/******************************************************************* +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 +{ + friend class AccObjectManagerAgent; + +private: + typedef std::map XIdToAccObjHash; + typedef std::map XHWNDToXAccHash; + typedef std::map XResIdToAccObjHash; + + typedef std::map + XHWNDToDocumentHash; + + //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; + + AccObjectManagerAgent* pAgent; + ResIDGenerator ResIdGen; + + AccObjectWinManager(AccObjectManagerAgent* Agent=nullptr); + +private: + long ImpleGenerateResID(); + AccObject* GetAccObjByXAcc( css::accessibility::XAccessible* pXAcc); + + AccObject* GetTopWindowAccObj(HWND hWnd); + + css::accessibility::XAccessible* GetAccDocByHWND(HWND hWnd); + + static void DeleteAccListener( AccObject* pAccObj ); + static void InsertAccChildNode(AccObject* pCurObj,AccObject* pParentObj,HWND pWnd); + static void DeleteAccChildNode(AccObject* pChild); + void DeleteFromHwndXAcc(css::accessibility::XAccessible const * pXAcc ); + int UpdateAccSelection(css::accessibility::XAccessible* pXAcc); + + ::rtl::Reference CreateAccEventListener( + css::accessibility::XAccessible* pXAcc); +public: + virtual ~AccObjectWinManager(); + bool InsertAccObj( css::accessibility::XAccessible* pXAcc,css::accessibility::XAccessible* pParentXAcc,HWND pWnd); + 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,short state = 0 ); + + LRESULT Get_ToATInterface(HWND hWnd, long lParam, WPARAM wParam); + + void DecreaseState( css::accessibility::XAccessible* pXAcc,unsigned short pState ); + void IncreaseState( css::accessibility::XAccessible* pXAcc,unsigned short pState ); + void UpdateState( css::accessibility::XAccessible* pXAcc ); + void SetLocation( css::accessibility::XAccessible* pXAcc, + long Top = 0,long left = 0,long width = 0,long height = 0); + + 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 SetDescription( css::accessibility::XAccessible* pXAcc, css::uno::Any newDesc ); + void UpdateDescription( css::accessibility::XAccessible* pXAcc ); + + void SetRole( css::accessibility::XAccessible* pXAcc, long Role ); + + void UpdateAccFocus( css::accessibility::XAccessible* newFocus ); + void UpdateAction( css::accessibility::XAccessible* pXAcc ); + + static bool IsContainer( css::accessibility::XAccessible* pAccessible ); + + IMAccessible* GetIMAccByXAcc( css::accessibility::XAccessible* pXAcc ); + 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 IsSpecialToolboItem(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); + +}; +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCOBJECTWINMANAGER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccParagraphEventListener.hxx b/winaccessibility/inc/AccParagraphEventListener.hxx new file mode 100644 index 000000000..4b11725c5 --- /dev/null +++ b/winaccessibility/inc/AccParagraphEventListener.hxx @@ -0,0 +1,56 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCPARAGRAPHEVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCPARAGRAPHEVENTLISTENER_HXX + +#include +#include "AccContainerEventListener.hxx" +#include +#include + + +/** + * AccParagraphEventListener is inherited from AccContainerEventListener. It handles the events + * generated by container controls. The accessible roles are: PARAGRAPH and HEADING. + * It defines the procedure of specific event handling related with text containsers and provides + * the detailed support for some related methods. + */ +class AccParagraphEventListener: public AccContainerEventListener +{ +public: + AccParagraphEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + 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(short state, bool enable) override; + + //add TEXT_SELECTION_CHANGED event + void HandleTextSelectionChangedEvent(); +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCPARAGRAPHEVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccTableEventListener.hxx b/winaccessibility/inc/AccTableEventListener.hxx new file mode 100644 index 000000000..d9bf2926b --- /dev/null +++ b/winaccessibility/inc/AccTableEventListener.hxx @@ -0,0 +1,54 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCTABLEEVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCTABLEEVENTLISTENER_HXX + +#include +#include "AccDescendantManagerEventListener.hxx" +#include +#include + + +/** + * 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, AccObjectManagerAgent* Agent); + 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); + +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCTABLEEVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccTextComponentEventListener.hxx b/winaccessibility/inc/AccTextComponentEventListener.hxx new file mode 100644 index 000000000..380714a26 --- /dev/null +++ b/winaccessibility/inc/AccTextComponentEventListener.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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCTEXTCOMPONENTEVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCTEXTCOMPONENTEVENTLISTENER_HXX + +#include +#include "AccComponentEventListener.hxx" +#include +#include + + +/** + * 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, AccObjectManagerAgent* Agent); + virtual ~AccTextComponentEventListener() override; + + virtual void SetComponentState(short state, bool enable) override; + +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCTEXTCOMPONENTEVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccTopWindowListener.hxx b/winaccessibility/inc/AccTopWindowListener.hxx new file mode 100644 index 000000000..bd71e08b3 --- /dev/null +++ b/winaccessibility/inc/AccTopWindowListener.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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCTOPWINDOWLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCTOPWINDOWLISTENER_HXX + +#include +#include +#include + +#include + +#include "AccObjectManagerAgent.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 +{ +private: + AccObjectManagerAgent accManagerAgent; +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); +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCTOPWINDOWLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccTreeEventListener.hxx b/winaccessibility/inc/AccTreeEventListener.hxx new file mode 100644 index 000000000..285b8737d --- /dev/null +++ b/winaccessibility/inc/AccTreeEventListener.hxx @@ -0,0 +1,51 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCTREEEVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCTREEEVENTLISTENER_HXX + +#include +#include "AccDescendantManagerEventListener.hxx" +#include +#include + + +/** + * 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, AccObjectManagerAgent* Agent); + 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); +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCTREEEVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccWindowEventListener.hxx b/winaccessibility/inc/AccWindowEventListener.hxx new file mode 100644 index 000000000..aad49d9d7 --- /dev/null +++ b/winaccessibility/inc/AccWindowEventListener.hxx @@ -0,0 +1,55 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCWINDOWEVENTLISTENER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCWINDOWEVENTLISTENER_HXX + +#include +#include "AccEventListener.hxx" +#include +#include + + +/** + * 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, AccObjectManagerAgent* Agent); + virtual ~AccWindowEventListener() 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); + + //state changed + virtual void SetComponentState(short state, bool enable) override; + +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCWINDOWEVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/ResIDGenerator.hxx b/winaccessibility/inc/ResIDGenerator.hxx new file mode 100644 index 000000000..e5995f65b --- /dev/null +++ b/winaccessibility/inc/ResIDGenerator.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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_RESIDGENERATOR_HXX +#define INCLUDED_WINACCESSIBILITY_INC_RESIDGENERATOR_HXX + +#define PRIMARY_RESID 0x00000001 +#include + +//ResID i.e. MSAA child ID, +//this class is responsible for generating a child ID +class ResIDGenerator +{ +private: + + long max; + std::deque subList; + +public: + + ResIDGenerator(long maxNum = PRIMARY_RESID) + : max(maxNum) {} + ~ResIDGenerator(); + long GenerateNewResID(); + void SetSub(long number) + { + subList.push_back(number); + }; + +}; + +#endif // INCLUDED_WINACCESSIBILITY_INC_RESIDGENERATOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/UAccCOMdllapi.h b/winaccessibility/inc/UAccCOMdllapi.h new file mode 100644 index 000000000..41ed958ec --- /dev/null +++ b/winaccessibility/inc/UAccCOMdllapi.h @@ -0,0 +1,23 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_UACCCOMDLLAPI_H +#define INCLUDED_WINACCESSIBILITY_INC_UACCCOMDLLAPI_H + +#include + +#if defined(UACCCOM_DLLIMPLEMENTATION) +#define UACCCOM_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define UACCCOM_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif + +#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 000000000..9319e8176 --- /dev/null +++ b/winaccessibility/inc/accHelper.hxx @@ -0,0 +1,40 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_ACCHELPER_HXX +#define INCLUDED_WINACCESSIBILITY_INC_ACCHELPER_HXX + +#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(); + +#endif // INCLUDED_WINACCESSIBILITY_INC_ACCHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/unomsaaevent.hxx b/winaccessibility/inc/unomsaaevent.hxx new file mode 100644 index 000000000..0661bed66 --- /dev/null +++ b/winaccessibility/inc/unomsaaevent.hxx @@ -0,0 +1,110 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_WINACCESSIBILITY_INC_UNOMSAAEVENT_HXX +#define INCLUDED_WINACCESSIBILITY_INC_UNOMSAAEVENT_HXX + +//STATE_CHANGED with get FOCUSED -> EVENT_OBJECT_FOCUS +const short UM_EVENT_STATE_FOCUSED = 0 ; + +//STATE_CHANGED --> EVENT_OBJECT_STATECHANGE +const short UM_EVENT_STATE_CHECKED = 1 ; +const short UM_EVENT_STATE_ARMED = 2 ; +const short UM_EVENT_STATE_PRESSED = 3 ; +const short UM_EVENT_STATE_SELECTED = 4 ; +const short UM_EVENT_STATE_SHOWING = 5 ; + +//if acc role is MENU_BAR, STATE_CHANGED with get FOCUSED -> EVENT_SYSTEM_MENUSTART +const short UM_EVENT_MENU_START = 6 ; + +//if acc role is MENU_BAR, STATE_CHANGED with lose FOCUSED -> EVENT_SYSTEM_MENUEND +const short UM_EVENT_MENU_END = 7 ; + +//if acc role is POPUP_MENU, STATE_CHANGED with get FOCUSED -> EVENT_SYSTEM_MENUPOPUPSTART +const short UM_EVENT_MENUPOPUPSTART = 8 ; + +//if acc role is POPUP_MENU, STATE_CHANGED with lose FOCUSED -> EVENT_SYSTEM_MENUPOPUPEND +const short UM_EVENT_MENUPOPUPEND = 9 ; + +//SELECTION_CHANGED -> EVENT_OBJECT_SELECTION +const short UM_EVENT_SELECTION_CHANGED = 10 ; + +//INVALIDATE_ALL_CHILDREN --> EVENT_OBJECT_SHOW +const short UM_EVENT_INVALIDATE_ALL_CHILDREN = 11 ; + +//VALUE_CHANGED --> EVENT_OBJECT_VALUECHANGE +const short UM_EVENT_OBJECT_VALUECHANGE = 12 ; + +//NAME_CHANGED --> EVENT_OBJECT_NAMECHANGE +const short UM_EVENT_OBJECT_NAMECHANGE = 13 ; + +//DESCRIPTION_CHANGED --> EVENT_OBJECT_DESCRIPTIONCHANGE +const short UM_EVENT_OBJECT_DESCRIPTIONCHANGE = 14 ; + +//ACTION_CHANGED --> EVENT_OBJECT_DEFACTIONCHANGE +const short UM_EVENT_OBJECT_DEFACTIONCHANGE = 15 ; + +//CARET_CHANGED --> EVENT_OBJECT_LOCATIONCHANGED +const short UM_EVENT_OBJECT_CARETCHANGE = 16 ; + +//TEXT_CHANGED --> EVENT_OBJECT_VALUECHANGE +const short UM_EVENT_OBJECT_TEXTCHANGE = 17 ; + +//ACTIVE_DESCENDANT_CHANGED --> EVENT_OBJECT_FOCUS +const short UM_EVENT_ACTIVE_DESCENDANT_CHANGED = 18 ; + +//BOUNDRECT_CHANGED --> EVENT_OBJECT_LOCATIONCHANGE +const short UM_EVENT_BOUNDRECT_CHANGED = 19 ; + +//VISIBLE_DATA_CHANGED --> EVENT_OBJECT_VALUECHANGE +const short UM_EVENT_VISIBLE_DATA_CHANGED = 20 ; + +//to enable SHOW on dialogs, windows, frames +const short UM_EVENT_SHOW = 21 ; + +const short UM_EVENT_STATE_BUSY = 22 ; + +const short UM_EVENT_TABLE_CAPTION_CHANGED = 24; +const short UM_EVENT_TABLE_COLUMN_DESCRIPTION_CHANGED = 25; +const short UM_EVENT_TABLE_COLUMN_HEADER_CHANGED = 26; +const short UM_EVENT_TABLE_MODEL_CHANGED = 27; +const short UM_EVENT_TABLE_ROW_HEADER_CHANGED = 28; +const short UM_EVENT_TABLE_SUMMARY_CHANGED = 29; +const short UM_EVENT_OBJECT_REORDER = 30; +const short UM_EVENT_PAGE_CHANGED =31; +const short UM_EVENT_CHILD_ADDED =32; +const short UM_EVENT_CHILD_REMOVED =33; +const short UM_EVENT_TABLE_ROW_DESCRIPTION_CHANGED = 34; +const short UM_EVENT_SELECTION_CHANGED_ADD = 35 ; +const short UM_EVENT_SELECTION_CHANGED_REMOVE = 36 ; +const short UM_EVENT_SELECTION_CHANGED_WITHIN = 37 ; + +//support for PAGE_CHANGED event +const short UM_EVENT_OBJECT_PAGECHANGED = 38; + +//to add TEXT_SELECTION_CHANGED event +const short UM_EVENT_TEXT_SELECTION_CHANGED = 39; + +//for section change and column change event +const short UM_EVENT_SECTION_CHANGED = 40; +const short UM_EVENT_COLUMN_CHANGED = 41; + +#endif // INCLUDED_WINACCESSIBILITY_INC_UNOMSAAEVENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3