xref: /aoo42x/main/sc/source/ui/inc/AccessibleCell.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir 
29*cdf0e10cSrcweir #ifndef _SC_ACCESSIBLECELL_HXX
30*cdf0e10cSrcweir #define _SC_ACCESSIBLECELL_HXX
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #include "AccessibleCellBase.hxx"
33*cdf0e10cSrcweir #include "global.hxx"
34*cdf0e10cSrcweir #include "viewdata.hxx"
35*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
36*cdf0e10cSrcweir #include <unotools/accessiblerelationsethelper.hxx>
37*cdf0e10cSrcweir #include <editeng/AccessibleStaticTextBase.hxx>
38*cdf0e10cSrcweir #include <comphelper/uno3.hxx>
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir class ScTabViewShell;
41*cdf0e10cSrcweir class ScAccessibleDocument;
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir /**	@descr
44*cdf0e10cSrcweir         This base class provides an implementation of the
45*cdf0e10cSrcweir         <code>AccessibleCell</code> service.
46*cdf0e10cSrcweir */
47*cdf0e10cSrcweir class ScAccessibleCell
48*cdf0e10cSrcweir 	:	public	ScAccessibleCellBase,
49*cdf0e10cSrcweir         public  accessibility::AccessibleStaticTextBase
50*cdf0e10cSrcweir {
51*cdf0e10cSrcweir public:
52*cdf0e10cSrcweir 	//=====  internal  ========================================================
53*cdf0e10cSrcweir 	ScAccessibleCell(
54*cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
55*cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessible>& rxParent,
56*cdf0e10cSrcweir 		ScTabViewShell* pViewShell,
57*cdf0e10cSrcweir 		ScAddress& rCellAddress,
58*cdf0e10cSrcweir 		sal_Int32 nIndex,
59*cdf0e10cSrcweir 		ScSplitPos eSplitPos,
60*cdf0e10cSrcweir         ScAccessibleDocument* pAccDoc);
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir 	virtual void Init();
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir     using ScAccessibleCellBase::disposing;
65*cdf0e10cSrcweir     virtual void SAL_CALL disposing();
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir protected:
68*cdf0e10cSrcweir 	virtual ~ScAccessibleCell();
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir     using ScAccessibleCellBase::IsDefunc;
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir public:
73*cdf0e10cSrcweir 	///=====  XInterface  =====================================================
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir 	DECLARE_XINTERFACE()
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir     ///=====  XTypeProvider  ===================================================
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir     DECLARE_XTYPEPROVIDER()
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir     ///=====  XAccessibleComponent  ============================================
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
84*cdf0e10cSrcweir 		SAL_CALL getAccessibleAtPoint(
85*cdf0e10cSrcweir 		const ::com::sun::star::awt::Point& rPoint )
86*cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir     virtual void SAL_CALL grabFocus(  )
89*cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir protected:
92*cdf0e10cSrcweir     ///	Return the object's current bounding box relative to the desktop.
93*cdf0e10cSrcweir 	virtual Rectangle GetBoundingBoxOnScreen(void) const
94*cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir 	///	Return the object's current bounding box relative to the parent object.
97*cdf0e10cSrcweir 	virtual Rectangle GetBoundingBox(void) const
98*cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir public:
101*cdf0e10cSrcweir 	///=====  XAccessibleContext  ==============================================
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir     ///	Return the number of currently visible children.
104*cdf0e10cSrcweir     // is overloaded to calculate this on demand
105*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL
106*cdf0e10cSrcweir     	getAccessibleChildCount(void)
107*cdf0e10cSrcweir     				throw (::com::sun::star::uno::RuntimeException);
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir     ///	Return the specified child or NULL if index is invalid.
110*cdf0e10cSrcweir     // is overloaded to calculate this on demand
111*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
112*cdf0e10cSrcweir     	getAccessibleChild(sal_Int32 nIndex)
113*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException,
114*cdf0e10cSrcweir 				::com::sun::star::lang::IndexOutOfBoundsException);
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir 	///	Return the set of current states.
117*cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference<
118*cdf0e10cSrcweir             ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
119*cdf0e10cSrcweir     	getAccessibleStateSet(void)
120*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference<
123*cdf0e10cSrcweir 		::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
124*cdf0e10cSrcweir    		getAccessibleRelationSet(void)
125*cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir 	///=====  XServiceInfo  ====================================================
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir     /**	Returns an identifier for the implementation of this object.
130*cdf0e10cSrcweir     */
131*cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL
132*cdf0e10cSrcweir     	getImplementationName(void)
133*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir 	/** Returns a list of all supported services.
136*cdf0e10cSrcweir     */
137*cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
138*cdf0e10cSrcweir     	getSupportedServiceNames(void)
139*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir private:
142*cdf0e10cSrcweir 	ScTabViewShell* mpViewShell;
143*cdf0e10cSrcweir     ScAccessibleDocument* mpAccDoc;
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir 	ScSplitPos meSplitPos;
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir 	sal_Bool IsDefunc(
148*cdf0e10cSrcweir 		const com::sun::star::uno::Reference<
149*cdf0e10cSrcweir 		::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
150*cdf0e10cSrcweir 	virtual sal_Bool IsEditable(
151*cdf0e10cSrcweir 		const com::sun::star::uno::Reference<
152*cdf0e10cSrcweir 		::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
153*cdf0e10cSrcweir 	sal_Bool IsOpaque(
154*cdf0e10cSrcweir 		const com::sun::star::uno::Reference<
155*cdf0e10cSrcweir 		::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
156*cdf0e10cSrcweir 	sal_Bool IsSelected();
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir 	ScDocument* GetDocument(ScTabViewShell* mpViewShell);
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir 	::std::auto_ptr< SvxEditSource > CreateEditSource(ScTabViewShell* pViewShell, ScAddress aCell, ScSplitPos eSplitPos);
161*cdf0e10cSrcweir 
162*cdf0e10cSrcweir 	void FillDependends(utl::AccessibleRelationSetHelper* pRelationSet);
163*cdf0e10cSrcweir 	void FillPrecedents(utl::AccessibleRelationSetHelper* pRelationSet);
164*cdf0e10cSrcweir 	void AddRelation(const ScAddress& rCell,
165*cdf0e10cSrcweir 		const sal_uInt16 aRelationType,
166*cdf0e10cSrcweir 		::utl::AccessibleRelationSetHelper* pRelationSet);
167*cdf0e10cSrcweir 	void AddRelation(const ScRange& rRange,
168*cdf0e10cSrcweir 		const sal_uInt16 aRelationType,
169*cdf0e10cSrcweir 		::utl::AccessibleRelationSetHelper* pRelationSet);
170*cdf0e10cSrcweir };
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir #endif
174