xref: /trunk/main/sc/source/ui/inc/AccessibleCsvControl.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
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 
30*cdf0e10cSrcweir #ifndef _SC_ACCESSIBLECSVCONTROL_HXX
31*cdf0e10cSrcweir #define _SC_ACCESSIBLECSVCONTROL_HXX
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleText.hpp>
34*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleTable.hpp>
35*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
36*cdf0e10cSrcweir #include <tools/gen.hxx>
37*cdf0e10cSrcweir #include <tools/string.hxx>
38*cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
39*cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
40*cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
41*cdf0e10cSrcweir #include <editeng/AccessibleStaticTextBase.hxx>
42*cdf0e10cSrcweir #include <comphelper/uno3.hxx>
43*cdf0e10cSrcweir #include "AccessibleContextBase.hxx"
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir // ============================================================================
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir class ScCsvControl;
49*cdf0e10cSrcweir namespace utl { class AccessibleStateSetHelper; }
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir /** Accessible base class used for CSV controls. */
52*cdf0e10cSrcweir class ScAccessibleCsvControl : public ScAccessibleContextBase
53*cdf0e10cSrcweir {
54*cdf0e10cSrcweir protected:
55*cdf0e10cSrcweir     typedef ::com::sun::star::uno::Reference<
56*cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessible > XAccessibleRef;
57*cdf0e10cSrcweir     typedef ::com::sun::star::uno::Reference<
58*cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessibleRelationSet > XAccessibleRelationSetRef;
59*cdf0e10cSrcweir     typedef ::com::sun::star::uno::Reference<
60*cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessibleStateSet > XAccessibleStateSetRef;
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir     typedef ::com::sun::star::awt::Point        AwtPoint;
63*cdf0e10cSrcweir     typedef ::com::sun::star::awt::Size         AwtSize;
64*cdf0e10cSrcweir     typedef ::com::sun::star::awt::Rectangle    AwtRectangle;
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir private:
67*cdf0e10cSrcweir     ScCsvControl*               mpControl;          /// Pointer to the VCL control.
68*cdf0e10cSrcweir 
69*cdf0e10cSrcweir public:
70*cdf0e10cSrcweir     explicit                    ScAccessibleCsvControl(
71*cdf0e10cSrcweir                                     const XAccessibleRef& rxParent,
72*cdf0e10cSrcweir                                     ScCsvControl& rControl,
73*cdf0e10cSrcweir                                     sal_uInt16 nRole );
74*cdf0e10cSrcweir     virtual                     ~ScAccessibleCsvControl();
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir     using ScAccessibleContextBase::disposing;
77*cdf0e10cSrcweir     virtual void SAL_CALL       disposing();
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir     // XAccessibleComponent ---------------------------------------------------
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir     /** Returns the child at the specified point (cell returns NULL). */
82*cdf0e10cSrcweir     virtual XAccessibleRef SAL_CALL getAccessibleAtPoint( const AwtPoint& rPoint )
83*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir     /** Returns true, if the control is visible. */
86*cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isVisible() throw( ::com::sun::star::uno::RuntimeException );
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir     /** Sets the focus to this control. */
89*cdf0e10cSrcweir     virtual void SAL_CALL grabFocus() throw( ::com::sun::star::uno::RuntimeException );
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir     // events -----------------------------------------------------------------
92*cdf0e10cSrcweir public:
93*cdf0e10cSrcweir     /** Sends a GetFocus or LoseFocus event to all listeners. */
94*cdf0e10cSrcweir     virtual void SendFocusEvent( bool bFocused );
95*cdf0e10cSrcweir     /** Sends a caret changed event to all listeners. */
96*cdf0e10cSrcweir     virtual void SendCaretEvent();
97*cdf0e10cSrcweir     /** Sends a visible area changed event to all listeners. */
98*cdf0e10cSrcweir     virtual void SendVisibleEvent();
99*cdf0e10cSrcweir     /** Sends a selection changed event to all listeners. */
100*cdf0e10cSrcweir     virtual void SendSelectionEvent();
101*cdf0e10cSrcweir     /** Sends a table model changed event for changed cell contents to all listeners. */
102*cdf0e10cSrcweir     virtual void SendTableUpdateEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn, bool bAllRows );
103*cdf0e10cSrcweir     /** Sends a table model changed event for an inserted column to all listeners. */
104*cdf0e10cSrcweir     virtual void SendInsertColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn );
105*cdf0e10cSrcweir     /** Sends a table model changed event for a removed column to all listeners. */
106*cdf0e10cSrcweir     virtual void SendRemoveColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn );
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir     // helpers ----------------------------------------------------------------
109*cdf0e10cSrcweir protected:
110*cdf0e10cSrcweir     /** Returns this object's current bounding box relative to the desktop. */
111*cdf0e10cSrcweir     virtual Rectangle GetBoundingBoxOnScreen() const throw( ::com::sun::star::uno::RuntimeException );
112*cdf0e10cSrcweir     /** Returns this object's current bounding box relative to the parent object. */
113*cdf0e10cSrcweir     virtual Rectangle GetBoundingBox() const throw( ::com::sun::star::uno::RuntimeException );
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir     /** Creates a new UUID in rSeq, if it is empty. Locks mutex internally. */
116*cdf0e10cSrcweir     void getUuid( ::com::sun::star::uno::Sequence< sal_Int8 >& rSeq );
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir     /** Returns whether the object is alive. Must be called with locked mutex. */
119*cdf0e10cSrcweir     inline bool implIsAlive() const { return !rBHelper.bDisposed && !rBHelper.bInDispose && mpControl; }
120*cdf0e10cSrcweir     /** Throws an exception, if the object is disposed/disposing or any pointer
121*cdf0e10cSrcweir         is missing. Should be used with locked mutex! */
122*cdf0e10cSrcweir     void ensureAlive() const throw( ::com::sun::star::lang::DisposedException );
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir     /** Returns the VCL control. Assumes a living object. */
125*cdf0e10cSrcweir     ScCsvControl& implGetControl() const;
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir     /** Returns the first child of rxParentObj, which has the role nRole. */
128*cdf0e10cSrcweir     XAccessibleRef implGetChildByRole( const XAccessibleRef& rxParentObj, sal_uInt16 nRole )
129*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
130*cdf0e10cSrcweir     /** Creates a StateSetHelper and fills it with DEFUNC, OPAQUE, ENABLED, SHOWING and VISIBLE. */
131*cdf0e10cSrcweir     ::utl::AccessibleStateSetHelper* implCreateStateSet();
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir     /** Disposes the object. This is a helper called from destructors only. */
134*cdf0e10cSrcweir     void implDispose();
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir     /** Converts the control-relative position to an absolute screen position. */
137*cdf0e10cSrcweir     Point implGetAbsPos( const Point& rPos ) const;
138*cdf0e10cSrcweir };
139*cdf0e10cSrcweir 
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir // ============================================================================
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir class ScCsvRuler;
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir typedef ::cppu::ImplHelper1<
146*cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessibleText >
147*cdf0e10cSrcweir     ScAccessibleCsvRulerImpl;
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir /** Accessible class representing the CSV ruler control. */
150*cdf0e10cSrcweir class ScAccessibleCsvRuler : public ScAccessibleCsvControl, public ScAccessibleCsvRulerImpl
151*cdf0e10cSrcweir {
152*cdf0e10cSrcweir protected:
153*cdf0e10cSrcweir     typedef ::com::sun::star::uno::Sequence<
154*cdf0e10cSrcweir         ::com::sun::star::beans::PropertyValue > PropertyValueSeq;
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir private:
157*cdf0e10cSrcweir     ::rtl::OUStringBuffer       maBuffer;   /// Contains the text representation of the ruler.
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir public:
160*cdf0e10cSrcweir     explicit                    ScAccessibleCsvRuler( ScCsvRuler& rRuler );
161*cdf0e10cSrcweir     virtual                     ~ScAccessibleCsvRuler();
162*cdf0e10cSrcweir 
163*cdf0e10cSrcweir     // XAccessibleComponent -----------------------------------------------------
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getForeground(  )
166*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getBackground(  )
169*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir     // XAccessibleContext -----------------------------------------------------
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir     /** Returns the child count (the ruler does not have children). */
174*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleChildCount()
175*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir     /** Throws an exception (the ruler does not have childern). */
178*cdf0e10cSrcweir     virtual XAccessibleRef SAL_CALL getAccessibleChild( sal_Int32 nIndex )
179*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir     /** Returns the relation to the grid control. */
182*cdf0e10cSrcweir     virtual XAccessibleRelationSetRef SAL_CALL getAccessibleRelationSet()
183*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir     /** Returns the current set of states. */
186*cdf0e10cSrcweir     virtual XAccessibleStateSetRef SAL_CALL getAccessibleStateSet()
187*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
188*cdf0e10cSrcweir 
189*cdf0e10cSrcweir     // XAccessibleText --------------------------------------------------------
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir     /** Return the position of the caret. */
192*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getCaretPosition() throw( ::com::sun::star::uno::RuntimeException );
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir     /** Sets the position of the caret. */
195*cdf0e10cSrcweir     virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex )
196*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir     /** Returns the specified character. */
199*cdf0e10cSrcweir     virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex )
200*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
201*cdf0e10cSrcweir 
202*cdf0e10cSrcweir     /** Returns the attributes of the specified character. */
203*cdf0e10cSrcweir     virtual PropertyValueSeq SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes )
204*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir     /** Returns the screen coordinates of the specified character. */
207*cdf0e10cSrcweir     virtual AwtRectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex )
208*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir     /** Returns the count of characters. */
211*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getCharacterCount() throw( ::com::sun::star::uno::RuntimeException );
212*cdf0e10cSrcweir 
213*cdf0e10cSrcweir     /** Returns the character index at the specified coordinate (object's coordinate system). */
214*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getIndexAtPoint( const AwtPoint& rPoint )
215*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
216*cdf0e10cSrcweir 
217*cdf0e10cSrcweir     /** Returns the selected text (ruler returns empty string). */
218*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getSelectedText() throw( ::com::sun::star::uno::RuntimeException );
219*cdf0e10cSrcweir 
220*cdf0e10cSrcweir     /** Returns the start index of the selection (ruler returns -1). */
221*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getSelectionStart() throw( ::com::sun::star::uno::RuntimeException );
222*cdf0e10cSrcweir 
223*cdf0e10cSrcweir     /** Returns the end index of the selection (ruler returns -1). */
224*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getSelectionEnd() throw( ::com::sun::star::uno::RuntimeException );
225*cdf0e10cSrcweir 
226*cdf0e10cSrcweir     /** Selects a part of the text (ruler does nothing). */
227*cdf0e10cSrcweir     virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
228*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir     /** Returns the entire text. */
231*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getText() throw( ::com::sun::star::uno::RuntimeException );
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir     /** Returns the specified range [Start,End) of the text. */
234*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
235*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir     /** Returns the specified text portion. */
238*cdf0e10cSrcweir     virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
239*cdf0e10cSrcweir     virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
240*cdf0e10cSrcweir     virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir     /** Copies the specified text range into the clipboard (ruler does nothing). */
243*cdf0e10cSrcweir     virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
244*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir     // XInterface -------------------------------------------------------------
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType )
249*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
250*cdf0e10cSrcweir 
251*cdf0e10cSrcweir     virtual void SAL_CALL acquire() throw();
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir     virtual void SAL_CALL release() throw();
254*cdf0e10cSrcweir 
255*cdf0e10cSrcweir     // XServiceInfo -----------------------------------------------------------
256*cdf0e10cSrcweir 
257*cdf0e10cSrcweir     /** Returns an identifier for the implementation of this object. */
258*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName()
259*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
260*cdf0e10cSrcweir 
261*cdf0e10cSrcweir     // XTypeProvider ----------------------------------------------------------
262*cdf0e10cSrcweir 
263*cdf0e10cSrcweir     /** Returns a sequence with all supported interface types. */
264*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
265*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
266*cdf0e10cSrcweir 
267*cdf0e10cSrcweir     /** Returns an implementation ID. */
268*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
269*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
270*cdf0e10cSrcweir 
271*cdf0e10cSrcweir     // events -----------------------------------------------------------------
272*cdf0e10cSrcweir public:
273*cdf0e10cSrcweir     /** Sends a caret changed event to all listeners. */
274*cdf0e10cSrcweir     virtual void SendCaretEvent();
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir     // helpers ----------------------------------------------------------------
277*cdf0e10cSrcweir private:
278*cdf0e10cSrcweir     /** Returns this object's name. */
279*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL createAccessibleName()
280*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
281*cdf0e10cSrcweir     /** Returns this object's description. */
282*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL createAccessibleDescription()
283*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir     /** Throws an exception, if the specified character position is invalid (outside 0..len-1). */
286*cdf0e10cSrcweir     void ensureValidIndex( sal_Int32 nIndex ) const
287*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException );
288*cdf0e10cSrcweir     /** Throws an exception, if the specified character position is invalid (outside 0..len). */
289*cdf0e10cSrcweir     void ensureValidIndexWithEnd( sal_Int32 nIndex ) const
290*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException );
291*cdf0e10cSrcweir     /** Throws an exception, if the specified character range [Start,End) is invalid.
292*cdf0e10cSrcweir         @descr  If Start>End, swaps Start and End before checking. */
293*cdf0e10cSrcweir     void ensureValidRange( sal_Int32& rnStartIndex, sal_Int32& rnEndIndex ) const
294*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException );
295*cdf0e10cSrcweir 
296*cdf0e10cSrcweir     /** Returns the VCL ruler control. Assumes a living object. */
297*cdf0e10cSrcweir     ScCsvRuler& implGetRuler() const;
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir     /** Builds the entire string buffer. */
300*cdf0e10cSrcweir     void constructStringBuffer() throw( ::com::sun::star::uno::RuntimeException );
301*cdf0e10cSrcweir     /** Returns the character count of the text. */
302*cdf0e10cSrcweir     sal_Int32 implGetTextLength() const;
303*cdf0e10cSrcweir 
304*cdf0e10cSrcweir     /** Returns true, if the character at the specified index has a split. */
305*cdf0e10cSrcweir     bool implHasSplit( sal_Int32 nApiPos );
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir     /** Returns the first character index with equal formatting as at nApiPos. */
308*cdf0e10cSrcweir     sal_Int32 implGetFirstEqualFormatted( sal_Int32 nApiPos );
309*cdf0e10cSrcweir     /** Returns the last character index with equal formatting as at nApiPos. */
310*cdf0e10cSrcweir     sal_Int32 implGetLastEqualFormatted( sal_Int32 nApiPos );
311*cdf0e10cSrcweir };
312*cdf0e10cSrcweir 
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir // ============================================================================
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir class ScCsvGrid;
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir typedef ::cppu::ImplHelper2<
319*cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessibleTable,
320*cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessibleSelection >
321*cdf0e10cSrcweir     ScAccessibleCsvGridImpl;
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir /** Accessible class representing the CSV grid control. */
324*cdf0e10cSrcweir class ScAccessibleCsvGrid : public ScAccessibleCsvControl, public ScAccessibleCsvGridImpl
325*cdf0e10cSrcweir {
326*cdf0e10cSrcweir protected:
327*cdf0e10cSrcweir     typedef ::com::sun::star::uno::Reference<
328*cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessibleTable > XAccessibleTableRef;
329*cdf0e10cSrcweir 
330*cdf0e10cSrcweir public:
331*cdf0e10cSrcweir     explicit                    ScAccessibleCsvGrid( ScCsvGrid& rGrid );
332*cdf0e10cSrcweir     virtual                     ~ScAccessibleCsvGrid();
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir     // XAccessibleComponent ---------------------------------------------------
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir     /** Returns the cell at the specified point. */
337*cdf0e10cSrcweir     virtual XAccessibleRef SAL_CALL getAccessibleAtPoint( const AwtPoint& rPoint )
338*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
339*cdf0e10cSrcweir 
340*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getForeground(  )
341*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
342*cdf0e10cSrcweir 
343*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getBackground(  )
344*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
345*cdf0e10cSrcweir 
346*cdf0e10cSrcweir     // XAccessibleContext -----------------------------------------------------
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir     /** Returns the child count (count of cells in the table). */
349*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleChildCount()
350*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir     /** Returns the specified child cell. */
353*cdf0e10cSrcweir     virtual XAccessibleRef SAL_CALL getAccessibleChild( sal_Int32 nIndex )
354*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir     /** Returns the relation to the ruler control. */
357*cdf0e10cSrcweir     virtual XAccessibleRelationSetRef SAL_CALL getAccessibleRelationSet()
358*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
359*cdf0e10cSrcweir 
360*cdf0e10cSrcweir     /** Returns the current set of states. */
361*cdf0e10cSrcweir     virtual XAccessibleStateSetRef SAL_CALL getAccessibleStateSet()
362*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
363*cdf0e10cSrcweir 
364*cdf0e10cSrcweir     // XAccessibleTable -------------------------------------------------------
365*cdf0e10cSrcweir 
366*cdf0e10cSrcweir     /** Returns the number of rows in the table. */
367*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleRowCount()
368*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
369*cdf0e10cSrcweir 
370*cdf0e10cSrcweir     /** Returns the number of columns in the table. */
371*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleColumnCount()
372*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
373*cdf0e10cSrcweir 
374*cdf0e10cSrcweir     /** Returns the description of the specified row in the table. */
375*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow )
376*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
377*cdf0e10cSrcweir 
378*cdf0e10cSrcweir     /** Returns the description text of the specified column in the table. */
379*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn )
380*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
381*cdf0e10cSrcweir 
382*cdf0e10cSrcweir     /** Returns the number of rows occupied at a specified row and column.
383*cdf0e10cSrcweir         @descr  Returns always 1 (Merged cells not supported). */
384*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
385*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
386*cdf0e10cSrcweir 
387*cdf0e10cSrcweir     /** Returns the number of rows occupied at a specified row and column.
388*cdf0e10cSrcweir         @descr  Returns always 1 (Merged cells not supported). */
389*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
390*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
391*cdf0e10cSrcweir 
392*cdf0e10cSrcweir     /** Returns the row headers as an AccessibleTable. */
393*cdf0e10cSrcweir     virtual XAccessibleTableRef SAL_CALL getAccessibleRowHeaders()
394*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
395*cdf0e10cSrcweir 
396*cdf0e10cSrcweir     /** Returns the column headers as an AccessibleTable. */
397*cdf0e10cSrcweir     virtual XAccessibleTableRef SAL_CALL getAccessibleColumnHeaders()
398*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
399*cdf0e10cSrcweir 
400*cdf0e10cSrcweir     /** Returns the selected rows as a sequence. */
401*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows()
402*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
403*cdf0e10cSrcweir 
404*cdf0e10cSrcweir     /** Returns the selected columns as a sequence. */
405*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns()
406*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
407*cdf0e10cSrcweir 
408*cdf0e10cSrcweir     /** Returns true, if the specified row is selected. */
409*cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow )
410*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
411*cdf0e10cSrcweir 
412*cdf0e10cSrcweir     /** Returns true, if the specified column is selected. */
413*cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn )
414*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
415*cdf0e10cSrcweir 
416*cdf0e10cSrcweir     /** Returns the accessible cell object at the specified position. */
417*cdf0e10cSrcweir     virtual XAccessibleRef SAL_CALL getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn )
418*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
419*cdf0e10cSrcweir 
420*cdf0e10cSrcweir     /** Returns the caption object of the table. */
421*cdf0e10cSrcweir     virtual XAccessibleRef SAL_CALL getAccessibleCaption()
422*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
423*cdf0e10cSrcweir 
424*cdf0e10cSrcweir     /** Returns the summary description object of the table. */
425*cdf0e10cSrcweir     virtual XAccessibleRef SAL_CALL getAccessibleSummary()
426*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
427*cdf0e10cSrcweir 
428*cdf0e10cSrcweir     /** Returns true, if the cell at a specified position is selected. */
429*cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn )
430*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
431*cdf0e10cSrcweir 
432*cdf0e10cSrcweir     /** Returns the child index of the cell at the specified position. */
433*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn )
434*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
435*cdf0e10cSrcweir 
436*cdf0e10cSrcweir     /** Returns the row index of the specified child. */
437*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex )
438*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
439*cdf0e10cSrcweir 
440*cdf0e10cSrcweir     /** Returns the column index of the specified child. */
441*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex )
442*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
443*cdf0e10cSrcweir 
444*cdf0e10cSrcweir     // XAccessibleSelection ---------------------------------------------------
445*cdf0e10cSrcweir 
446*cdf0e10cSrcweir     /** Selects the specified child (selects the entire column or the entire table). */
447*cdf0e10cSrcweir     virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex )
448*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
449*cdf0e10cSrcweir 
450*cdf0e10cSrcweir     /** Returns true, if the specified child is selected. */
451*cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex )
452*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
453*cdf0e10cSrcweir 
454*cdf0e10cSrcweir     /** Deselects all cells. */
455*cdf0e10cSrcweir     virtual void SAL_CALL clearAccessibleSelection()
456*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
457*cdf0e10cSrcweir 
458*cdf0e10cSrcweir     /** Selects all cells. */
459*cdf0e10cSrcweir     virtual void SAL_CALL selectAllAccessibleChildren()
460*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
461*cdf0e10cSrcweir 
462*cdf0e10cSrcweir     /** Returns the count of selected children. */
463*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount()
464*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
465*cdf0e10cSrcweir 
466*cdf0e10cSrcweir     /** Returns the child with the specified index in all selected children. */
467*cdf0e10cSrcweir     virtual XAccessibleRef SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
468*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
469*cdf0e10cSrcweir 
470*cdf0e10cSrcweir     /** Deselects the child with the specified index in all selected children. */
471*cdf0e10cSrcweir     virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex )
472*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
473*cdf0e10cSrcweir 
474*cdf0e10cSrcweir     // XInterface -------------------------------------------------------------
475*cdf0e10cSrcweir 
476*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType )
477*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
478*cdf0e10cSrcweir 
479*cdf0e10cSrcweir     virtual void SAL_CALL acquire() throw();
480*cdf0e10cSrcweir 
481*cdf0e10cSrcweir     virtual void SAL_CALL release() throw();
482*cdf0e10cSrcweir 
483*cdf0e10cSrcweir     // XServiceInfo -----------------------------------------------------------
484*cdf0e10cSrcweir 
485*cdf0e10cSrcweir     /** Returns an identifier for the implementation of this object. */
486*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName()
487*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
488*cdf0e10cSrcweir 
489*cdf0e10cSrcweir     // XTypeProvider ----------------------------------------------------------
490*cdf0e10cSrcweir 
491*cdf0e10cSrcweir     /** Returns a sequence with all supported interface types. */
492*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
493*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
494*cdf0e10cSrcweir 
495*cdf0e10cSrcweir     /** Returns an implementation ID. */
496*cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
497*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
498*cdf0e10cSrcweir 
499*cdf0e10cSrcweir     // events -----------------------------------------------------------------
500*cdf0e10cSrcweir public:
501*cdf0e10cSrcweir     /** Sends a GetFocus or LoseFocus event to all listeners. */
502*cdf0e10cSrcweir     virtual void SendFocusEvent( bool bFocused );
503*cdf0e10cSrcweir     /** Sends a table model changed event for changed cell contents to all listeners. */
504*cdf0e10cSrcweir     virtual void SendTableUpdateEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn, bool bAllRows );
505*cdf0e10cSrcweir     /** Sends a table model changed event for an inserted column to all listeners. */
506*cdf0e10cSrcweir     virtual void SendInsertColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn );
507*cdf0e10cSrcweir     /** Sends a table model changed event for a removed column to all listeners. */
508*cdf0e10cSrcweir     virtual void SendRemoveColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn );
509*cdf0e10cSrcweir 
510*cdf0e10cSrcweir     // helpers ----------------------------------------------------------------
511*cdf0e10cSrcweir private:
512*cdf0e10cSrcweir     /** Returns this object's name. */
513*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL createAccessibleName()
514*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
515*cdf0e10cSrcweir     /** Returns this object's description. */
516*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL createAccessibleDescription()
517*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
518*cdf0e10cSrcweir 
519*cdf0e10cSrcweir     /** Throws an exception, if nIndex is not a valid child index. */
520*cdf0e10cSrcweir     void ensureValidIndex( sal_Int32 nIndex ) const
521*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException );
522*cdf0e10cSrcweir     /** Throws an exception, if the specified position is invalid. */
523*cdf0e10cSrcweir     void ensureValidPosition( sal_Int32 nRow, sal_Int32 nColumn ) const
524*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException );
525*cdf0e10cSrcweir 
526*cdf0e10cSrcweir     /** Returns the VCL grid control. Assumes a living object. */
527*cdf0e10cSrcweir     ScCsvGrid& implGetGrid() const;
528*cdf0e10cSrcweir 
529*cdf0e10cSrcweir     /** Returns true, if the specified column (including header) is selected. */
530*cdf0e10cSrcweir     bool implIsColumnSelected( sal_Int32 nColumn ) const;
531*cdf0e10cSrcweir     /** Selects the specified column (including header). */
532*cdf0e10cSrcweir     void implSelectColumn( sal_Int32 nColumn, bool bSelect );
533*cdf0e10cSrcweir 
534*cdf0e10cSrcweir     /** Returns the count of visible rows in the table (including header). */
535*cdf0e10cSrcweir     sal_Int32 implGetRowCount() const;
536*cdf0e10cSrcweir     /** Returns the total column count in the table (including header). */
537*cdf0e10cSrcweir     sal_Int32 implGetColumnCount() const;
538*cdf0e10cSrcweir     /** Returns the count of selected columns in the table. */
539*cdf0e10cSrcweir     sal_Int32 implGetSelColumnCount() const;
540*cdf0e10cSrcweir     /** Returns the total cell count in the table (including header). */
541*cdf0e10cSrcweir     inline sal_Int32 implGetCellCount() const { return implGetRowCount() * implGetColumnCount(); }
542*cdf0e10cSrcweir 
543*cdf0e10cSrcweir     /** Returns the row index from cell index (including header). */
544*cdf0e10cSrcweir     inline sal_Int32 implGetRow( sal_Int32 nIndex ) const { return nIndex / implGetColumnCount(); }
545*cdf0e10cSrcweir     /** Returns the column index from cell index (including header). */
546*cdf0e10cSrcweir     inline sal_Int32 implGetColumn( sal_Int32 nIndex ) const { return nIndex % implGetColumnCount(); }
547*cdf0e10cSrcweir     /** Returns the absolute column index of the nSelColumn-th selected column. */
548*cdf0e10cSrcweir     sal_Int32 implGetSelColumn( sal_Int32 nSelColumn ) const;
549*cdf0e10cSrcweir     /** Returns the child index from cell position (including header). */
550*cdf0e10cSrcweir     inline sal_Int32 implGetIndex( sal_Int32 nRow, sal_Int32 nColumn ) const { return nRow * implGetColumnCount() + nColumn; }
551*cdf0e10cSrcweir 
552*cdf0e10cSrcweir     /** Returns the contents of the specified cell (including header). Indexes must be valid. */
553*cdf0e10cSrcweir     String implGetCellText( sal_Int32 nRow, sal_Int32 nColumn ) const;
554*cdf0e10cSrcweir     /** Creates a new accessible object of the specified cell. Indexes must be valid. */
555*cdf0e10cSrcweir     ScAccessibleCsvControl* implCreateCellObj( sal_Int32 nRow, sal_Int32 nColumn ) const;
556*cdf0e10cSrcweir };
557*cdf0e10cSrcweir 
558*cdf0e10cSrcweir 
559*cdf0e10cSrcweir // ============================================================================
560*cdf0e10cSrcweir 
561*cdf0e10cSrcweir /** Accessible class representing a cell of the CSV grid control. */
562*cdf0e10cSrcweir class ScAccessibleCsvCell : public ScAccessibleCsvControl, public accessibility::AccessibleStaticTextBase
563*cdf0e10cSrcweir {
564*cdf0e10cSrcweir protected:
565*cdf0e10cSrcweir     typedef ::com::sun::star::uno::Sequence<
566*cdf0e10cSrcweir         ::com::sun::star::beans::PropertyValue >    PropertyValueSeq;
567*cdf0e10cSrcweir     typedef ::std::auto_ptr< SvxEditSource >        SvxEditSourcePtr;
568*cdf0e10cSrcweir 
569*cdf0e10cSrcweir private:
570*cdf0e10cSrcweir     String                      maCellText; /// The text contents of this cell.
571*cdf0e10cSrcweir     sal_Int32                   mnLine;     /// The grid line index (core index).
572*cdf0e10cSrcweir     sal_uInt32                  mnColumn;   /// The grid column index (core index).
573*cdf0e10cSrcweir     sal_Int32                   mnIndex;    /// The index of the cell in the table.
574*cdf0e10cSrcweir 
575*cdf0e10cSrcweir public:
576*cdf0e10cSrcweir     explicit                    ScAccessibleCsvCell(
577*cdf0e10cSrcweir                                     ScCsvGrid& rGrid,
578*cdf0e10cSrcweir                                     const String& rCellText,
579*cdf0e10cSrcweir                                     sal_Int32 nRow, sal_Int32 nColumn );
580*cdf0e10cSrcweir     virtual                     ~ScAccessibleCsvCell();
581*cdf0e10cSrcweir 
582*cdf0e10cSrcweir     using ScAccessibleCsvControl::disposing;
583*cdf0e10cSrcweir     virtual void SAL_CALL       disposing();
584*cdf0e10cSrcweir 
585*cdf0e10cSrcweir     // XAccessibleComponent ---------------------------------------------------
586*cdf0e10cSrcweir 
587*cdf0e10cSrcweir     /** Sets the focus to the column of this cell. */
588*cdf0e10cSrcweir     virtual void SAL_CALL grabFocus() throw( ::com::sun::star::uno::RuntimeException );
589*cdf0e10cSrcweir 
590*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getForeground(  )
591*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
592*cdf0e10cSrcweir 
593*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getBackground(  )
594*cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
595*cdf0e10cSrcweir 
596*cdf0e10cSrcweir     // XAccessibleContext -----------------------------------------------------
597*cdf0e10cSrcweir 
598*cdf0e10cSrcweir     /** Returns the child count. */
599*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleChildCount()
600*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
601*cdf0e10cSrcweir 
602*cdf0e10cSrcweir     /** Returns the specified child. */
603*cdf0e10cSrcweir     virtual XAccessibleRef SAL_CALL getAccessibleChild( sal_Int32 nIndex )
604*cdf0e10cSrcweir         throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
605*cdf0e10cSrcweir 
606*cdf0e10cSrcweir     /** Returns the index of this cell in the table. */
607*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleIndexInParent()
608*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
609*cdf0e10cSrcweir 
610*cdf0e10cSrcweir     /** Returns the relation to the ruler control. */
611*cdf0e10cSrcweir     virtual XAccessibleRelationSetRef SAL_CALL getAccessibleRelationSet()
612*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
613*cdf0e10cSrcweir 
614*cdf0e10cSrcweir     /** Returns the current set of states. */
615*cdf0e10cSrcweir     virtual XAccessibleStateSetRef SAL_CALL getAccessibleStateSet()
616*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
617*cdf0e10cSrcweir 
618*cdf0e10cSrcweir     // XInterface -------------------------------------------------------------
619*cdf0e10cSrcweir 
620*cdf0e10cSrcweir     DECLARE_XINTERFACE()
621*cdf0e10cSrcweir 
622*cdf0e10cSrcweir     // XTypeProvider ----------------------------------------------------------
623*cdf0e10cSrcweir 
624*cdf0e10cSrcweir     DECLARE_XTYPEPROVIDER()
625*cdf0e10cSrcweir 
626*cdf0e10cSrcweir     // XServiceInfo -----------------------------------------------------------
627*cdf0e10cSrcweir 
628*cdf0e10cSrcweir     /** Returns an identifier for the implementation of this object. */
629*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName()
630*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
631*cdf0e10cSrcweir 
632*cdf0e10cSrcweir     // helpers ----------------------------------------------------------------
633*cdf0e10cSrcweir protected:
634*cdf0e10cSrcweir     /** Returns this object's current bounding box relative to the desktop. */
635*cdf0e10cSrcweir     virtual Rectangle GetBoundingBoxOnScreen() const throw( ::com::sun::star::uno::RuntimeException );
636*cdf0e10cSrcweir     /** Returns this object's current bounding box relative to the parent object. */
637*cdf0e10cSrcweir     virtual Rectangle GetBoundingBox() const throw( ::com::sun::star::uno::RuntimeException );
638*cdf0e10cSrcweir 
639*cdf0e10cSrcweir private:
640*cdf0e10cSrcweir     /** Returns this object's name. */
641*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL createAccessibleName()
642*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
643*cdf0e10cSrcweir     /** Returns this object's description. */
644*cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL createAccessibleDescription()
645*cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
646*cdf0e10cSrcweir 
647*cdf0e10cSrcweir     /** Returns the VCL grid control. Assumes a living object. */
648*cdf0e10cSrcweir     ScCsvGrid& implGetGrid() const;
649*cdf0e10cSrcweir     /** Returns the pixel position of the cell (rel. to parent), regardless of visibility. */
650*cdf0e10cSrcweir     Point implGetRealPos() const;
651*cdf0e10cSrcweir     /** Returns the width of the character count */
652*cdf0e10cSrcweir     sal_uInt32 implCalcPixelWidth(sal_uInt32 nChars) const;
653*cdf0e10cSrcweir     /** Returns the pixel size of the cell, regardless of visibility. */
654*cdf0e10cSrcweir     Size implGetRealSize() const;
655*cdf0e10cSrcweir     /** Returns the bounding box of the cell relative in the table. */
656*cdf0e10cSrcweir     Rectangle implGetBoundingBox() const;
657*cdf0e10cSrcweir 
658*cdf0e10cSrcweir     /** Creates the edit source the text helper needs. */
659*cdf0e10cSrcweir     ::std::auto_ptr< SvxEditSource > implCreateEditSource();
660*cdf0e10cSrcweir };
661*cdf0e10cSrcweir 
662*cdf0e10cSrcweir 
663*cdf0e10cSrcweir // ============================================================================
664*cdf0e10cSrcweir 
665*cdf0e10cSrcweir #endif
666*cdf0e10cSrcweir 
667