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_VCLXACCESSIBLETEXTFIELD_HXX 29 #define ACCESSIBILITY_STANDARD_VCLXACCESSIBLETEXTFIELD_HXX 30 31 #include <accessibility/standard/vclxaccessibletextcomponent.hxx> 32 33 #ifndef _CPPUHELPER_IMPLBASE1_HXX 34 #include <cppuhelper/implbase1.hxx> 35 #endif 36 37 typedef ::cppu::ImplHelper1< 38 ::com::sun::star::accessibility::XAccessible 39 > VCLXAccessible_BASE; 40 41 42 /** This class represents non editable text fields. The object passed to 43 the constructor is expected to be a list (a <type>ListBox</type> to be 44 more specific). From this allways the selected item is token to be made 45 accessible by this class. When the selected item changes then also the 46 exported text changes. 47 */ 48 class VCLXAccessibleTextField : 49 public VCLXAccessibleTextComponent, 50 public VCLXAccessible_BASE 51 { 52 public: 53 VCLXAccessibleTextField (VCLXWindow* pVCLXindow, 54 const ::com::sun::star::uno::Reference< 55 ::com::sun::star::accessibility::XAccessible >& _xParent); 56 57 // XInterface 58 DECLARE_XINTERFACE() 59 60 // XTypeProvider 61 DECLARE_XTYPEPROVIDER() 62 63 // XAccessible 64 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL 65 getAccessibleContext (void) 66 throw (::com::sun::star::uno::RuntimeException); 67 68 // XAccessibleContext 69 sal_Int32 SAL_CALL getAccessibleChildCount (void) 70 throw (::com::sun::star::uno::RuntimeException); 71 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL 72 getAccessibleChild (sal_Int32 i) 73 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 74 sal_Int16 SAL_CALL getAccessibleRole (void) 75 throw (::com::sun::star::uno::RuntimeException); 76 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL 77 getAccessibleParent( ) 78 throw (::com::sun::star::uno::RuntimeException); 79 80 // XServiceInfo 81 virtual ::rtl::OUString SAL_CALL getImplementationName (void) 82 throw (::com::sun::star::uno::RuntimeException); 83 // Return text field specific services. 84 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 85 getSupportedServiceNames (void) 86 throw (::com::sun::star::uno::RuntimeException); 87 88 protected: 89 virtual ~VCLXAccessibleTextField (void); 90 91 /** With this method the text of the currently selected item is made 92 available to the <type>VCLXAccessibleTextComponent</type> base class. 93 */ 94 ::rtl::OUString implGetText (void); 95 96 private: 97 /** We need to save the accessible parent to return it in <type>getAccessibleParent()</type>, 98 because this method of the base class returns the wrong parent. 99 */ 100 ::com::sun::star::uno::Reference< 101 ::com::sun::star::accessibility::XAccessible > m_xParent; 102 }; 103 104 #endif 105 106