Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLECELL_HXX
29 : : #define ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLECELL_HXX
30 : :
31 : : #include <comphelper/accessibletexthelper.hxx>
32 : : #include <cppuhelper/implbase2.hxx>
33 : : #include "accessibility/extended/AccessibleGridControlBase.hxx"
34 : : #include <svtools/accessibletable.hxx>
35 : :
36 : : namespace accessibility
37 : : {
38 : : class AccessibleGridControlCell : public AccessibleGridControlBase
39 : : {
40 : : private:
41 : : sal_Int32 m_nRowPos; // the row number of the table cell
42 : : sal_Int32 m_nColPos; // the column id of the table cell
43 : :
44 : : protected:
45 : : // attribute access
46 : 0 : inline sal_Int32 getRowPos( ) const { return m_nRowPos; }
47 : 0 : inline sal_Int32 getColumnPos( ) const { return m_nColPos; }
48 : :
49 : : // XAccessibleComponent
50 : : virtual void SAL_CALL grabFocus() throw ( ::com::sun::star::uno::RuntimeException );
51 : :
52 : : protected:
53 : : AccessibleGridControlCell(
54 : : const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
55 : : ::svt::table::IAccessibleTable& _rTable,
56 : : sal_Int32 _nRowPos,
57 : : sal_uInt16 _nColPos,
58 : : ::svt::table::AccessibleTableControlObjType _eType
59 : : );
60 : :
61 : : virtual ~AccessibleGridControlCell();
62 : :
63 : : private:
64 : : AccessibleGridControlCell(); // never implemented
65 : : AccessibleGridControlCell( const AccessibleGridControlCell& ); // never implemented
66 : : AccessibleGridControlCell& operator=( const AccessibleGridControlCell& ); // never implemented
67 : : };
68 : :
69 : : typedef ::cppu::ImplHelper2 < ::com::sun::star::accessibility::XAccessibleText
70 : : , ::com::sun::star::accessibility::XAccessible
71 : : > AccessibleTextHelper_BASE;
72 : : // implementation of a table cell of GridControl
73 [ # # ][ # # ]: 0 : class AccessibleGridControlTableCell :public AccessibleGridControlCell
74 : : ,public AccessibleTextHelper_BASE
75 : : ,public ::comphelper::OCommonAccessibleText
76 : : {
77 : : private:
78 : : sal_Int32 m_nOffset;
79 : :
80 : : protected:
81 : : // OCommonAccessibleText
82 : : virtual ::rtl::OUString implGetText();
83 : : virtual ::com::sun::star::lang::Locale implGetLocale();
84 : : virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex );
85 : : virtual Rectangle implGetBoundingBox();
86 : : virtual Rectangle implGetBoundingBoxOnScreen();
87 : :
88 : : public:
89 : : AccessibleGridControlTableCell( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
90 : : ::svt::table::IAccessibleTable& _rTable,
91 : : sal_Int32 _nRowId,
92 : : sal_uInt16 _nColId,
93 : : svt::table::AccessibleTableControlObjType eObjType);
94 : :
95 : : // XInterface -------------------------------------------------------------
96 : :
97 : : /** Queries for a new interface. */
98 : : ::com::sun::star::uno::Any SAL_CALL queryInterface(
99 : : const ::com::sun::star::uno::Type& rType )
100 : : throw ( ::com::sun::star::uno::RuntimeException );
101 : :
102 : : /** Aquires the object (calls acquire() on base class). */
103 : : virtual void SAL_CALL acquire() throw ();
104 : :
105 : : /** Releases the object (calls release() on base class). */
106 : : virtual void SAL_CALL release() throw ();
107 : :
108 : : /** @return The index of this object among the parent's children. */
109 : : virtual sal_Int32 SAL_CALL getAccessibleIndexInParent()
110 : : throw ( ::com::sun::star::uno::RuntimeException );
111 : :
112 : : /** @return
113 : : The name of this class.
114 : : */
115 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
116 : : throw ( ::com::sun::star::uno::RuntimeException );
117 : :
118 : : /** @return
119 : : The count of visible children.
120 : : */
121 : : virtual sal_Int32 SAL_CALL getAccessibleChildCount()
122 : : throw ( ::com::sun::star::uno::RuntimeException );
123 : :
124 : : /** @return
125 : : The XAccessible interface of the specified child.
126 : : */
127 : : virtual ::com::sun::star::uno::Reference<
128 : : ::com::sun::star::accessibility::XAccessible > SAL_CALL
129 : : getAccessibleChild( sal_Int32 nChildIndex )
130 : : throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
131 : : ::com::sun::star::uno::RuntimeException );
132 : :
133 : : /** Creates a new AccessibleStateSetHelper and fills it with states of the
134 : : current object.
135 : : @return
136 : : A filled AccessibleStateSetHelper.
137 : : */
138 : : ::utl::AccessibleStateSetHelper* implCreateStateSetHelper();
139 : :
140 : : // XAccessible ------------------------------------------------------------
141 : :
142 : : /** @return The XAccessibleContext interface of this object. */
143 : : virtual ::com::sun::star::uno::Reference<
144 : : ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL
145 : : getAccessibleContext()
146 : : throw ( ::com::sun::star::uno::RuntimeException );
147 : :
148 : : // XAccessibleText
149 : : virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException);
150 : : virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
151 : : virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
152 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
153 : : virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
154 : : virtual sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException);
155 : : virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
156 : : virtual ::rtl::OUString SAL_CALL getSelectedText() throw (::com::sun::star::uno::RuntimeException);
157 : : virtual sal_Int32 SAL_CALL getSelectionStart() throw (::com::sun::star::uno::RuntimeException);
158 : : virtual sal_Int32 SAL_CALL getSelectionEnd() throw (::com::sun::star::uno::RuntimeException);
159 : : virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
160 : : virtual ::rtl::OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException);
161 : : virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
162 : : 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);
163 : : 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);
164 : : 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);
165 : : virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
166 : : };
167 : : }
168 : : #endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLECELL_HXX
169 : :
170 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|