1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessibleCell.hxx,v $
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 ************************************************************************/
32 #ifndef _SC_ACCESSIBLECELL_HXX
33 #define _SC_ACCESSIBLECELL_HXX
35 #include "AccessibleCellBase.hxx"
37 #include "viewdata.hxx"
38 #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
39 #include <unotools/accessiblerelationsethelper.hxx>
40 #include <svx/AccessibleStaticTextBase.hxx>
41 #include <comphelper/uno3.hxx>
44 class ScAccessibleDocument
;
47 This base class provides an implementation of the
48 <code>AccessibleCell</code> service.
50 class ScAccessibleCell
51 : public ScAccessibleCellBase
,
52 public accessibility::AccessibleStaticTextBase
55 //===== internal ========================================================
57 const ::com::sun::star::uno::Reference
<
58 ::com::sun::star::accessibility::XAccessible
>& rxParent
,
59 ScTabViewShell
* pViewShell
,
60 ScAddress
& rCellAddress
,
63 ScAccessibleDocument
* pAccDoc
);
67 using ScAccessibleCellBase::disposing
;
68 virtual void SAL_CALL
disposing();
71 virtual ~ScAccessibleCell();
73 using ScAccessibleCellBase::IsDefunc
;
76 ///===== XInterface =====================================================
80 ///===== XTypeProvider ===================================================
82 DECLARE_XTYPEPROVIDER()
84 ///===== XAccessibleComponent ============================================
86 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
>
87 SAL_CALL
getAccessibleAtPoint(
88 const ::com::sun::star::awt::Point
& rPoint
)
89 throw (::com::sun::star::uno::RuntimeException
);
91 virtual void SAL_CALL
grabFocus( )
92 throw (::com::sun::star::uno::RuntimeException
);
95 /// Return the object's current bounding box relative to the desktop.
96 virtual Rectangle
GetBoundingBoxOnScreen(void) const
97 throw (::com::sun::star::uno::RuntimeException
);
99 /// Return the object's current bounding box relative to the parent object.
100 virtual Rectangle
GetBoundingBox(void) const
101 throw (::com::sun::star::uno::RuntimeException
);
104 ///===== XAccessibleContext ==============================================
106 /// Return the number of currently visible children.
107 // is overloaded to calculate this on demand
108 virtual sal_Int32 SAL_CALL
109 getAccessibleChildCount(void)
110 throw (::com::sun::star::uno::RuntimeException
);
112 /// Return the specified child or NULL if index is invalid.
113 // is overloaded to calculate this on demand
114 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
115 getAccessibleChild(sal_Int32 nIndex
)
116 throw (::com::sun::star::uno::RuntimeException
,
117 ::com::sun::star::lang::IndexOutOfBoundsException
);
119 /// Return the set of current states.
120 virtual ::com::sun::star::uno::Reference
<
121 ::com::sun::star::accessibility::XAccessibleStateSet
> SAL_CALL
122 getAccessibleStateSet(void)
123 throw (::com::sun::star::uno::RuntimeException
);
125 virtual ::com::sun::star::uno::Reference
<
126 ::com::sun::star::accessibility::XAccessibleRelationSet
> SAL_CALL
127 getAccessibleRelationSet(void)
128 throw (::com::sun::star::uno::RuntimeException
);
130 ///===== XServiceInfo ====================================================
132 /** Returns an identifier for the implementation of this object.
134 virtual ::rtl::OUString SAL_CALL
135 getImplementationName(void)
136 throw (::com::sun::star::uno::RuntimeException
);
138 /** Returns a list of all supported services.
140 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
141 getSupportedServiceNames(void)
142 throw (::com::sun::star::uno::RuntimeException
);
145 ScTabViewShell
* mpViewShell
;
146 ScAccessibleDocument
* mpAccDoc
;
148 ScSplitPos meSplitPos
;
151 const com::sun::star::uno::Reference
<
152 ::com::sun::star::accessibility::XAccessibleStateSet
>& rxParentStates
);
153 virtual sal_Bool
IsEditable(
154 const com::sun::star::uno::Reference
<
155 ::com::sun::star::accessibility::XAccessibleStateSet
>& rxParentStates
);
157 const com::sun::star::uno::Reference
<
158 ::com::sun::star::accessibility::XAccessibleStateSet
>& rxParentStates
);
159 sal_Bool
IsSelected();
161 ScDocument
* GetDocument(ScTabViewShell
* mpViewShell
);
163 ::std::auto_ptr
< SvxEditSource
> CreateEditSource(ScTabViewShell
* pViewShell
, ScAddress aCell
, ScSplitPos eSplitPos
);
165 void FillDependends(utl::AccessibleRelationSetHelper
* pRelationSet
);
166 void FillPrecedents(utl::AccessibleRelationSetHelper
* pRelationSet
);
167 void AddRelation(const ScAddress
& rCell
,
168 const sal_uInt16 aRelationType
,
169 ::utl::AccessibleRelationSetHelper
* pRelationSet
);
170 void AddRelation(const ScRange
& rRange
,
171 const sal_uInt16 aRelationType
,
172 ::utl::AccessibleRelationSetHelper
* pRelationSet
);