Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLECELL_HXX
20 : #define ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLECELL_HXX
21 :
22 : #include <comphelper/accessibletexthelper.hxx>
23 : #include <cppuhelper/implbase2.hxx>
24 : #include "accessibility/extended/AccessibleGridControlBase.hxx"
25 : #include <svtools/accessibletable.hxx>
26 :
27 : namespace accessibility
28 : {
29 : class AccessibleGridControlCell : public AccessibleGridControlBase
30 : {
31 : private:
32 : sal_Int32 m_nRowPos; // the row number of the table cell
33 : sal_Int32 m_nColPos; // the column id of the table cell
34 :
35 : protected:
36 : // attribute access
37 0 : inline sal_Int32 getRowPos( ) const { return m_nRowPos; }
38 0 : inline sal_Int32 getColumnPos( ) const { return m_nColPos; }
39 :
40 : // XAccessibleComponent
41 : virtual void SAL_CALL grabFocus() throw ( ::com::sun::star::uno::RuntimeException );
42 :
43 : protected:
44 : AccessibleGridControlCell(
45 : const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
46 : ::svt::table::IAccessibleTable& _rTable,
47 : sal_Int32 _nRowPos,
48 : sal_uInt16 _nColPos,
49 : ::svt::table::AccessibleTableControlObjType _eType
50 : );
51 :
52 : virtual ~AccessibleGridControlCell();
53 :
54 : private:
55 : AccessibleGridControlCell(); // never implemented
56 : AccessibleGridControlCell( const AccessibleGridControlCell& ); // never implemented
57 : AccessibleGridControlCell& operator=( const AccessibleGridControlCell& ); // never implemented
58 : };
59 :
60 : typedef ::cppu::ImplHelper2 < ::com::sun::star::accessibility::XAccessibleText
61 : , ::com::sun::star::accessibility::XAccessible
62 : > AccessibleTextHelper_BASE;
63 : // implementation of a table cell of GridControl
64 0 : class AccessibleGridControlTableCell :public AccessibleGridControlCell
65 : ,public AccessibleTextHelper_BASE
66 : ,public ::comphelper::OCommonAccessibleText
67 : {
68 : protected:
69 : // OCommonAccessibleText
70 : virtual OUString implGetText();
71 : virtual ::com::sun::star::lang::Locale implGetLocale();
72 : virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex );
73 : virtual Rectangle implGetBoundingBox();
74 : virtual Rectangle implGetBoundingBoxOnScreen();
75 :
76 : public:
77 : AccessibleGridControlTableCell( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
78 : ::svt::table::IAccessibleTable& _rTable,
79 : sal_Int32 _nRowId,
80 : sal_uInt16 _nColId,
81 : svt::table::AccessibleTableControlObjType eObjType);
82 :
83 : // XInterface -------------------------------------------------------------
84 :
85 : /** Queries for a new interface. */
86 : ::com::sun::star::uno::Any SAL_CALL queryInterface(
87 : const ::com::sun::star::uno::Type& rType )
88 : throw ( ::com::sun::star::uno::RuntimeException );
89 :
90 : /** Aquires the object (calls acquire() on base class). */
91 : virtual void SAL_CALL acquire() throw ();
92 :
93 : /** Releases the object (calls release() on base class). */
94 : virtual void SAL_CALL release() throw ();
95 :
96 : /** @return The index of this object among the parent's children. */
97 : virtual sal_Int32 SAL_CALL getAccessibleIndexInParent()
98 : throw ( ::com::sun::star::uno::RuntimeException );
99 :
100 : /** @return
101 : The name of this class.
102 : */
103 : virtual OUString SAL_CALL getImplementationName()
104 : throw ( ::com::sun::star::uno::RuntimeException );
105 :
106 : /** @return
107 : The count of visible children.
108 : */
109 : virtual sal_Int32 SAL_CALL getAccessibleChildCount()
110 : throw ( ::com::sun::star::uno::RuntimeException );
111 :
112 : /** @return
113 : The XAccessible interface of the specified child.
114 : */
115 : virtual ::com::sun::star::uno::Reference<
116 : ::com::sun::star::accessibility::XAccessible > SAL_CALL
117 : getAccessibleChild( sal_Int32 nChildIndex )
118 : throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
119 : ::com::sun::star::uno::RuntimeException );
120 :
121 : /** Creates a new AccessibleStateSetHelper and fills it with states of the
122 : current object.
123 : @return
124 : A filled AccessibleStateSetHelper.
125 : */
126 : ::utl::AccessibleStateSetHelper* implCreateStateSetHelper();
127 :
128 : // XAccessible ------------------------------------------------------------
129 :
130 : /** @return The XAccessibleContext interface of this object. */
131 : virtual ::com::sun::star::uno::Reference<
132 : ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL
133 : getAccessibleContext()
134 : throw ( ::com::sun::star::uno::RuntimeException );
135 :
136 : // XAccessibleText
137 : virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException);
138 : virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
139 : virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
140 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
141 : virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
142 : virtual sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException);
143 : virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
144 : virtual OUString SAL_CALL getSelectedText() throw (::com::sun::star::uno::RuntimeException);
145 : virtual sal_Int32 SAL_CALL getSelectionStart() throw (::com::sun::star::uno::RuntimeException);
146 : virtual sal_Int32 SAL_CALL getSelectionEnd() throw (::com::sun::star::uno::RuntimeException);
147 : virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
148 : virtual OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException);
149 : virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
150 : 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);
151 : 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);
152 : 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);
153 : virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
154 : };
155 : }
156 : #endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLECELL_HXX
157 :
158 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|