diff options
author | Steve Yin <steve_y@apache.org> | 2013-11-14 08:18:05 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2013-11-19 10:02:22 +0000 |
commit | a18bdb3bc05e761704cc345a66a9d642bc4f4a0a (patch) | |
tree | 534b0f54f06d684e4496370f6fff38a15bfeb9ac /winaccessibility/inc | |
parent | f0d9beb80f926a05bc7dd87801c6daa7bc268cec (diff) |
Integrate branch of IAccessible2
Just the winaccessibility directory initially.
Change-Id: Ia21abb8d7088646ad6c1f83b3a03e7add716b0c0
Diffstat (limited to 'winaccessibility/inc')
25 files changed, 1892 insertions, 0 deletions
diff --git a/winaccessibility/inc/AccComponentEventListener.hxx b/winaccessibility/inc/AccComponentEventListener.hxx new file mode 100644 index 000000000000..1f9c37e5d76b --- /dev/null +++ b/winaccessibility/inc/AccComponentEventListener.hxx @@ -0,0 +1,78 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCCOMPONENTEVENTLISTENER_HXX +#define __ACCCOMPONENTEVENTLISTENER_HXX + +#include <stdio.h> +#include "AccEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +using namespace ::com::sun::star::uno; +/** + * AccComponentEventListener is inherited from AccEventListener. It handles the evnets + * 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(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccComponentEventListener(); + + //AccessibleEventListener + virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + + //for value changed event + virtual void SAL_CALL handleValueChangedEvent(Any oldValue, Any newValue); + + //for action changed event + virtual void SAL_CALL handleActionChangedEvent(); + + //for text changed event + virtual void SAL_CALL handleTextChangedEvent(Any oldValue, Any newValue); + + //for caret changed event + virtual void SAL_CALL handleCaretChangedEvent(Any oldValue, Any newValue); + + //for visible data changed event + virtual void SAL_CALL handleVisibleDataChangedEvent(); + + //for bound rect changed event + virtual void SAL_CALL handleBoundrectChangedEvent(); + + virtual void SAL_CALL setComponentState(short state, bool enable); + virtual void SAL_CALL fireStatePropertyChange(short state, bool set + ); + virtual void SAL_CALL fireStateFocusdChange(bool enable); + + void handleSelectionChangedEvent(); + + //add TEXT_SELECTION_CHANGED event + void handleTextSelectionChangedEvent(); +}; + +#endif diff --git a/winaccessibility/inc/AccContainerEventListener.hxx b/winaccessibility/inc/AccContainerEventListener.hxx new file mode 100644 index 000000000000..fb354bc69617 --- /dev/null +++ b/winaccessibility/inc/AccContainerEventListener.hxx @@ -0,0 +1,98 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCCONTAINEREVENTLISTENERHXX +#define __ACCCONTAINEREVENTLISTENERHXX + +#include <stdio.h> +#include "AccEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +using namespace ::com::sun::star::uno; + +/** + * AccContainerEventListener is inherited from AccEventListener. It handles the evnets + * 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(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccContainerEventListener(); + + //AccessibleEventListener + virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + + //for child changed event + virtual void SAL_CALL handleChildChangedEvent(Any oldValue, Any newValue); + + //for selection changed event + virtual void SAL_CALL handleSelectionChangedEvent(const Any &oldValue, const Any &newValue); + + //for all children changed event + virtual void SAL_CALL handleAllChildrenChangedEvent(); + + //for text changed event + virtual void SAL_CALL handleTextChangedEvent(Any oldValue, Any newValue); + virtual void SAL_CALL handleStateChangedEvent(Any oldValue, Any newValue); + + //for visible data changed event + virtual void SAL_CALL handleVisibleDataChangedEvent(); + + //for bound rect changed event + virtual void SAL_CALL handleBoundrectChangedEvent(); + + //for value changed event + virtual void SAL_CALL handleValueChangedEvent(Any oldValue, Any newValue); + + //state changed + virtual void SAL_CALL setComponentState(short state, bool enable); + virtual void SAL_CALL fireStatePropertyChange(short state, bool set + ); + virtual void SAL_CALL fireStateFocusdChange(bool enable); + virtual bool SAL_CALL IsEditable(Reference<com::sun::star::accessibility::XAccessibleContext> xContext); + + // update all children's state + void SAL_CALL UpdateAllChildrenState( com::sun::star::accessibility::XAccessible* pXAccessible ); + + bool NotifyChildEvent(short nWinEvent,const Any &Value); + + virtual void handleSelectionChangedAddEvent(const Any &oldValue, const Any &newValue); + virtual void handleSelectionChangedRemoveEvent(const Any &oldValue, const Any &newValue); + virtual void handleSelectionChangedWithinEvent(const Any &oldValue, const Any &newValue); + + virtual void handlePageChangedEvent (const Any &oldValue, const Any &newValue); + + virtual void handleSectionChangedEvent (const Any &oldValue, const Any &newValue); + virtual void handleColumnChangedEvent (const Any &oldValue, const Any &newValue); + //IAccessibility2 Implementation 2009----- + //for name changed event + virtual void SAL_CALL handleNameChangedEvent(Any name); + //-----IAccessibility2 Implementation 2009 +}; + +#endif diff --git a/winaccessibility/inc/AccDescendantManagerEventListener.hxx b/winaccessibility/inc/AccDescendantManagerEventListener.hxx new file mode 100644 index 000000000000..c166c221a74f --- /dev/null +++ b/winaccessibility/inc/AccDescendantManagerEventListener.hxx @@ -0,0 +1,64 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCDESCENDANTMANAGEREVENTLISTENER_HXX +#define __ACCDESCENDANTMANAGEREVENTLISTENER_HXX + +#include <stdio.h> +#include "AccComponentEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +using namespace ::com::sun::star::uno; + +/** + * AccDescendantManagerEventListener is inherited from AccComponentEventListener. It handles + * the evnets 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 +{ +protected: + ::com::sun::star::accessibility::XAccessible* pActiveDescendant; +public: + AccDescendantManagerEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccDescendantManagerEventListener(); + + //AccessibleEventListener + virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + + //for selection changed event + virtual void SAL_CALL handleSelectionChangedEvent(Any oldValue, Any newValue); + + //for child changed event + virtual void SAL_CALL handleChildChangedEvent (Any oldValue, Any newValue); + + virtual void SAL_CALL handleChildChangedNoFocusEvent(Any oldValue, Any newValue); + + bool NotifyChildEvent(short nWinEvent,const Any &Value); + + virtual void handleSelectionChangedAddEvent(const Any &oldValue, const Any &newValue); + virtual void handleSelectionChangedRemoveEvent(const Any &oldValue, const Any &newValue); + virtual void handleSelectionChangedWithinEvent(const Any &oldValue, const Any &newValue); +}; + +#endif diff --git a/winaccessibility/inc/AccDialogEventListener.hxx b/winaccessibility/inc/AccDialogEventListener.hxx new file mode 100644 index 000000000000..1ee76994aa37 --- /dev/null +++ b/winaccessibility/inc/AccDialogEventListener.hxx @@ -0,0 +1,63 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCDIALOGEVENTLISTENER_HXX +#define __ACCDIALOGEVENTLISTENER_HXX + +#include <stdio.h> +#include "AccEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +using namespace ::com::sun::star::uno; + +/** + * AccDialogEventListener is inherited from AccEventListener. It handles the evnets + * 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(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccDialogEventListener(); + + //AccessibleEventListener + virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + + //for child changed event + virtual void SAL_CALL handleChildChangedEvent (Any oldValue, Any newValue); + + //for visible data changed event + virtual void SAL_CALL handleVisibleDataChangedEvent(); + + //for bound rect changed event + virtual void SAL_CALL handleBoundrectChangedEvent(); + + //state changed + virtual void SAL_CALL setComponentState(short state, bool enable); + //virtual void SAL_CALL fireStatePropertyChange(short state, bool set); + //virtual void SAL_CALL fireStateFocusdChange(bool enable); + +}; + +#endif diff --git a/winaccessibility/inc/AccEventListener.hxx b/winaccessibility/inc/AccEventListener.hxx new file mode 100644 index 000000000000..1f824ca8e7f9 --- /dev/null +++ b/winaccessibility/inc/AccEventListener.hxx @@ -0,0 +1,90 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCEVENTLISTENER_HXX +#define __ACCEVENTLISTENER_HXX + +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> +#include <cppuhelper/weak.hxx> +#include <vos/mutex.hxx> + +class AccObjectManagerAgent; +using namespace ::com::sun::star::uno; +/** + * 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 com::sun::star::accessibility::XAccessibleEventListener, + public ::cppu::OWeakObject +{ +private: + oslInterlockedCount m_refcount; +protected: + //accessible owner's pointer + com::sun::star::accessibility::XAccessible* pAccessible; + //agent pointer for objects' manager + AccObjectManagerAgent* pAgent; + //disposed state indicator + bool m_isDisposed; + mutable ::vos::OMutex aRemoveMutex; +public: + AccEventListener( com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccEventListener(); + + //AccessibleEventListener + virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + + //for name changed event + virtual void SAL_CALL handleNameChangedEvent(Any name); + + //for description changed event + virtual void SAL_CALL handleDescriptionChangedEvent(Any desc); + + //for state changed event + virtual void SAL_CALL handleStateChangedEvent (Any oldValue, Any newValue); + virtual void SAL_CALL setComponentState(short state, bool enable); + virtual void SAL_CALL fireStatePropertyChange(short state, bool set + ); + virtual void SAL_CALL fireStateFocusdChange(bool enable); + + //for bound rect changed event + virtual void SAL_CALL handleBoundrectChangedEvent(); + + //for visible data changed event + virtual void SAL_CALL handleVisibleDataChangedEvent(); + + //for interface + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() throw (); + virtual void SAL_CALL release() throw (); + //get the accessible role of pAccessible + virtual short SAL_CALL getRole(); + //get the accessible parent's role + virtual short SAL_CALL getParentRole(); +public: + void removeMeFromBroadcaster(); +}; + +#endif diff --git a/winaccessibility/inc/AccFrameEventListener.hxx b/winaccessibility/inc/AccFrameEventListener.hxx new file mode 100644 index 000000000000..28efe968b204 --- /dev/null +++ b/winaccessibility/inc/AccFrameEventListener.hxx @@ -0,0 +1,63 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCFRAMEEVENTLISTENER_HXX +#define __ACCFRAMEEVENTLISTENER_HXX + +#include <stdio.h> +#include "AccEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +using namespace ::com::sun::star::uno; + +/** + * AccFrameEventListener is inherited from AccEventListener. It handles the evnets + * 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(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccFrameEventListener(); + + //AccessibleEventListener + virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + + //for child changed event + virtual void SAL_CALL handleChildChangedEvent(Any oldValue, Any newValue); + + //for visible data changed event + virtual void SAL_CALL handleVisibleDataChangedEvent(); + + //for bound rect changed event + virtual void SAL_CALL handleBoundrectChangedEvent(); + + //state changed + virtual void SAL_CALL setComponentState(short state, bool enable); + //virtual void SAL_CALL fireStatePropertyChange(short state, bool set); + //virtual void SAL_CALL fireStateFocusdChange(bool enable); + +}; + +#endif diff --git a/winaccessibility/inc/AccListEventListener.hxx b/winaccessibility/inc/AccListEventListener.hxx new file mode 100644 index 000000000000..581b4257d858 --- /dev/null +++ b/winaccessibility/inc/AccListEventListener.hxx @@ -0,0 +1,54 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCLISTEVENTLISTENER_HXX +#define __ACCLISTEVENTLISTENER_HXX + +#include <stdio.h> +#include "AccDescendantManagerEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +using namespace ::com::sun::star::uno; + +/** + * AccListEventListener is inherited from AccDescendantManagerEventListener. It handles + * the evnets 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 +{ +private: + bool shouldDeleteChild; +public: + AccListEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccListEventListener(); + + //AccessibleEventListener + virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + //for active descendant changed event + virtual void SAL_CALL handleActiveDescendantChangedEvent(Any oldValue, Any newValue); + //for value changed event + virtual void SAL_CALL handleValueChangedEvent(Any oldValue, Any newValue); +}; + +#endif diff --git a/winaccessibility/inc/AccMenuEventListener.hxx b/winaccessibility/inc/AccMenuEventListener.hxx new file mode 100644 index 000000000000..ace58073b08f --- /dev/null +++ b/winaccessibility/inc/AccMenuEventListener.hxx @@ -0,0 +1,57 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCMENUEVENTLISTENER_HXX +#define __ACCMENUEVENTLISTENER_HXX + +#include <stdio.h> +#include "AccComponentEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +using namespace ::com::sun::star::uno; + +/** + * AccMenuEventListener is inherited from AccComponentEventListener. It handles the evnets + * 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(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccMenuEventListener(); + + //AccessibleEventListener + virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + + //for child changed event + virtual void SAL_CALL handleChildChangedEvent (Any oldValue, Any newValue); + + //for selection changed event + virtual void SAL_CALL handleSelectionChangedEvent(); + + //for state changed event + virtual void SAL_CALL fireStatePropertyChange(short state, bool set ); +}; + +#endif diff --git a/winaccessibility/inc/AccObject.hxx b/winaccessibility/inc/AccObject.hxx new file mode 100644 index 000000000000..feded8d80136 --- /dev/null +++ b/winaccessibility/inc/AccObject.hxx @@ -0,0 +1,130 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCOBJECT_HXX +#define __ACCOBJECT_HXX + +#include <vector> +#include <map> +#include <oleacc.h> +#include <windows.h> + +#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 AccObjectManagerAgent; +class AccObject; + +typedef std::map< const long, AccObject*,ltstr4 > IAccSelectionList; +typedef std::vector<AccObject *> IAccChildList; + + +class AccObject +{ +private: + + short m_accRole; + long m_resID; + HWND m_pParantID; + sal_Bool m_bShouldDestroy; //avoid access COM interface when acc object is deleted + IMAccessible* m_pIMAcc; + AccObject* m_pParentObj; + IAccChildList m_childrenList; + AccEventListener* m_accListener; + IAccSelectionList m_selectionList; + + ::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible > m_xAccRef; + ::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleAction > m_xAccActionRef; + ::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext > m_xAccContextRef; + + sal_Bool ImplInitilizeCreateObj();//create COM object + + void UpdateActionDesc(); + void UpdateRole(); + + DWORD GetMSAAStateFromUNO(short xState);//translate state from UNO to MSAA value + ::com::sun::star::accessibility::XAccessibleSelection* GetXAccessibleSelection(); + void GetExpandedState(sal_Bool* isExpandable, sal_Bool* isExpanded); + ::rtl::OUString GetMAccessibleValueFromAny(::com::sun::star::uno::Any pAny); + +public: + + AccObject ( ::com::sun::star::accessibility::XAccessible* pXAcc = NULL,AccObjectManagerAgent* pAgent = NULL ,AccEventListener* accListener=NULL); + virtual ~AccObject(); + + sal_Bool UpdateAccessibleInfoFromUnoToMSAA( ); //implement accessible information mapping + void UpdateDefaultAction(); + + IMAccessible* GetIMAccessible(); //return COM interface in acc object + ::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible > 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( AccEventListener* Listener ); + AccEventListener* getListener(); + + void SetParentObj(AccObject* pParentAccObj); + AccObject* GetParentObj(); + + void InsertChild( AccObject* pChild,short pos = LAST_CHILD); + void DeleteChild( AccObject* pChild ); + AccObject* NextChild(); + + void NotifyDestroy(sal_Bool ifDelete); + sal_Bool ifShouldDestroy(); + + void DecreaseState(short xState );//call COM interface DecreaseState method + void IncreaseState( short xState );//call COM interface IncreaseState method + + void SetName( com::sun::star::uno::Any newName); + void SetValue( com::sun::star::uno::Any pAny ); + void SetDescription( com::sun::star::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 diff --git a/winaccessibility/inc/AccObjectContainerEventListener.hxx b/winaccessibility/inc/AccObjectContainerEventListener.hxx new file mode 100644 index 000000000000..35ae0069b574 --- /dev/null +++ b/winaccessibility/inc/AccObjectContainerEventListener.hxx @@ -0,0 +1,50 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef _ACCOBJECTCONTAINEREVENTLISTENER_HXX +#define _ACCOBJECTCONTAINEREVENTLISTENER_HXX + +#include <stdio.h> +#include "AccContainerEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +using namespace ::com::sun::star::uno; + +/** + * AccObjectContainerEventListener is inherited from AccContainerEventListener. It handles the evnets + * 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(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccObjectContainerEventListener(); + + //overwrite handleStateChangedEvent() + virtual void SAL_CALL handleStateChangedEvent (Any oldValue, Any newValue); + //for visible data changed event, for shapes, the visiabledatachanged should be mapped to LOCATION_CHANGED + virtual void SAL_CALL handleVisibleDataChangedEvent(); +}; + +#endif diff --git a/winaccessibility/inc/AccObjectManagerAgent.hxx b/winaccessibility/inc/AccObjectManagerAgent.hxx new file mode 100644 index 000000000000..0d3c085d167c --- /dev/null +++ b/winaccessibility/inc/AccObjectManagerAgent.hxx @@ -0,0 +1,102 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCOBJECTMANAGERAGENT_HXX +#define __ACCOBJECTMANAGERAGENT_HXX + +#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_ +#include <com/sun/star/accessibility/XAccessible.hpp> +#endif + +struct IMAccessible; +struct IAccessible; +class AccObjectWinManager; + +/**************************************************************** +AccObjectMangerAgent is used for manaing AccObjects,which encapsulates +platform differences,and call AccObjectWinManager for Windows platform. To do for +Linux platform +*****************************************************************/ +class AccObjectManagerAgent +{ +private: + + AccObjectWinManager* pWinManager; + +public: + + AccObjectManagerAgent(); + virtual ~AccObjectManagerAgent(); + + virtual unsigned char InsertAccObj( com::sun::star::accessibility::XAccessible* pXAcc, + com::sun::star::accessibility::XAccessible* pParentXAcc, + long pWnd=0); + virtual void GetIAccessibleFromResID(long childID,IMAccessible**); + virtual unsigned char GetIAccessibleFromXAccessible(com::sun::star::accessibility::XAccessible* pXAcc, IAccessible** ppIA); + + virtual void DeleteAccObj( com::sun::star::accessibility::XAccessible* pXAcc ); + virtual IMAccessible* GetIMAccByXAcc(com::sun::star::accessibility::XAccessible* pXAcc); + + unsigned char NotifyAccEvent( short pEvent = 0, com::sun::star::accessibility::XAccessible* pXAcc = 0 ); + + unsigned char InsertChildrenAccObj( com::sun::star::accessibility::XAccessible* pXAcc, + long pWnd=0); + void DeleteChildrenAccObj( com::sun::star::accessibility::XAccessible* pXAcc ); + + void DecreaseState( com::sun::star::accessibility::XAccessible* pXAcc,unsigned short pState ); + void IncreaseState( com::sun::star::accessibility::XAccessible* pXAcc,unsigned short pState ); + void UpdateState( com::sun::star::accessibility::XAccessible* pXAcc ); + + void UpdateLocation( com::sun::star::accessibility::XAccessible* pXAcc, + long Top = 0,long left = 0,long width = 0,long height = 0 ); + void UpdateAction( com::sun::star::accessibility::XAccessible* pXAcc ); + + void UpdateValue( com::sun::star::accessibility::XAccessible* pXAcc ); + void UpdateValue( com::sun::star::accessibility::XAccessible* pXAcc, com::sun::star::uno::Any ); + + void UpdateAccName( com::sun::star::accessibility::XAccessible* pXAcc, com::sun::star::uno::Any newName); + void UpdateAccName( com::sun::star::accessibility::XAccessible* pXAcc); + + void UpdateDescription( com::sun::star::accessibility::XAccessible* pXAcc, com::sun::star::uno::Any newDesc ); + void UpdateDescription( com::sun::star::accessibility::XAccessible* pXAcc ); + + void NotifyDestroy(com::sun::star::accessibility::XAccessible* pXAcc); + + com::sun::star::accessibility::XAccessible* GetParentXAccessible( + com::sun::star::accessibility::XAccessible* pXAcc ); + short GetParentRole(com::sun::star::accessibility::XAccessible* pXAcc ); + unsigned short IsContainer(com::sun::star::accessibility::XAccessible* pXAcc); + + void SaveTopWindowHandle(long hWnd, com::sun::star::accessibility::XAccessible* pXAcc); + + void UpdateChildState(com::sun::star::accessibility::XAccessible* pXAcc); + + bool IsSpecialToolboItem(com::sun::star::accessibility::XAccessible* pXAcc); + + short GetRole(com::sun::star::accessibility::XAccessible* pXAcc); + + com::sun::star::accessibility::XAccessible* GetAccDocByAccTopWin( com::sun::star::accessibility::XAccessible* pXAcc ); + bool IsTopWinAcc( com::sun::star::accessibility::XAccessible* pXAcc ); + + bool IsStateManageDescendant(com::sun::star::accessibility::XAccessible* pXAcc); +}; + +#endif diff --git a/winaccessibility/inc/AccObjectWinManager.hxx b/winaccessibility/inc/AccObjectWinManager.hxx new file mode 100644 index 000000000000..5b8de1b2e48b --- /dev/null +++ b/winaccessibility/inc/AccObjectWinManager.hxx @@ -0,0 +1,177 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCOBJECTWINMANAGER_HXX +#define __ACCOBJECTWINMANAGER_HXX + +#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_ +#include <com/sun/star/accessibility/XAccessible.hpp> +#endif +#include <map> +#include <windows.h> +#include <vos/mutex.hxx> +#include <vcl/dllapi.h> +#include "ResIDGenerator.hxx" +#include "UAccCOM2.h" + +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: + struct ltstr1 + { + bool operator()(const void* s1, const void* s2) const + { + return long(s1)<long(s2); + } + }; + struct ltstr2 + { + bool operator()(const HWND s1, const HWND s2) const + { + return long(s1)<long(s2); + } + }; + struct ltstr3 + { + bool operator()(const long s1, const long s2) const + { + return long(s1)<long(s2); + } + }; + typedef std::map< void*, AccObject,ltstr1 > XIdToAccObjHash; + typedef std::map< HWND,void*,ltstr2 > XHWNDToXAccHash; + typedef std::map< const long, AccObject*,ltstr3 > XResIdToAccObjHash; + + typedef std::map< const long, com::sun::star::accessibility::XAccessible*,ltstr3 > 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; + + com::sun::star::accessibility::XAccessible* oldFocus; + + AccObjectManagerAgent* pAgent; + static AccObjectWinManager* me; + ResIDGenerator ResIdGen; + mutable ::vos::OMutex aDeleteMutex; + mutable ::vos::OMutex aNotifyMutex; + mutable ::vos::OMutex maATInterfaceMutex; + + AccObjectWinManager(AccObjectManagerAgent* Agent=NULL); + +private: + long ImpleGenerateResID(); + AccObject* GetAccObjByXAcc( com::sun::star::accessibility::XAccessible* pXAcc); + + com::sun::star::accessibility::XAccessible* GetXAccByAccObj(AccObject* pAccObj); + + AccObject* GetTopWindowAccObj(HWND hWnd); + + com::sun::star::accessibility::XAccessible* GetAccDocByHWND( long pWnd ); + + void DeleteAccListener( AccObject* pAccObj ); + void InsertAccChildNode(AccObject* pCurObj,AccObject* pParentObj,HWND pWnd); + void DeleteAccChildNode(AccObject* pChild); + void DeleteFromHwndXAcc(com::sun::star::accessibility::XAccessible* pXAcc ); + int UpdateAccSelection(com::sun::star::accessibility::XAccessible* pXAcc); + + AccEventListener* createAccEventListener(com::sun::star::accessibility::XAccessible* pXAcc, AccObjectManagerAgent* Agent); +public: + virtual ~AccObjectWinManager(); + sal_Bool InsertAccObj( com::sun::star::accessibility::XAccessible* pXAcc,com::sun::star::accessibility::XAccessible* pParentXAcc,HWND pWnd); + sal_Bool InsertChildrenAccObj( com::sun::star::accessibility::XAccessible* pXAcc,HWND pWnd=0); + void DeleteAccObj( com::sun::star::accessibility::XAccessible* pXAcc ); + void DeleteChildrenAccObj(com::sun::star::accessibility::XAccessible* pAccObj); + + static AccObjectWinManager* CreateAccObjectWinManagerInstance(AccObjectManagerAgent* Agent); + + sal_Bool NotifyAccEvent( com::sun::star::accessibility::XAccessible* pXAcc,short state = 0 ); + + long Get_ToATInterface( HWND hWnd, long lParam, long wParam); + + void DecreaseState( com::sun::star::accessibility::XAccessible* pXAcc,unsigned short pState ); + void IncreaseState( com::sun::star::accessibility::XAccessible* pXAcc,unsigned short pState ); + void UpdateState( com::sun::star::accessibility::XAccessible* pXAcc ); + void SetLocation( com::sun::star::accessibility::XAccessible* pXAcc, + long Top = 0,long left = 0,long width = 0,long height = 0); + + void SetValue( com::sun::star::accessibility::XAccessible* pXAcc, com::sun::star::uno::Any pAny ); + void UpdateValue( com::sun::star::accessibility::XAccessible* pXAcc ); + + void SetAccName( com::sun::star::accessibility::XAccessible* pXAcc, com::sun::star::uno::Any newName); + void UpdateAccName( com::sun::star::accessibility::XAccessible* pXAcc ); + + void SetDescription( com::sun::star::accessibility::XAccessible* pXAcc, com::sun::star::uno::Any newDesc ); + void UpdateDescription( com::sun::star::accessibility::XAccessible* pXAcc ); + + void SetRole( com::sun::star::accessibility::XAccessible* pXAcc, long Role ); + + void UpdateAccFocus( com::sun::star::accessibility::XAccessible* newFocus ); + void UpdateAction( com::sun::star::accessibility::XAccessible* pXAcc ); + + sal_Bool IsContainer( com::sun::star::accessibility::XAccessible* pAccessible ); + + IMAccessible* GetIMAccByXAcc( com::sun::star::accessibility::XAccessible* pXAcc ); + IMAccessible* GetIAccessibleFromResID(long resID); + + void NotifyDestroy( com::sun::star::accessibility::XAccessible* pXAcc ); + com::sun::star::accessibility::XAccessible* GetParentXAccessible( com::sun::star::accessibility::XAccessible* pXAcc ); + short GetParentRole( com::sun::star::accessibility::XAccessible* pXAcc ); + + void SaveTopWindowHandle(HWND hWnd, com::sun::star::accessibility::XAccessible* pXAcc); + + void UpdateChildState(com::sun::star::accessibility::XAccessible* pXAcc); + + bool IsSpecialToolboItem(com::sun::star::accessibility::XAccessible* pXAcc); + + short GetRole(com::sun::star::accessibility::XAccessible* pXAcc); + + com::sun::star::accessibility::XAccessible* GetAccDocByAccTopWin( com::sun::star::accessibility::XAccessible* pXAcc ); + bool IsTopWinAcc( com::sun::star::accessibility::XAccessible* pXAcc ); + + bool IsStateManageDescendant(com::sun::star::accessibility::XAccessible* pAccessible); + +}; +#endif diff --git a/winaccessibility/inc/AccParagraphEventListener.hxx b/winaccessibility/inc/AccParagraphEventListener.hxx new file mode 100644 index 000000000000..ad6b2e9435d5 --- /dev/null +++ b/winaccessibility/inc/AccParagraphEventListener.hxx @@ -0,0 +1,62 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCPARAGRAPHEVENTLISTENER_HXX +#define __ACCPARAGRAPHEVENTLISTENER_HXX + +#include <stdio.h> +#include "AccContainerEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +using namespace ::com::sun::star::uno; + +/** + * AccParagraphEventListener is inherited from AccContainerEventListener. It handles the evnets + * 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(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccParagraphEventListener(); + + //AccessibleEventListener + virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + + //for caret changed event + virtual void SAL_CALL handleCaretChangedEvent(Any oldValue, Any newValue); + + //for visible data changed event + virtual void SAL_CALL handleVisibleDataChangedEvent(); + + //for bound rect changed event + virtual void SAL_CALL handleBoundrectChangedEvent(); + + virtual void SAL_CALL setComponentState(short state, bool enable); + + //add TEXT_SELECTION_CHANGED event + void handleTextSelectionChangedEvent(); +}; + +#endif diff --git a/winaccessibility/inc/AccResource.hxx b/winaccessibility/inc/AccResource.hxx new file mode 100644 index 000000000000..e6bcfb05cf2f --- /dev/null +++ b/winaccessibility/inc/AccResource.hxx @@ -0,0 +1,69 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef _ACCRESOURCE_HXX +#define _ACCRESOURCE_HXX + +#ifndef _RTL_USTRING_HXX_ +#include <rtl/ustring.hxx> +#endif + +class SimpleResMgr; + +#define ACC_RES_STRING(id) ResourceManager::loadString(id) + +//================================================================== +//= ResourceManager +//= handling ressources within the FormLayer library +//================================================================== +class ResourceManager +{ + static SimpleResMgr* m_pImpl; + +private: + // no instantiation allowed + ResourceManager() + { } + ~ResourceManager() + { } + + // we'll instantiate one static member of the following class, which, in it's dtor, + // ensures that m_pImpl will be deleted + class EnsureDelete + { + public: + EnsureDelete() + { } + ~EnsureDelete(); + }; + friend class EnsureDelete; + +protected: + static void ensureImplExists(); + +public: + /** loads the string with the specified resource id from the FormLayer resource file + */ + static ::rtl::OUString loadString(sal_uInt16 _nResId); +}; + + +#endif diff --git a/winaccessibility/inc/AccTableEventListener.hxx b/winaccessibility/inc/AccTableEventListener.hxx new file mode 100644 index 000000000000..5e22d8449fef --- /dev/null +++ b/winaccessibility/inc/AccTableEventListener.hxx @@ -0,0 +1,53 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCTABLEEVENTLISTENER_HXX +#define __ACCTABLEEVENTLISTENER_HXX + +#include <stdio.h> +#include "AccDescendantManagerEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +using namespace ::com::sun::star::uno; + +/** + * AccTableEventListener is inherited from AccDescendantManagerEventListener. It handles + * the evnets 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(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccTableEventListener(); + + //AccessibleEventListener + virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + //for active descendant changed event + virtual void SAL_CALL handleActiveDescendantChangedEvent(Any oldValue, Any newValue); + + void SAL_CALL handleTableModelChangeEvent(Any newValue); + +}; + +#endif diff --git a/winaccessibility/inc/AccTextComponentEventListener.hxx b/winaccessibility/inc/AccTextComponentEventListener.hxx new file mode 100644 index 000000000000..060d4de400fc --- /dev/null +++ b/winaccessibility/inc/AccTextComponentEventListener.hxx @@ -0,0 +1,48 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCTEXTCOMPONENTEVENTLISTENER_HXX +#define __ACCTEXTCOMPONENTEVENTLISTENER_HXX + +#include <stdio.h> +#include "AccComponentEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +using namespace ::com::sun::star::uno; + +/** + * AccTextComponentEventListener is inherited from AccComponentEventListener. It handles the evnets + * 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(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccTextComponentEventListener(); + + virtual void SAL_CALL setComponentState(short state, bool enable); + +}; + +#endif diff --git a/winaccessibility/inc/AccTopWindowListener.hxx b/winaccessibility/inc/AccTopWindowListener.hxx new file mode 100644 index 000000000000..f061b7b7179d --- /dev/null +++ b/winaccessibility/inc/AccTopWindowListener.hxx @@ -0,0 +1,66 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCTOPWINDOWLISTENER_HXX +#define __ACCTOPWINDOWLISTENER_HXX + +#include <com/sun/star/awt/XTopWindowListener.hpp> +#include <com/sun/star/awt/XExtendedToolkit.hpp> +#include <com/sun/star/accessibility/XAccessibleContext.hpp> +#include <cppuhelper/weak.hxx> + +#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 evnet handling. + */ +class AccTopWindowListener: + public com::sun::star::awt::XTopWindowListener, + public ::cppu::OWeakObject + +{ +private: + AccObjectManagerAgent accManagerAgent; + oslInterlockedCount m_refcount; +public: + AccTopWindowListener(); + virtual ~AccTopWindowListener(); + virtual void SAL_CALL windowOpened( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL windowClosing( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL windowClosed( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL windowMinimized( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL windowNormalized( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL windowActivated( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL windowDeactivated( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw (); + virtual void SAL_CALL release( ) throw (); + virtual void AddAllListeners(com::sun::star::accessibility::XAccessible* pAccessible,com::sun::star::accessibility::XAccessible* pParentXAcc,HWND pWND ); + //for On-Demand load. + virtual void handleWindowOpened( com::sun::star::accessibility::XAccessible* pAccessible ); +}; + +#endif diff --git a/winaccessibility/inc/AccTreeEventListener.hxx b/winaccessibility/inc/AccTreeEventListener.hxx new file mode 100644 index 000000000000..430fe307c126 --- /dev/null +++ b/winaccessibility/inc/AccTreeEventListener.hxx @@ -0,0 +1,50 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCTREEEVENTLISTENER_HXX +#define __ACCTREEEVENTLISTENER_HXX + +#include <stdio.h> +#include "AccDescendantManagerEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +using namespace ::com::sun::star::uno; + +/** + * AccTreeEventListener is inherited from AccDescendantManagerEventListener. It handles + * the evnets 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(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccTreeEventListener(); + + //AccessibleEventListener + virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + //for active descendant changed event + virtual void SAL_CALL handleActiveDescendantChangedEvent(Any oldValue, Any newValue); +}; + +#endif diff --git a/winaccessibility/inc/AccWindowEventListener.hxx b/winaccessibility/inc/AccWindowEventListener.hxx new file mode 100644 index 000000000000..38b671e1a816 --- /dev/null +++ b/winaccessibility/inc/AccWindowEventListener.hxx @@ -0,0 +1,60 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCWINDOWEVENTLISTENER_HXX +#define __ACCWINDOWEVENTLISTENER_HXX + +#include <stdio.h> +#include "AccEventListener.hxx" +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> + +using namespace ::com::sun::star::uno; +/** + * 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(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent); + virtual ~AccWindowEventListener(); + + //AccessibleEventListener + virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + + //for child changed event + virtual void SAL_CALL handleChildChangedEvent (Any oldValue, Any newValue); + + //for visible data changed event + virtual void SAL_CALL handleVisibleDataChangedEvent(); + + //for bound rect changed event + virtual void SAL_CALL handleBoundrectChangedEvent(); + + //state changed + virtual void SAL_CALL setComponentState(short state, bool enable); + +}; + +#endif diff --git a/winaccessibility/inc/ResIDGenerator.hxx b/winaccessibility/inc/ResIDGenerator.hxx new file mode 100644 index 000000000000..bc5644217a3f --- /dev/null +++ b/winaccessibility/inc/ResIDGenerator.hxx @@ -0,0 +1,56 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __RESIDGENERATOR_HXX +#define __RESIDGENERATOR_HXX + +#define PRIMARY_RESID 0x00000001 +#include <deque> + +//ResID i.e. MSAA child ID, +//this class is responsible for generating a child ID +class ResIDGenerator +{ +private: + + long min; + long max; + std::deque<long> subList; + +public: + + ResIDGenerator( long minNum = PRIMARY_RESID,long maxNum = PRIMARY_RESID); + long GenerateNewResID(); + void SetSub(long number) + { + subList.push_back(number); + }; + virtual ~ResIDGenerator(); + +}; + +inline ResIDGenerator::ResIDGenerator( long minNum ,long maxNum ) +{ + min = minNum; + max = maxNum; +} + +#endif diff --git a/winaccessibility/inc/UAccCOM2.h b/winaccessibility/inc/UAccCOM2.h new file mode 100644 index 000000000000..cb0d355caed8 --- /dev/null +++ b/winaccessibility/inc/UAccCOM2.h @@ -0,0 +1,30 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __UACCCOM2_H +#define __UACCCOM2_H + +// Just a wrapper header for disabling this warning.... + +#pragma warning( disable: 4917 ) /* a GUID can only be associated with a class, interface or namespace */ +#include "UAccCOM.h" + +#endif diff --git a/winaccessibility/inc/accHelper.hxx b/winaccessibility/inc/accHelper.hxx new file mode 100644 index 000000000000..df1abeb80d2c --- /dev/null +++ b/winaccessibility/inc/accHelper.hxx @@ -0,0 +1,145 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCHELPER_HXX +#define __ACCHELPER_HXX + +#include <com/sun/star/accessibility/XAccessibleText.hpp> +#include <com/sun/star/accessibility/AccessibleRole.hpp> +#include <com/sun/star/accessibility/AccessibleStateType.hpp> + +#include "UAccCOM2.h" + +enum DIRECTION +{ + FIRST_CHILD=0, + LAST_CHILD=-1, + BEFORE_CHILD=1 , + AFTER_CHILD=2 +}; + +#define CHILDID_SELF 0 +#define UNO_MSAA_UNMAPPING 0x00000000 + +using namespace com::sun::star::uno; +using namespace com::sun::star::accessibility::AccessibleRole; +using namespace com::sun::star::accessibility::AccessibleStateType; + +//Role mapping table,left side is UNO role, right side is MSAA role +const short ROLE_TABLE[][2] = + { + {UNKNOWN, IA2_ROLE_UNKNOWN}, + {ALERT , ROLE_SYSTEM_DIALOG}, + {COLUMN_HEADER , ROLE_SYSTEM_COLUMNHEADER}, + //{CANVAS , ROLE_SYSTEM_CLIENT}, + {CANVAS , IA2_ROLE_CANVAS}, + {CHECK_BOX , ROLE_SYSTEM_CHECKBUTTON}, + {CHECK_MENU_ITEM , IA2_ROLE_CHECK_MENU_ITEM}, + {COLOR_CHOOSER, IA2_ROLE_COLOR_CHOOSER}, + {COMBO_BOX , ROLE_SYSTEM_COMBOBOX}, + {DATE_EDITOR , IA2_ROLE_DATE_EDITOR}, + {DESKTOP_ICON , IA2_ROLE_DESKTOP_ICON}, + {DESKTOP_PANE, IA2_ROLE_DESKTOP_PANE}, + {DIRECTORY_PANE, IA2_ROLE_DIRECTORY_PANE}, + {DIALOG, ROLE_SYSTEM_DIALOG}, + {DOCUMENT, ROLE_SYSTEM_DOCUMENT}, + {EMBEDDED_OBJECT , IA2_ROLE_EMBEDDED_OBJECT }, + {END_NOTE , IA2_ROLE_ENDNOTE }, + {FILE_CHOOSER , IA2_ROLE_FILE_CHOOSER }, + {FILLER, ROLE_SYSTEM_WHITESPACE}, + {FONT_CHOOSER, IA2_ROLE_FONT_CHOOSER}, + {FOOTER, IA2_ROLE_FOOTER}, + {FOOTNOTE, IA2_ROLE_FOOTNOTE}, + //{FRAME, IA2_ROLE_FRAME}, + {FRAME, ROLE_SYSTEM_DIALOG}, + {GLASS_PANE , IA2_ROLE_GLASS_PANE}, + {GRAPHIC , ROLE_SYSTEM_GRAPHIC}, + {GROUP_BOX, ROLE_SYSTEM_GROUPING}, + {HEADER , IA2_ROLE_HEADER}, + {HEADING , IA2_ROLE_HEADING}, + {HYPER_LINK , ROLE_SYSTEM_TEXT}, + {ICON , IA2_ROLE_ICON}, + {INTERNAL_FRAME, IA2_ROLE_INTERNAL_FRAME}, + {LABEL, ROLE_SYSTEM_STATICTEXT}, + {LAYERED_PANE , IA2_ROLE_LAYERED_PANE}, + {LIST , ROLE_SYSTEM_LIST}, + {LIST_ITEM , ROLE_SYSTEM_LISTITEM}, + //{MENU , ROLE_SYSTEM_MENUPOPUP}, + {MENU, ROLE_SYSTEM_MENUITEM}, + {MENU_BAR, ROLE_SYSTEM_MENUBAR}, + {MENU_ITEM, ROLE_SYSTEM_MENUITEM}, + {OPTION_PANE , IA2_ROLE_OPTION_PANE}, + {PAGE_TAB, ROLE_SYSTEM_PAGETAB}, + {PAGE_TAB_LIST, ROLE_SYSTEM_PAGETABLIST}, + {PANEL, IA2_ROLE_OPTION_PANE}, + {PARAGRAPH, IA2_ROLE_PARAGRAPH}, + {PASSWORD_TEXT, ROLE_SYSTEM_TEXT}, + {POPUP_MENU, ROLE_SYSTEM_MENUPOPUP}, + {PUSH_BUTTON, ROLE_SYSTEM_PUSHBUTTON}, + {PROGRESS_BAR, ROLE_SYSTEM_PROGRESSBAR}, + {RADIO_BUTTON, ROLE_SYSTEM_RADIOBUTTON}, + {RADIO_MENU_ITEM, IA2_ROLE_RADIO_MENU_ITEM}, + {ROW_HEADER , ROLE_SYSTEM_ROWHEADER}, + {ROOT_PANE, IA2_ROLE_ROOT_PANE}, + {SCROLL_BAR , ROLE_SYSTEM_SCROLLBAR}, + {SCROLL_PANE , IA2_ROLE_SCROLL_PANE}, + {SHAPE, IA2_ROLE_SHAPE}, + {SEPARATOR , ROLE_SYSTEM_SEPARATOR}, + {SLIDER , ROLE_SYSTEM_SLIDER}, + {SPIN_BOX , ROLE_SYSTEM_SPINBUTTON}, + {SPLIT_PANE, IA2_ROLE_SPLIT_PANE}, + {STATUS_BAR, ROLE_SYSTEM_STATUSBAR}, + {TABLE, ROLE_SYSTEM_TABLE}, + {TABLE_CELL , ROLE_SYSTEM_CELL}, + {TEXT, ROLE_SYSTEM_TEXT}, + {TEXT_FRAME , IA2_ROLE_TEXT_FRAME}, + //for change toggle button to push button for jaws + {TOGGLE_BUTTON, ROLE_SYSTEM_PUSHBUTTON}, + + {TOOL_BAR, ROLE_SYSTEM_TOOLBAR}, + {TOOL_TIP, ROLE_SYSTEM_TOOLTIP}, + {TREE , ROLE_SYSTEM_OUTLINE}, + {VIEW_PORT , IA2_ROLE_VIEW_PORT}, + {WINDOW, ROLE_SYSTEM_WINDOW}, + {BUTTON_DROPDOWN, ROLE_SYSTEM_BUTTONDROPDOWN}, + {BUTTON_MENU, ROLE_SYSTEM_BUTTONMENU}, + {CAPTION, IA2_ROLE_CAPTION}, + {CHART, IA2_ROLE_SHAPE}, + {EDIT_BAR, IA2_ROLE_EDITBAR}, + {FORM, IA2_ROLE_FORM}, + {IMAGE_MAP , IA2_ROLE_IMAGE_MAP}, + {NOTE, IA2_ROLE_NOTE}, + {PAGE, IA2_ROLE_PAGE}, + {RULER , IA2_ROLE_RULER}, + {SECTION, IA2_ROLE_SECTION}, + {TREE_ITEM , ROLE_SYSTEM_OUTLINEITEM}, + {TREE_TABLE, ROLE_SYSTEM_OUTLINE} + }; + +struct ltstr4 +{ + bool operator()(const long s1, const long s2) const + { + return long(s1)<long(s2); + } +}; + +#endif diff --git a/winaccessibility/inc/act.hxx b/winaccessibility/inc/act.hxx new file mode 100644 index 000000000000..09fb1e3ac767 --- /dev/null +++ b/winaccessibility/inc/act.hxx @@ -0,0 +1,90 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __ACCACT_HXX +#define __ACCACT_HXX + +#include <windows.h> +#include <tchar.h> + + +static bool IsXPOrLater() +{ + OSVERSIONINFO osvi; + + ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); + + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + GetVersionEx(&osvi); + return ((osvi.dwMajorVersion > 5) || + ((osvi.dwMajorVersion == 5) && (osvi.dwMinorVersion >= 1))); +} + +static HANDLE pActCtx = INVALID_HANDLE_VALUE; +static ULONG_PTR lpCookie; + +static bool ActivateActContext() +{ + if(!IsXPOrLater()) + return false; + + ACTCTX actctx; + + ZeroMemory(&actctx, sizeof(actctx)); + + actctx.cbSize = sizeof(actctx); + + TCHAR szDllDirPath[1024]; + ::GetCurrentDirectory(1024,szDllDirPath); + LPTSTR szDllPath = szDllDirPath; + lstrcat(szDllPath, _T("\\UAccCOM.dll")); + + actctx.lpSource = szDllPath; + actctx.lpResourceName = MAKEINTRESOURCE(97); + actctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID; + + HANDLE pActCtx = CreateActCtx(&actctx); + + if(pActCtx != INVALID_HANDLE_VALUE) + { + if(ActivateActCtx(pActCtx, &lpCookie)) + { + return true; + } + } + pActCtx = INVALID_HANDLE_VALUE; + lpCookie = 0; + return false; +} + +static void DeactivateActContext() +{ + if(!IsXPOrLater()) + return; + + if(lpCookie) + DeactivateActCtx(0, lpCookie); + + if(pActCtx!=INVALID_HANDLE_VALUE) + ReleaseActCtx(pActCtx); +} +#endif
\ No newline at end of file diff --git a/winaccessibility/inc/g_msacc.hxx b/winaccessibility/inc/g_msacc.hxx new file mode 100644 index 000000000000..4b33f6213416 --- /dev/null +++ b/winaccessibility/inc/g_msacc.hxx @@ -0,0 +1,27 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __G_MSACC_HXX +#define __G_MSACC_HXX + +extern AccTopWindowListener* g_pTop; + +#endif diff --git a/winaccessibility/inc/unomsaaevent.hxx b/winaccessibility/inc/unomsaaevent.hxx new file mode 100644 index 000000000000..9f00a6cc10fd --- /dev/null +++ b/winaccessibility/inc/unomsaaevent.hxx @@ -0,0 +1,110 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef __UNOMSAAEVENT_HXX +#define __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 chang event +const short UM_EVENT_SECTION_CHANGED = 40; +const short UM_EVENT_COLUMN_CHANGED = 41; + +#endif |