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 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_accessibility.hxx" 26 #include <accessibility/standard/vclxaccessiblelistbox.hxx> 27 #include <accessibility/standard/vclxaccessiblelistitem.hxx> 28 #include <accessibility/helper/listboxhelper.hxx> 29 30 #include <algorithm> 31 32 #include <com/sun/star/accessibility/AccessibleEventId.hpp> 33 #include <com/sun/star/accessibility/AccessibleRole.hpp> 34 #include <com/sun/star/accessibility/AccessibleStateType.hpp> 35 #include <tools/debug.hxx> 36 #include <vcl/svapp.hxx> 37 #include <vcl/lstbox.hxx> 38 #include <vcl/unohelp.hxx> 39 40 #include <toolkit/awt/vclxwindow.hxx> 41 #include <toolkit/helper/convert.hxx> 42 43 #include <comphelper/sequence.hxx> 44 #include <cppuhelper/typeprovider.hxx> 45 #include <unotools/accessiblestatesethelper.hxx> 46 47 using namespace ::com::sun::star; 48 using namespace ::com::sun::star::lang; 49 using namespace ::com::sun::star::uno; 50 using namespace ::com::sun::star::accessibility; 51 52 VCLXAccessibleListBox::VCLXAccessibleListBox (VCLXWindow* pVCLWindow) 53 : VCLXAccessibleBox (pVCLWindow, VCLXAccessibleBox::LISTBOX, false) 54 { 55 } 56 57 58 59 60 VCLXAccessibleListBox::~VCLXAccessibleListBox (void) 61 { 62 } 63 64 65 66 67 bool VCLXAccessibleListBox::IsValid (void) const 68 { 69 return static_cast<ListBox*>(GetWindow()) != NULL; 70 71 } 72 73 74 75 76 void VCLXAccessibleListBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) 77 { 78 VCLXAccessibleBox::ProcessWindowEvent( rVclWindowEvent ); 79 } 80 81 82 83 84 //===== XServiceInfo ======================================================== 85 86 ::rtl::OUString VCLXAccessibleListBox::getImplementationName (void) 87 throw (RuntimeException) 88 { 89 return ::rtl::OUString::createFromAscii("com.sun.star.comp.toolkit.AccessibleListBox"); 90 } 91 92 93 94 95 Sequence< ::rtl::OUString > VCLXAccessibleListBox::getSupportedServiceNames (void) 96 throw (RuntimeException) 97 { 98 Sequence< ::rtl::OUString > aNames = VCLXAccessibleBox::getSupportedServiceNames(); 99 sal_Int32 nLength = aNames.getLength(); 100 aNames.realloc( nLength + 1 ); 101 aNames[nLength] = ::rtl::OUString::createFromAscii( 102 "com.sun.star.accessibility.AccessibleListBox" ); 103 return aNames; 104 } 105