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 28 #ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABCONTROL_HXX 29 #define ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABCONTROL_HXX 30 31 #include <toolkit/awt/vclxaccessiblecomponent.hxx> 32 #include <com/sun/star/accessibility/XAccessibleSelection.hpp> 33 34 #include <vector> 35 36 class TabControl; 37 38 39 // ---------------------------------------------------- 40 // class VCLXAccessibleTabControl 41 // ---------------------------------------------------- 42 43 typedef ::cppu::ImplHelper1 < 44 ::com::sun::star::accessibility::XAccessibleSelection > VCLXAccessibleTabControl_BASE; 45 46 class VCLXAccessibleTabControl : public VCLXAccessibleComponent, 47 public VCLXAccessibleTabControl_BASE 48 { 49 private: 50 typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > AccessibleChildren; 51 52 AccessibleChildren m_aAccessibleChildren; 53 TabControl* m_pTabControl; 54 55 protected: 56 void UpdateFocused(); 57 void UpdateSelected( sal_Int32 i, bool bSelected ); 58 void UpdatePageText( sal_Int32 i ); 59 void UpdateTabPage( sal_Int32 i, bool bNew ); 60 61 void InsertChild( sal_Int32 i ); 62 void RemoveChild( sal_Int32 i ); 63 64 virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); 65 virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent ); 66 virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); 67 68 // XComponent 69 virtual void SAL_CALL disposing(); 70 71 public: 72 VCLXAccessibleTabControl( VCLXWindow* pVCLXWindow ); 73 ~VCLXAccessibleTabControl(); 74 75 // XInterface 76 DECLARE_XINTERFACE() 77 78 // XTypeProvider 79 DECLARE_XTYPEPROVIDER() 80 81 // XServiceInfo 82 virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); 83 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); 84 85 // XAccessibleContext 86 virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); 87 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); 88 virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); 89 virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); 90 91 // XAccessibleSelection 92 virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 93 virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 94 virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException); 95 virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException); 96 virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); 97 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 98 virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 99 }; 100 101 102 #endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABCONTROL_HXX 103 104