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