LibreOffice Module basctl (master) 1
accessibledialogwindow.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
23#include <com/sun/star/lang/XServiceInfo.hpp>
26#include <svl/lstner.hxx>
27#include <tools/link.hxx>
28#include <vcl/vclptr.hxx>
29
30class VclSimpleEvent;
31class VclWindowEvent;
32
33namespace basctl
34{
35
36class DialogWindow;
37class DlgEditor;
38class DlgEdModel;
39class DlgEdObj;
40
41
42
43class AccessibleDialogWindow final : public cppu::ImplInheritanceHelper<
44 comphelper::OAccessibleExtendedComponentHelper,
45 css::accessibility::XAccessible,
46 css::accessibility::XAccessibleSelection,
47 css::lang::XServiceInfo>,
48 public SfxListener
49{
50private:
51
53 {
54 public:
56 css::uno::Reference< css::accessibility::XAccessible > rxAccessible;
57
58 ChildDescriptor( DlgEdObj* _pDlgEdObj );
59
60 bool operator==( const ChildDescriptor& rDesc );
61 bool operator<( const ChildDescriptor& rDesc ) const;
62 };
63
64 typedef std::vector< ChildDescriptor > AccessibleChildren;
65
69
70 void UpdateFocused();
71 void UpdateSelected();
72 void UpdateBounds();
73
74 bool IsChildVisible( const ChildDescriptor& rDesc );
75
76 void InsertChild( const ChildDescriptor& rDesc );
77 void RemoveChild( const ChildDescriptor& rDesc );
78 void UpdateChild( const ChildDescriptor& rDesc );
79 void UpdateChildren();
80 void SortChildren();
81
82 DECL_LINK( WindowEventListener, VclWindowEvent&, void );
83
84 void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
85 void FillAccessibleStateSet( sal_Int64& rStateSet );
86
87 // OCommonAccessibleComponent
88 virtual css::awt::Rectangle implGetBounds( ) override;
89
90 // XComponent
91 virtual void SAL_CALL disposing() override;
92
93public:
95 virtual ~AccessibleDialogWindow() override;
96
97 // SfxListener
98 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
99
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;
104
105 // XAccessible
106 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
107
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;
119
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;
125
126 // XAccessibleExtendedComponent
127 virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override;
128 virtual OUString SAL_CALL getTitledBorderText( ) override;
129 virtual OUString SAL_CALL getToolTipText( ) override;
130
131 // XAccessibleSelection
132 virtual void SAL_CALL selectAccessibleChild( sal_Int64 nChildIndex ) override;
133 virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int64 nChildIndex ) override;
134 virtual void SAL_CALL clearAccessibleSelection() override;
135 virtual void SAL_CALL selectAllAccessibleChildren( ) override;
136 virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount( ) override;
137 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override;
138 virtual void SAL_CALL deselectAccessibleChild( sal_Int64 nChildIndex ) override;
139};
140
141} // namespace basctl
142
143/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool operator<(const ChildDescriptor &rDesc) const
css::uno::Reference< css::accessibility::XAccessible > rxAccessible
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
virtual void SAL_CALL selectAllAccessibleChildren() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
std::vector< ChildDescriptor > AccessibleChildren
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int64 nChildIndex) override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
virtual OUString SAL_CALL getAccessibleName() override
virtual void SAL_CALL selectAccessibleChild(sal_Int64 nChildIndex) override
virtual sal_Int32 SAL_CALL getForeground() override
virtual OUString SAL_CALL getToolTipText() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
void RemoveChild(const ChildDescriptor &rDesc)
bool IsChildVisible(const ChildDescriptor &rDesc)
AccessibleDialogWindow(basctl::DialogWindow *)
virtual OUString SAL_CALL getImplementationName() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
VclPtr< basctl::DialogWindow > m_pDialogWindow
void FillAccessibleStateSet(sal_Int64 &rStateSet)
virtual void SAL_CALL disposing() override
virtual void SAL_CALL deselectAccessibleChild(sal_Int64 nChildIndex) override
virtual css::awt::Rectangle implGetBounds() override
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
virtual css::lang::Locale SAL_CALL getLocale() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
void UpdateChild(const ChildDescriptor &rDesc)
virtual void SAL_CALL clearAccessibleSelection() override
virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont() override
void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent)
virtual OUString SAL_CALL getTitledBorderText() override
virtual sal_Int32 SAL_CALL getBackground() override
void InsertChild(const ChildDescriptor &rDesc)
virtual void SAL_CALL grabFocus() override
DECL_LINK(WindowEventListener, VclWindowEvent &, void)
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual OUString SAL_CALL getAccessibleDescription() override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override
unsigned char sal_Bool