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