1*3334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*3334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*3334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*3334a7e6SAndrew Rist * distributed with this work for additional information 6*3334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*3334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*3334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 9*3334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*3334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*3334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*3334a7e6SAndrew Rist * software distributed under the License is distributed on an 15*3334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 17*3334a7e6SAndrew Rist * specific language governing permissions and limitations 18*3334a7e6SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*3334a7e6SAndrew Rist *************************************************************/ 21*3334a7e6SAndrew Rist 22*3334a7e6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_CELL_HXX 25cdf0e10cSrcweir #define _SVX_ACCESSIBILITY_ACCESSIBLE_CELL_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessible.hpp> 28cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp> 29cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleRole.hpp> 30cdf0e10cSrcweir #include <com/sun/star/drawing/XShape.hpp> 31cdf0e10cSrcweir 32cdf0e10cSrcweir #include <rtl/ref.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include <editeng/AccessibleContextBase.hxx> 35cdf0e10cSrcweir #include <editeng/AccessibleComponentBase.hxx> 36cdf0e10cSrcweir #include <svx/IAccessibleViewForwarderListener.hxx> 37cdf0e10cSrcweir #include <svx/AccessibleTextHelper.hxx> 38cdf0e10cSrcweir #include <svx/AccessibleShapeTreeInfo.hxx> 39cdf0e10cSrcweir 40cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx> 41cdf0e10cSrcweir 42cdf0e10cSrcweir #include "cell.hxx" 43cdf0e10cSrcweir 44cdf0e10cSrcweir #include <boost/noncopyable.hpp> 45cdf0e10cSrcweir 46cdf0e10cSrcweir class SdrObject; 47cdf0e10cSrcweir 48cdf0e10cSrcweir 49cdf0e10cSrcweir namespace accessibility 50cdf0e10cSrcweir { 51cdf0e10cSrcweir 52cdf0e10cSrcweir class AccessibleShapeInfo; 53cdf0e10cSrcweir class AccessibleShapeTreeInfo; 54cdf0e10cSrcweir class IAccessibleParent; 55cdf0e10cSrcweir 56cdf0e10cSrcweir typedef ::cppu::ImplInheritanceHelper1< AccessibleContextBase, ::com::sun::star::accessibility::XAccessibleExtendedComponent > AccessibleCellBase; 57cdf0e10cSrcweir 58cdf0e10cSrcweir class AccessibleCell : boost::noncopyable, public AccessibleCellBase, public AccessibleComponentBase, public IAccessibleViewForwarderListener 59cdf0e10cSrcweir { 60cdf0e10cSrcweir public: 61cdf0e10cSrcweir AccessibleCell( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxParent, const sdr::table::CellRef& rCell, sal_Int32 nIndex, const AccessibleShapeTreeInfo& rShapeTreeInfo); 62cdf0e10cSrcweir virtual ~AccessibleCell (void); 63cdf0e10cSrcweir 64cdf0e10cSrcweir virtual void Init (void); 65cdf0e10cSrcweir 66cdf0e10cSrcweir virtual bool operator== (const AccessibleCell& rAccessibleCell); 67cdf0e10cSrcweir 68cdf0e10cSrcweir virtual sal_Bool SetState (sal_Int16 aState); 69cdf0e10cSrcweir virtual sal_Bool ResetState (sal_Int16 aState); 70cdf0e10cSrcweir sal_Bool GetState (sal_Int16 aState); 71cdf0e10cSrcweir 72cdf0e10cSrcweir // XInterface 73cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); 74cdf0e10cSrcweir virtual void SAL_CALL acquire( ) throw (); 75cdf0e10cSrcweir virtual void SAL_CALL release( ) throw (); 76cdf0e10cSrcweir 77cdf0e10cSrcweir // XAccessibleContext 78cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getAccessibleChildCount(void) throw(::com::sun::star::uno::RuntimeException); 79cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL getAccessibleChild(sal_Int32 nIndex) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 80cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL getAccessibleStateSet(void) throw(::com::sun::star::uno::RuntimeException); 81cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(void) throw(::com::sun::star::uno::RuntimeException); 82cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException); 83cdf0e10cSrcweir 84cdf0e10cSrcweir // XAccessibleComponent 85cdf0e10cSrcweir virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint) throw (::com::sun::star::uno::RuntimeException); 86cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const ::com::sun::star::awt::Point& aPoint) throw(::com::sun::star::uno::RuntimeException); 87cdf0e10cSrcweir virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds(void) throw(::com::sun::star::uno::RuntimeException); 88cdf0e10cSrcweir virtual ::com::sun::star::awt::Point SAL_CALL getLocation(void) throw(::com::sun::star::uno::RuntimeException); 89cdf0e10cSrcweir virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen(void) throw(::com::sun::star::uno::RuntimeException); 90cdf0e10cSrcweir virtual ::com::sun::star::awt::Size SAL_CALL getSize(void) throw(::com::sun::star::uno::RuntimeException); 91cdf0e10cSrcweir virtual void SAL_CALL addFocusListener ( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener) throw (::com::sun::star::uno::RuntimeException); 92cdf0e10cSrcweir virtual void SAL_CALL removeFocusListener (const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 93cdf0e10cSrcweir virtual void SAL_CALL grabFocus (void) throw (::com::sun::star::uno::RuntimeException); 94cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getForeground(void) throw(::com::sun::star::uno::RuntimeException); 95cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getBackground(void) throw(::com::sun::star::uno::RuntimeException); 96cdf0e10cSrcweir 97cdf0e10cSrcweir // XAccessibleExtendedComponent 98cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont (void) throw (::com::sun::star::uno::RuntimeException); 99cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getTitledBorderText (void) throw (::com::sun::star::uno::RuntimeException); 100cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getToolTipText (void) throw (::com::sun::star::uno::RuntimeException); 101cdf0e10cSrcweir 102cdf0e10cSrcweir // XAccessibleEventBroadcaster 103cdf0e10cSrcweir virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener) throw(::com::sun::star::uno::RuntimeException); 104cdf0e10cSrcweir virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener) throw(::com::sun::star::uno::RuntimeException); 105cdf0e10cSrcweir 106cdf0e10cSrcweir // XServiceInfo 107cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName (void) throw(::com::sun::star::uno::RuntimeException); 108cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames (void) throw(::com::sun::star::uno::RuntimeException); 109cdf0e10cSrcweir 110cdf0e10cSrcweir // IAccessibleViewForwarderListener 111cdf0e10cSrcweir virtual void ViewForwarderChanged (ChangeType aChangeType, const IAccessibleViewForwarder* pViewForwarder); 112cdf0e10cSrcweir 113cdf0e10cSrcweir using cppu::WeakComponentImplHelperBase::addEventListener; 114cdf0e10cSrcweir using cppu::WeakComponentImplHelperBase::removeEventListener; 115cdf0e10cSrcweir 116cdf0e10cSrcweir // Misc 117cdf0e10cSrcweir 118cdf0e10cSrcweir /** set the index _nIndex at the accessible cell param _nIndex The new index in parent. 119cdf0e10cSrcweir */ 120cdf0e10cSrcweir inline void setIndexInParent(sal_Int32 _nIndex) { mnIndexInParent = _nIndex; } 121cdf0e10cSrcweir 122cdf0e10cSrcweir protected: 123cdf0e10cSrcweir /// Bundle of information passed to all shapes in a document tree. 124cdf0e10cSrcweir AccessibleShapeTreeInfo maShapeTreeInfo; 125cdf0e10cSrcweir 126cdf0e10cSrcweir /// the index in parent. 127cdf0e10cSrcweir sal_Int32 mnIndexInParent; 128cdf0e10cSrcweir 129cdf0e10cSrcweir /// The accessible text engine. May be NULL if it can not be created. 130cdf0e10cSrcweir AccessibleTextHelper* mpText; 131cdf0e10cSrcweir 132cdf0e10cSrcweir sdr::table::CellRef mxCell; 133cdf0e10cSrcweir 134cdf0e10cSrcweir /// This method is called from the component helper base class while disposing. 135cdf0e10cSrcweir virtual void SAL_CALL disposing (void); 136cdf0e10cSrcweir 137cdf0e10cSrcweir private: 138cdf0e10cSrcweir explicit AccessibleCell(void); // not implemented 139cdf0e10cSrcweir explicit AccessibleCell(const AccessibleCell&); // not implemented 140cdf0e10cSrcweir AccessibleCell& operator=(const AccessibleCell&); // not implemented 141cdf0e10cSrcweir }; 142cdf0e10cSrcweir 143cdf0e10cSrcweir } // end of namespace accessibility 144cdf0e10cSrcweir 145cdf0e10cSrcweir #endif 146