tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / basctl / source / inc / accessibledialogwindow.hxx
blob42c1f9390433e3d7d38bb9da35f258feec35f5d3
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 <com/sun/star/lang/XServiceInfo.hpp>
24 #include <comphelper/accessiblecomponenthelper.hxx>
25 #include <cppuhelper/implbase.hxx>
26 #include <svl/lstner.hxx>
27 #include <tools/link.hxx>
28 #include <vcl/vclptr.hxx>
30 class VclSimpleEvent;
31 class VclWindowEvent;
33 namespace basctl
36 class DialogWindow;
37 class DlgEditor;
38 class DlgEdModel;
39 class DlgEdObj;
40 class AccessibleDialogControlShape;
43 class AccessibleDialogWindow final : public cppu::ImplInheritanceHelper<
44 comphelper::OAccessibleExtendedComponentHelper,
45 css::accessibility::XAccessible,
46 css::accessibility::XAccessibleSelection,
47 css::lang::XServiceInfo>,
48 public SfxListener
50 private:
52 class ChildDescriptor
54 public:
55 DlgEdObj* pDlgEdObj;
56 rtl::Reference< AccessibleDialogControlShape > mxAccessible;
58 ChildDescriptor( DlgEdObj* _pDlgEdObj );
60 bool operator==( const ChildDescriptor& rDesc );
61 bool operator<( const ChildDescriptor& rDesc ) const;
64 typedef std::vector< ChildDescriptor > AccessibleChildren;
66 AccessibleChildren m_aAccessibleChildren;
67 VclPtr<basctl::DialogWindow> m_pDialogWindow;
68 DlgEdModel* m_pDlgEdModel;
70 void UpdateFocused();
71 void UpdateSelected();
72 void UpdateBounds();
74 bool IsChildVisible( const ChildDescriptor& rDesc );
76 void InsertChild( const ChildDescriptor& rDesc );
77 void RemoveChild( const ChildDescriptor& rDesc );
78 void UpdateChild( const ChildDescriptor& rDesc );
79 void UpdateChildren();
80 void SortChildren();
82 DECL_LINK( WindowEventListener, VclWindowEvent&, void );
84 void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
85 void FillAccessibleStateSet( sal_Int64& rStateSet );
87 // OCommonAccessibleComponent
88 virtual css::awt::Rectangle implGetBounds( ) override;
90 // XComponent
91 virtual void SAL_CALL disposing() override;
93 public:
94 AccessibleDialogWindow (basctl::DialogWindow*);
95 virtual ~AccessibleDialogWindow() override;
97 // SfxListener
98 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
100 // XServiceInfo
101 virtual OUString SAL_CALL getImplementationName() override;
102 virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) override;
103 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
105 // XAccessible
106 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
108 // XAccessibleContext
109 virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
110 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
111 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
112 virtual sal_Int64 SAL_CALL getAccessibleIndexInParent( ) override;
113 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
114 virtual OUString SAL_CALL getAccessibleDescription( ) override;
115 virtual OUString SAL_CALL getAccessibleName( ) override;
116 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
117 virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override;
118 virtual css::lang::Locale SAL_CALL getLocale( ) override;
120 // XAccessibleComponent
121 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
122 virtual void SAL_CALL grabFocus( ) override;
123 virtual sal_Int32 SAL_CALL getForeground( ) override;
124 virtual sal_Int32 SAL_CALL getBackground( ) override;
126 // XAccessibleExtendedComponent
127 virtual OUString SAL_CALL getTitledBorderText( ) override;
128 virtual OUString SAL_CALL getToolTipText( ) override;
130 // XAccessibleSelection
131 virtual void SAL_CALL selectAccessibleChild( sal_Int64 nChildIndex ) override;
132 virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int64 nChildIndex ) override;
133 virtual void SAL_CALL clearAccessibleSelection() override;
134 virtual void SAL_CALL selectAllAccessibleChildren( ) override;
135 virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount( ) override;
136 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override;
137 virtual void SAL_CALL deselectAccessibleChild( sal_Int64 nChildIndex ) override;
140 } // namespace basctl
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */