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 COMPHELPER_ACCESSIBLE_KEYBINDING_HELPER_HXX 25 #define COMPHELPER_ACCESSIBLE_KEYBINDING_HELPER_HXX 26 27 #include <com/sun/star/accessibility/XAccessibleKeyBinding.hpp> 28 #include <cppuhelper/implbase1.hxx> 29 #include <osl/mutex.hxx> 30 31 #ifndef INCLUDED_VECTOR 32 #include <vector> 33 #define INCLUDED_VECTOR 34 #endif 35 #include "comphelper/comphelperdllapi.h" 36 37 //.............................................................................. 38 namespace comphelper 39 { 40 //.............................................................................. 41 42 //============================================================================== 43 // OAccessibleKeyBindingHelper 44 //============================================================================== 45 46 typedef ::cppu::WeakImplHelper1 < ::com::sun::star::accessibility::XAccessibleKeyBinding 47 > OAccessibleKeyBindingHelper_Base; 48 49 /** a helper class for implementing an accessible keybinding 50 */ 51 class COMPHELPER_DLLPUBLIC OAccessibleKeyBindingHelper : public OAccessibleKeyBindingHelper_Base 52 { 53 private: 54 typedef ::std::vector< ::com::sun::star::uno::Sequence< ::com::sun::star::awt::KeyStroke > > KeyBindings; 55 56 KeyBindings m_aKeyBindings; 57 58 protected: 59 ::osl::Mutex m_aMutex; 60 61 virtual ~OAccessibleKeyBindingHelper(); 62 63 public: 64 OAccessibleKeyBindingHelper(); 65 OAccessibleKeyBindingHelper( const OAccessibleKeyBindingHelper& rHelper ); 66 67 void AddKeyBinding( const ::com::sun::star::uno::Sequence< ::com::sun::star::awt::KeyStroke >& rKeyBinding ) throw (::com::sun::star::uno::RuntimeException); 68 void AddKeyBinding( const ::com::sun::star::awt::KeyStroke& rKeyStroke ) throw (::com::sun::star::uno::RuntimeException); 69 70 // XAccessibleKeyBinding 71 virtual sal_Int32 SAL_CALL getAccessibleKeyBindingCount() throw (::com::sun::star::uno::RuntimeException); 72 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::awt::KeyStroke > SAL_CALL getAccessibleKeyBinding( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 73 }; 74 75 //.............................................................................. 76 } // namespace comphelper 77 //.............................................................................. 78 79 #endif // COMPHELPER_ACCESSIBLE_KEYBINDING_HELPER_HXX 80