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