Drop some needless mappings to identical strings
[LibreOffice.git] / vcl / inc / accessibility / vclxaccessibletoolbox.hxx
blobda0090ef5f7cb18a74d200d45061ee9312660f8f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #pragma once
21 #include <map>
22 #include <vcl/accessibility/vclxaccessiblecomponent.hxx>
23 #include <vcl/toolbox.hxx>
24 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
25 #include <cppuhelper/implbase.hxx>
28 class VCLXAccessibleToolBoxItem;
29 class ToolBox;
31 typedef std::map< sal_Int32, rtl::Reference< VCLXAccessibleToolBoxItem > > ToolBoxItemsMap;
33 class VCLXAccessibleToolBox final : public cppu::ImplInheritanceHelper<VCLXAccessibleComponent, css::accessibility::XAccessibleSelection>
35 private:
36 ToolBoxItemsMap m_aAccessibleChildren;
38 VCLXAccessibleToolBoxItem* GetItem_Impl( ToolBox::ImplToolItems::size_type _nPos );
40 void UpdateFocus_Impl();
41 void ReleaseFocus_Impl( ToolBox::ImplToolItems::size_type _nPos );
42 void UpdateChecked_Impl( ToolBox::ImplToolItems::size_type _nPos );
43 void UpdateIndeterminate_Impl( ToolBox::ImplToolItems::size_type _nPos );
44 void UpdateItem_Impl( ToolBox::ImplToolItems::size_type _nPos );
45 void UpdateAllItems_Impl();
46 void UpdateItemName_Impl( ToolBox::ImplToolItems::size_type _nPos );
47 void UpdateItemEnabled_Impl( ToolBox::ImplToolItems::size_type _nPos );
48 void UpdateCustomPopupItemp_Impl( vcl::Window* pWindow, bool bOpen );
49 void HandleSubToolBarEvent( const VclWindowEvent& rVclWindowEvent );
50 void ReleaseSubToolBox( ToolBox* _pSubToolBox );
51 sal_Int64 implGetAccessibleChildCount();
53 virtual ~VCLXAccessibleToolBox() override;
55 virtual void FillAccessibleStateSet( sal_Int64& rStateSet ) override;
56 virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
57 virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent ) override;
59 virtual css::uno::Reference< css::accessibility::XAccessible > GetChildAccessible( const VclWindowEvent& rVclWindowEvent ) override;
60 css::uno::Reference< css::accessibility::XAccessible > GetItemWindowAccessible( const VclWindowEvent& rVclWindowEvent );
62 // XComponent
63 virtual void SAL_CALL disposing() override;
65 public:
66 VCLXAccessibleToolBox(ToolBox* pToolBox);
68 // XServiceInfo
69 virtual OUString SAL_CALL getImplementationName() override;
70 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
72 // XAccessibleContext
73 virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
74 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
75 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
77 // XAccessibleSelection
78 virtual void SAL_CALL selectAccessibleChild( sal_Int64 nChildIndex ) override;
79 virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int64 nChildIndex ) override;
80 virtual void SAL_CALL clearAccessibleSelection( ) override;
81 virtual void SAL_CALL selectAllAccessibleChildren( ) override;
82 virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount( ) override;
83 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override;
84 virtual void SAL_CALL deselectAccessibleChild( sal_Int64 nChildIndex ) override;
86 private:
87 void implReleaseToolboxItem(
88 ToolBoxItemsMap::iterator const & _rMapPos,
89 bool _bNotifyRemoval
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */