merge the formfield patch from ooo-build
[ooovba.git] / svx / source / table / accessiblecell.hxx
blob6114b540bbbe20bfb5d1a851bca8b4c7d61ef1cd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: accessiblecell.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_CELL_HXX
32 #define _SVX_ACCESSIBILITY_ACCESSIBLE_CELL_HXX
34 #include <com/sun/star/accessibility/XAccessible.hpp>
35 #include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
36 #include <com/sun/star/accessibility/AccessibleRole.hpp>
37 #include <com/sun/star/drawing/XShape.hpp>
39 #include <rtl/ref.hxx>
41 #include <svx/AccessibleContextBase.hxx>
42 #include <svx/AccessibleComponentBase.hxx>
43 #include <svx/IAccessibleViewForwarderListener.hxx>
44 #include <svx/AccessibleTextHelper.hxx>
46 #include <cppuhelper/implbase1.hxx>
48 #include "cell.hxx"
50 #include <boost/noncopyable.hpp>
52 class SdrObject;
55 namespace accessibility
58 class AccessibleShapeInfo;
59 class AccessibleShapeTreeInfo;
60 class IAccessibleParent;
62 typedef ::cppu::ImplInheritanceHelper1< AccessibleContextBase, ::com::sun::star::accessibility::XAccessibleExtendedComponent > AccessibleCellBase;
64 class AccessibleCell : boost::noncopyable, public AccessibleCellBase, public AccessibleComponentBase, public IAccessibleViewForwarderListener
66 public:
67 AccessibleCell( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxParent, const sdr::table::CellRef& rCell, sal_Int32 nIndex, const AccessibleShapeTreeInfo& rShapeTreeInfo);
68 virtual ~AccessibleCell (void);
70 virtual void Init (void);
72 virtual bool operator== (const AccessibleCell& rAccessibleCell);
74 virtual sal_Bool SetState (sal_Int16 aState);
75 virtual sal_Bool ResetState (sal_Int16 aState);
76 sal_Bool GetState (sal_Int16 aState);
78 // XInterface
79 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
80 virtual void SAL_CALL acquire( ) throw ();
81 virtual void SAL_CALL release( ) throw ();
83 // XAccessibleContext
84 virtual sal_Int32 SAL_CALL getAccessibleChildCount(void) throw(::com::sun::star::uno::RuntimeException);
85 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);
86 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL getAccessibleStateSet(void) throw(::com::sun::star::uno::RuntimeException);
87 virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(void) throw(::com::sun::star::uno::RuntimeException);
88 virtual ::rtl::OUString SAL_CALL getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException);
90 // XAccessibleComponent
91 virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint) throw (::com::sun::star::uno::RuntimeException);
92 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);
93 virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds(void) throw(::com::sun::star::uno::RuntimeException);
94 virtual ::com::sun::star::awt::Point SAL_CALL getLocation(void) throw(::com::sun::star::uno::RuntimeException);
95 virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen(void) throw(::com::sun::star::uno::RuntimeException);
96 virtual ::com::sun::star::awt::Size SAL_CALL getSize(void) throw(::com::sun::star::uno::RuntimeException);
97 virtual void SAL_CALL addFocusListener ( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener) throw (::com::sun::star::uno::RuntimeException);
98 virtual void SAL_CALL removeFocusListener (const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
99 virtual void SAL_CALL grabFocus (void) throw (::com::sun::star::uno::RuntimeException);
100 virtual sal_Int32 SAL_CALL getForeground(void) throw(::com::sun::star::uno::RuntimeException);
101 virtual sal_Int32 SAL_CALL getBackground(void) throw(::com::sun::star::uno::RuntimeException);
103 // XAccessibleExtendedComponent
104 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont (void) throw (::com::sun::star::uno::RuntimeException);
105 virtual ::rtl::OUString SAL_CALL getTitledBorderText (void) throw (::com::sun::star::uno::RuntimeException);
106 virtual ::rtl::OUString SAL_CALL getToolTipText (void) throw (::com::sun::star::uno::RuntimeException);
108 // XAccessibleEventBroadcaster
109 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener) throw(::com::sun::star::uno::RuntimeException);
110 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener) throw(::com::sun::star::uno::RuntimeException);
112 // XServiceInfo
113 virtual ::rtl::OUString SAL_CALL getImplementationName (void) throw(::com::sun::star::uno::RuntimeException);
114 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames (void) throw(::com::sun::star::uno::RuntimeException);
116 // IAccessibleViewForwarderListener
117 virtual void ViewForwarderChanged (ChangeType aChangeType, const IAccessibleViewForwarder* pViewForwarder);
119 using cppu::WeakComponentImplHelperBase::addEventListener;
120 using cppu::WeakComponentImplHelperBase::removeEventListener;
122 // Misc
124 /** set the index _nIndex at the accessible cell param _nIndex The new index in parent.
126 inline void setIndexInParent(sal_Int32 _nIndex) { mnIndexInParent = _nIndex; }
128 protected:
129 /// Bundle of information passed to all shapes in a document tree.
130 AccessibleShapeTreeInfo maShapeTreeInfo;
132 /// the index in parent.
133 sal_Int32 mnIndexInParent;
135 /// The accessible text engine. May be NULL if it can not be created.
136 AccessibleTextHelper* mpText;
138 sdr::table::CellRef mxCell;
140 /// This method is called from the component helper base class while disposing.
141 virtual void SAL_CALL disposing (void);
143 private:
144 explicit AccessibleCell(void); // not implemented
145 explicit AccessibleCell(const AccessibleCell&); // not implemented
146 AccessibleCell& operator=(const AccessibleCell&); // not implemented
149 } // end of namespace accessibility
151 #endif