1*a462bbb7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*a462bbb7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*a462bbb7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*a462bbb7SAndrew Rist  * distributed with this work for additional information
6*a462bbb7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*a462bbb7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*a462bbb7SAndrew Rist  * "License"); you may not use this file except in compliance
9*a462bbb7SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*a462bbb7SAndrew Rist  *
11*a462bbb7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*a462bbb7SAndrew Rist  *
13*a462bbb7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*a462bbb7SAndrew Rist  * software distributed under the License is distributed on an
15*a462bbb7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*a462bbb7SAndrew Rist  * KIND, either express or implied.  See the License for the
17*a462bbb7SAndrew Rist  * specific language governing permissions and limitations
18*a462bbb7SAndrew Rist  * under the License.
19*a462bbb7SAndrew Rist  *
20*a462bbb7SAndrew Rist  *************************************************************/
21*a462bbb7SAndrew Rist 
22*a462bbb7SAndrew Rist 
23cdf0e10cSrcweir #ifndef ACCESSIBILITY_EXT_ACCESSIBILEBROWSEBOXTABLECELL_HXX
24cdf0e10cSrcweir #define ACCESSIBILITY_EXT_ACCESSIBILEBROWSEBOXTABLECELL_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "accessibility/extended/accessiblebrowseboxcell.hxx"
27cdf0e10cSrcweir #include <comphelper/accessibletexthelper.hxx>
28cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir namespace accessibility
31cdf0e10cSrcweir {
32cdf0e10cSrcweir 	typedef ::cppu::ImplHelper2	<	::com::sun::star::accessibility::XAccessibleText
33cdf0e10cSrcweir 								,	::com::sun::star::accessibility::XAccessible
34cdf0e10cSrcweir 								>	AccessibleTextHelper_BASE;
35cdf0e10cSrcweir 
36cdf0e10cSrcweir 	// implementation of a table cell of BrowseBox
37cdf0e10cSrcweir 	class AccessibleBrowseBoxTableCell	:public AccessibleBrowseBoxCell
38cdf0e10cSrcweir 										,public AccessibleTextHelper_BASE
39cdf0e10cSrcweir 										,public ::comphelper::OCommonAccessibleText
40cdf0e10cSrcweir 	{
41cdf0e10cSrcweir     private:
42cdf0e10cSrcweir         sal_Int32   m_nOffset;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir 	protected:
45cdf0e10cSrcweir 		// OCommonAccessibleText
46cdf0e10cSrcweir 		virtual ::rtl::OUString					implGetText();
47cdf0e10cSrcweir 		virtual ::com::sun::star::lang::Locale	implGetLocale();
48cdf0e10cSrcweir 		virtual void							implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex );
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 	public:
51cdf0e10cSrcweir         AccessibleBrowseBoxTableCell( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
52cdf0e10cSrcweir 									::svt::IAccessibleTableProvider& _rBrowseBox,
53cdf0e10cSrcweir 									const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
54cdf0e10cSrcweir 									sal_Int32 _nRowId,
55cdf0e10cSrcweir                                     sal_uInt16 _nColId,
56cdf0e10cSrcweir                                     sal_Int32 _nOffset );
57cdf0e10cSrcweir 
58cdf0e10cSrcweir         void    nameChanged( const ::rtl::OUString& rNewName, const ::rtl::OUString& rOldName );
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 		// XInterface -------------------------------------------------------------
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 		/** Queries for a new interface. */
63cdf0e10cSrcweir 		::com::sun::star::uno::Any SAL_CALL queryInterface(
64cdf0e10cSrcweir 				const ::com::sun::star::uno::Type& rType )
65cdf0e10cSrcweir 			throw ( ::com::sun::star::uno::RuntimeException );
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 		/** Aquires the object (calls acquire() on base class). */
68cdf0e10cSrcweir 		virtual void SAL_CALL acquire() throw ();
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 		/** Releases the object (calls release() on base class). */
71cdf0e10cSrcweir 		virtual void SAL_CALL release() throw ();
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 		// XEventListener
74cdf0e10cSrcweir         using AccessibleBrowseBoxBase::disposing;
75cdf0e10cSrcweir 	    virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
76cdf0e10cSrcweir 			throw(::com::sun::star::uno::RuntimeException);
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 		/** @return  The index of this object among the parent's children. */
79cdf0e10cSrcweir 		virtual sal_Int32 SAL_CALL getAccessibleIndexInParent()
80cdf0e10cSrcweir 			throw ( ::com::sun::star::uno::RuntimeException );
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 		/** @return
83cdf0e10cSrcweir 				The name of this class.
84cdf0e10cSrcweir 		*/
85cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getImplementationName()
86cdf0e10cSrcweir 			throw ( ::com::sun::star::uno::RuntimeException );
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 		/** @return
89cdf0e10cSrcweir 				The count of visible children.
90cdf0e10cSrcweir 		*/
91cdf0e10cSrcweir 		virtual sal_Int32 SAL_CALL getAccessibleChildCount()
92cdf0e10cSrcweir 			throw ( ::com::sun::star::uno::RuntimeException );
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 		/** @return
95cdf0e10cSrcweir 				The XAccessible interface of the specified child.
96cdf0e10cSrcweir 		*/
97cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference<
98cdf0e10cSrcweir 			::com::sun::star::accessibility::XAccessible > SAL_CALL
99cdf0e10cSrcweir 			getAccessibleChild( sal_Int32 nChildIndex )
100cdf0e10cSrcweir 				throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
101cdf0e10cSrcweir 						::com::sun::star::uno::RuntimeException );
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 		/** Creates a new AccessibleStateSetHelper and fills it with states of the
104cdf0e10cSrcweir 			current object.
105cdf0e10cSrcweir 			@return
106cdf0e10cSrcweir 				A filled AccessibleStateSetHelper.
107cdf0e10cSrcweir 		*/
108cdf0e10cSrcweir 		::utl::AccessibleStateSetHelper* implCreateStateSetHelper();
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 		// XAccessible ------------------------------------------------------------
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 		/** @return  The XAccessibleContext interface of this object. */
113cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference<
114cdf0e10cSrcweir 			::com::sun::star::accessibility::XAccessibleContext > SAL_CALL
115cdf0e10cSrcweir 		getAccessibleContext()
116cdf0e10cSrcweir 			throw ( ::com::sun::star::uno::RuntimeException );
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 		// XAccessibleText
119cdf0e10cSrcweir 		virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException);
120cdf0e10cSrcweir 		virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
121cdf0e10cSrcweir 		virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
122cdf0e10cSrcweir 		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);
123cdf0e10cSrcweir 		virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
124cdf0e10cSrcweir 		virtual sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException);
125cdf0e10cSrcweir 		virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
126cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getSelectedText() throw (::com::sun::star::uno::RuntimeException);
127cdf0e10cSrcweir 		virtual sal_Int32 SAL_CALL getSelectionStart() throw (::com::sun::star::uno::RuntimeException);
128cdf0e10cSrcweir 		virtual sal_Int32 SAL_CALL getSelectionEnd() throw (::com::sun::star::uno::RuntimeException);
129cdf0e10cSrcweir 		virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
130cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException);
131cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
132cdf0e10cSrcweir         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);
133cdf0e10cSrcweir         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);
134cdf0e10cSrcweir         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);
135cdf0e10cSrcweir 		virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
136cdf0e10cSrcweir 	};
137cdf0e10cSrcweir }
138cdf0e10cSrcweir #endif // ACCESSIBILITY_EXT_ACCESSIBILEBROWSEBOXTABLECELL_HXX
139cdf0e10cSrcweir 
140