Bump version to 6.4-15
[LibreOffice.git] / svx / source / inc / AccessibleFrameSelector.hxx
blob1e042e5cc8964b34614f6e96d5e05e7f7d96a41a
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 #ifndef INCLUDED_SVX_SOURCE_INC_ACCESSIBLEFRAMESELECTOR_HXX
21 #define INCLUDED_SVX_SOURCE_INC_ACCESSIBLEFRAMESELECTOR_HXX
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
25 #include <com/sun/star/awt/XFocusListener.hpp>
26 #include <com/sun/star/accessibility/XAccessible.hpp>
27 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
28 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
29 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
30 #include <tools/link.hxx>
31 #include <cppuhelper/implbase.hxx>
32 #include <comphelper/accessibleselectionhelper.hxx>
33 #include <svx/framebordertype.hxx>
34 #include <vcl/vclptr.hxx>
36 namespace svx {
38 class FrameSelector;
40 namespace a11y {
42 typedef ::cppu::ImplHelper1<css::accessibility::XAccessible> OAccessibleHelper_Base;
44 class AccFrameSelector final : public ::comphelper::OAccessibleComponentHelper,
45 public OAccessibleHelper_Base
47 public:
48 explicit AccFrameSelector(FrameSelector& rFrameSel);
49 virtual ~AccFrameSelector() override;
51 DECLARE_XINTERFACE( )
52 DECLARE_XTYPEPROVIDER( )
54 //XAccessibleComponent
55 virtual void SAL_CALL grabFocus( ) override;
56 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
58 //XAccessibleContext
59 virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override;
60 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override;
61 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
62 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
63 virtual OUString SAL_CALL getAccessibleDescription( ) override;
64 virtual OUString SAL_CALL getAccessibleName( ) override;
65 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
66 virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) override;
68 //XAccessible
69 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
71 virtual sal_Int32 SAL_CALL getForeground( ) override;
72 virtual sal_Int32 SAL_CALL getBackground( ) override;
74 void Invalidate();
76 private:
77 // OCommonAccessibleComponent
78 /// implements the calculation of the bounding rectangle
79 virtual css::awt::Rectangle implGetBounds( ) override;
81 /// @throws css::uno::RuntimeException
82 void IsValid();
84 FrameSelector* mpFrameSel;
87 class AccFrameSelectorChild final : public ::comphelper::OAccessibleComponentHelper,
88 public OAccessibleHelper_Base
90 public:
91 explicit AccFrameSelectorChild( FrameSelector& rFrameSel, FrameBorderType eBorder );
93 virtual ~AccFrameSelectorChild() override;
95 DECLARE_XINTERFACE( )
96 DECLARE_XTYPEPROVIDER( )
98 //XAccessibleComponent
99 virtual void SAL_CALL grabFocus( ) override;
100 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
102 //XAccessibleContext
103 virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override;
104 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override;
105 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
106 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
107 virtual OUString SAL_CALL getAccessibleDescription( ) override;
108 virtual OUString SAL_CALL getAccessibleName( ) override;
109 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
110 virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) override;
112 //XAccessible
113 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
115 virtual sal_Int32 SAL_CALL getForeground( ) override;
116 virtual sal_Int32 SAL_CALL getBackground( ) override;
118 void NotifyAccessibleEvent(const sal_Int16 _nEventId, const css::uno::Any& _rOldValue, const css::uno::Any& _rNewValue)
120 ::comphelper::OAccessibleComponentHelper::NotifyAccessibleEvent(_nEventId, _rOldValue, _rNewValue);
123 void Invalidate();
125 private:
126 // OCommonAccessibleComponent
127 /// implements the calculation of the bounding rectangle
128 virtual css::awt::Rectangle implGetBounds( ) override;
130 /// @throws css::uno::RuntimeException
131 void IsValid();
133 FrameSelector* mpFrameSel;
135 FrameBorderType const meBorder;
142 #endif
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */