tdf#154285 Check correct number of arguments to SbRtl_Now function
[LibreOffice.git] / vcl / inc / accessibility / accessiblelistbox.hxx
blob746ef60ae00618dad9a8bbec7d1810e1747dfc08
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 .
20 #pragma once
22 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
23 #include <cppuhelper/implbase.hxx>
24 #include <vcl/accessibility/vclxaccessiblecomponent.hxx>
25 #include <vcl/vclevent.hxx>
27 #include <unordered_map>
29 // class AccessibleListBox -----------------------------------------------
31 class AccessibleListBoxEntry;
32 class SvTreeListBox;
33 class SvTreeListEntry;
35 /** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry
37 class AccessibleListBox :
38 public cppu::ImplInheritanceHelper<
39 VCLXAccessibleComponent,
40 css::accessibility::XAccessible,
41 css::accessibility::XAccessibleSelection>
44 css::uno::Reference< css::accessibility::XAccessible > m_xParent;
45 // OComponentHelper overridables
46 /** this function is called upon disposing the component */
47 virtual void SAL_CALL disposing() override;
49 protected:
50 // VCLXAccessibleComponent
51 virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
52 virtual void FillAccessibleStateSet( sal_Int64& rStateSet ) override;
54 private:
55 VclPtr< SvTreeListBox > getListBox() const;
57 void RemoveChildEntries(SvTreeListEntry*);
59 sal_Int32 GetRoleType() const;
61 public:
62 /** OAccessibleBase needs a valid view
63 @param _rListBox
64 is the box for which we implement an accessible object
65 @param _xParent
66 is our parent accessible object
68 AccessibleListBox(SvTreeListBox& _rListBox,
69 const css::uno::Reference< css::accessibility::XAccessible >& _xParent );
71 virtual ~AccessibleListBox() override;
73 rtl::Reference<AccessibleListBoxEntry> implGetAccessible(SvTreeListEntry & rEntry);
75 // XServiceInfo
76 virtual OUString SAL_CALL getImplementationName() override;
77 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
79 // XAccessible
80 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
82 // XAccessibleContext
83 virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
84 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
85 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
86 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
87 virtual OUString SAL_CALL getAccessibleDescription( ) override;
88 virtual OUString SAL_CALL getAccessibleName( ) override;
90 // XAccessibleSelection
91 void SAL_CALL selectAccessibleChild( sal_Int64 nChildIndex ) override;
92 sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int64 nChildIndex ) override;
93 void SAL_CALL clearAccessibleSelection( ) override;
94 void SAL_CALL selectAllAccessibleChildren( ) override;
95 sal_Int64 SAL_CALL getSelectedAccessibleChildCount( ) override;
96 css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override;
97 void SAL_CALL deselectAccessibleChild( sal_Int64 nSelectedChildIndex ) override;
99 private:
101 typedef std::unordered_map<SvTreeListEntry*, rtl::Reference<AccessibleListBoxEntry>> MAP_ENTRY;
102 MAP_ENTRY m_mapEntry;
104 rtl::Reference<AccessibleListBoxEntry> m_xFocusedEntry;
106 AccessibleListBoxEntry* GetCurEventEntry( const VclWindowEvent& rVclWindowEvent );
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */