1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
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>
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
>,
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
;
71 void UpdateSelected();
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();
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
;
91 virtual void SAL_CALL
disposing() override
;
94 AccessibleDialogWindow (basctl::DialogWindow
*);
95 virtual ~AccessibleDialogWindow() override
;
98 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
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
;
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: */