1*2e2212a7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2e2212a7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2e2212a7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2e2212a7SAndrew Rist  * distributed with this work for additional information
6*2e2212a7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2e2212a7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2e2212a7SAndrew Rist  * "License"); you may not use this file except in compliance
9*2e2212a7SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*2e2212a7SAndrew Rist  *
11*2e2212a7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*2e2212a7SAndrew Rist  *
13*2e2212a7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2e2212a7SAndrew Rist  * software distributed under the License is distributed on an
15*2e2212a7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2e2212a7SAndrew Rist  * KIND, either express or implied.  See the License for the
17*2e2212a7SAndrew Rist  * specific language governing permissions and limitations
18*2e2212a7SAndrew Rist  * under the License.
19*2e2212a7SAndrew Rist  *
20*2e2212a7SAndrew Rist  *************************************************************/
21*2e2212a7SAndrew Rist 
22*2e2212a7SAndrew Rist 
23cdf0e10cSrcweir #ifndef DBACCESS_TABLEWINDOWACCESS_HXX
24cdf0e10cSrcweir #define DBACCESS_TABLEWINDOWACCESS_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLERELATIONSET_HPP_
27cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir #ifndef _CPPUHELPER_IMPLBASE2_HXX_
30cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #ifndef _TOOLKIT_AWT_VCLXACCESSIBLECOMPONENT_HXX_
33cdf0e10cSrcweir #include <toolkit/awt/vclxaccessiblecomponent.hxx>
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir 
36cdf0e10cSrcweir namespace dbaui
37cdf0e10cSrcweir {
38cdf0e10cSrcweir 	typedef ::cppu::ImplHelper2< ::com::sun::star::accessibility::XAccessibleRelationSet,
39cdf0e10cSrcweir  								 ::com::sun::star::accessibility::XAccessible
40cdf0e10cSrcweir 											> OTableWindowAccess_BASE;
41cdf0e10cSrcweir 	class OTableWindow;
42cdf0e10cSrcweir 	/** the class OTableWindowAccess represents the accessible object for table windows
43cdf0e10cSrcweir 		like they are used in the QueryDesign and the RelationDesign
44cdf0e10cSrcweir 	*/
45cdf0e10cSrcweir 	class OTableWindowAccess	:	public VCLXAccessibleComponent
46cdf0e10cSrcweir 								,	public OTableWindowAccess_BASE
47cdf0e10cSrcweir 	{
48cdf0e10cSrcweir 		OTableWindow*	m_pTable; // the window which I should give accessibility to
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > getParentChild(sal_Int32 _nIndex);
51cdf0e10cSrcweir 	protected:
52cdf0e10cSrcweir 		/** this function is called upon disposing the component
53cdf0e10cSrcweir 		*/
54cdf0e10cSrcweir 		virtual void SAL_CALL disposing();
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 		/** isEditable returns the current editable state
57cdf0e10cSrcweir 			@return	true if it is editable otherwise false
58cdf0e10cSrcweir 		*/
59cdf0e10cSrcweir 		virtual sal_Bool isEditable() const;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir         virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
62cdf0e10cSrcweir 	public:
63cdf0e10cSrcweir 		OTableWindowAccess(	OTableWindow* _pTable);
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 		// XInterface
66cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
acquire()67cdf0e10cSrcweir 		virtual void SAL_CALL acquire(  ) throw ()
68cdf0e10cSrcweir 		{ // here inline is allowed because we do not use this class outside this dll
69cdf0e10cSrcweir 			VCLXAccessibleComponent::acquire(  );
70cdf0e10cSrcweir 		}
release()71cdf0e10cSrcweir 		virtual void SAL_CALL release(  ) throw ()
72cdf0e10cSrcweir 		{ // here inline is allowed because we do not use this class outside this dll
73cdf0e10cSrcweir 			VCLXAccessibleComponent::release(  );
74cdf0e10cSrcweir 		}
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 		// XTypeProvider
77cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException);
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 		// XServiceInfo
80cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw(com::sun::star::uno::RuntimeException);
81cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(com::sun::star::uno::RuntimeException);
82cdf0e10cSrcweir 
83cdf0e10cSrcweir 		// XServiceInfo - static methods
84cdf0e10cSrcweir 		static com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( com::sun::star::uno::RuntimeException );
85cdf0e10cSrcweir 		static ::rtl::OUString getImplementationName_Static(void) throw( com::sun::star::uno::RuntimeException );
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 		// XAccessible
88cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException);
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 		// XAccessibleContext
91cdf0e10cSrcweir 		virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
92cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException,::com::sun::star::uno::RuntimeException);
93cdf0e10cSrcweir 		virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(  ) throw (::com::sun::star::uno::RuntimeException);
94cdf0e10cSrcweir 		virtual sal_Int16 SAL_CALL getAccessibleRole(  ) throw (::com::sun::star::uno::RuntimeException);
95cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getAccessibleName(  ) throw (::com::sun::star::uno::RuntimeException);
96cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) throw (::com::sun::star::uno::RuntimeException);
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 		// XAccessibleComponent
99cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 		// XAccessibleExtendedComponent
102cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getTitledBorderText(  ) throw (::com::sun::star::uno::RuntimeException);
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 		// XAccessibleRelationSet
105cdf0e10cSrcweir 		virtual sal_Int32 SAL_CALL getRelationCount(  ) throw (::com::sun::star::uno::RuntimeException);
106cdf0e10cSrcweir 		virtual ::com::sun::star::accessibility::AccessibleRelation SAL_CALL getRelation( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
107cdf0e10cSrcweir 		virtual sal_Bool SAL_CALL containsRelation( sal_Int16 aRelationType ) throw (::com::sun::star::uno::RuntimeException);
108cdf0e10cSrcweir 		virtual ::com::sun::star::accessibility::AccessibleRelation SAL_CALL getRelationByType( sal_Int16 aRelationType ) throw (::com::sun::star::uno::RuntimeException);
109cdf0e10cSrcweir 
notifyAccessibleEvent(const sal_Int16 _nEventId,const::com::sun::star::uno::Any & _rOldValue,const::com::sun::star::uno::Any & _rNewValue)110cdf0e10cSrcweir 		void notifyAccessibleEvent(
111cdf0e10cSrcweir 					const sal_Int16 _nEventId,
112cdf0e10cSrcweir 					const ::com::sun::star::uno::Any& _rOldValue,
113cdf0e10cSrcweir 					const ::com::sun::star::uno::Any& _rNewValue
114cdf0e10cSrcweir 				)
115cdf0e10cSrcweir 		{
116cdf0e10cSrcweir 			NotifyAccessibleEvent(_nEventId,_rOldValue,_rNewValue);
117cdf0e10cSrcweir 		}
118cdf0e10cSrcweir 	};
119cdf0e10cSrcweir }
120cdf0e10cSrcweir #endif // DBACCESS_TABLEWINDOWACCESS_HXX
121