1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef DBACCESS_TABLEWINDOWACCESS_HXX 28 #define DBACCESS_TABLEWINDOWACCESS_HXX 29 30 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLERELATIONSET_HPP_ 31 #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp> 32 #endif 33 #ifndef _CPPUHELPER_IMPLBASE2_HXX_ 34 #include <cppuhelper/implbase2.hxx> 35 #endif 36 #ifndef _TOOLKIT_AWT_VCLXACCESSIBLECOMPONENT_HXX_ 37 #include <toolkit/awt/vclxaccessiblecomponent.hxx> 38 #endif 39 40 namespace dbaui 41 { 42 typedef ::cppu::ImplHelper2< ::com::sun::star::accessibility::XAccessibleRelationSet, 43 ::com::sun::star::accessibility::XAccessible 44 > OTableWindowAccess_BASE; 45 class OTableWindow; 46 /** the class OTableWindowAccess represents the accessible object for table windows 47 like they are used in the QueryDesign and the RelationDesign 48 */ 49 class OTableWindowAccess : public VCLXAccessibleComponent 50 , public OTableWindowAccess_BASE 51 { 52 OTableWindow* m_pTable; // the window which I should give accessibility to 53 54 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > getParentChild(sal_Int32 _nIndex); 55 protected: 56 /** this function is called upon disposing the component 57 */ 58 virtual void SAL_CALL disposing(); 59 60 /** isEditable returns the current editable state 61 @return true if it is editable otherwise false 62 */ 63 virtual sal_Bool isEditable() const; 64 65 virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); 66 public: 67 OTableWindowAccess( OTableWindow* _pTable); 68 69 // XInterface 70 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); 71 virtual void SAL_CALL acquire( ) throw () 72 { // here inline is allowed because we do not use this class outside this dll 73 VCLXAccessibleComponent::acquire( ); 74 } 75 virtual void SAL_CALL release( ) throw () 76 { // here inline is allowed because we do not use this class outside this dll 77 VCLXAccessibleComponent::release( ); 78 } 79 80 // XTypeProvider 81 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException); 82 83 // XServiceInfo 84 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(com::sun::star::uno::RuntimeException); 85 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(com::sun::star::uno::RuntimeException); 86 87 // XServiceInfo - static methods 88 static com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( com::sun::star::uno::RuntimeException ); 89 static ::rtl::OUString getImplementationName_Static(void) throw( com::sun::star::uno::RuntimeException ); 90 91 // XAccessible 92 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException); 93 94 // XAccessibleContext 95 virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); 96 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); 97 virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException); 98 virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); 99 virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); 100 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException); 101 102 // XAccessibleComponent 103 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); 104 105 // XAccessibleExtendedComponent 106 virtual ::rtl::OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException); 107 108 // XAccessibleRelationSet 109 virtual sal_Int32 SAL_CALL getRelationCount( ) throw (::com::sun::star::uno::RuntimeException); 110 virtual ::com::sun::star::accessibility::AccessibleRelation SAL_CALL getRelation( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 111 virtual sal_Bool SAL_CALL containsRelation( sal_Int16 aRelationType ) throw (::com::sun::star::uno::RuntimeException); 112 virtual ::com::sun::star::accessibility::AccessibleRelation SAL_CALL getRelationByType( sal_Int16 aRelationType ) throw (::com::sun::star::uno::RuntimeException); 113 114 void notifyAccessibleEvent( 115 const sal_Int16 _nEventId, 116 const ::com::sun::star::uno::Any& _rOldValue, 117 const ::com::sun::star::uno::Any& _rNewValue 118 ) 119 { 120 NotifyAccessibleEvent(_nEventId,_rOldValue,_rNewValue); 121 } 122 }; 123 } 124 #endif // DBACCESS_TABLEWINDOWACCESS_HXX 125