LibreOffice Module svx (master) 1
svxrectctaccessiblecontext.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
21#ifndef INCLUDED_SVX_SOURCE_INC_SVXRECTCTACCESSIBLECONTEXT_HXX
22#define INCLUDED_SVX_SOURCE_INC_SVXRECTCTACCESSIBLECONTEXT_HXX
23
24#include <com/sun/star/accessibility/XAccessible.hpp>
25#include <com/sun/star/accessibility/XAccessibleContext.hpp>
26#include <com/sun/star/accessibility/XAccessibleAction.hpp>
27#include <com/sun/star/accessibility/XAccessibleValue.hpp>
28#include <com/sun/star/uno/Reference.hxx>
31#include <rtl/ref.hxx>
32#include <svx/rectenum.hxx>
33#include <tools/gen.hxx>
34#include <vector>
35
36namespace com::sun::star::awt {
37 struct Point;
38 struct Rectangle;
39 struct Size;
40 class XFocusListener;
41}
42namespace tools { class Rectangle; }
43class SvxRectCtl;
45
46class SvxRectCtlAccessibleContext final : public cppu::ImplInheritanceHelper<
47 ::comphelper::OAccessibleSelectionHelper,
48 css::accessibility::XAccessible>
49{
50public:
51 // internal
53
54 // XAccessibleComponent
55 virtual void SAL_CALL grabFocus() override;
56 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point& rPoint) override;
57
58 // XAccessible
59 // XAccessibleContext
60 virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
61 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL getAccessibleChild(sal_Int64 nIndex) override;
62 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL getAccessibleParent() override;
63 virtual sal_Int16 SAL_CALL getAccessibleRole() override;
64 virtual OUString SAL_CALL getAccessibleDescription() override;
65 virtual OUString SAL_CALL getAccessibleName() override;
66 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override;
67 virtual sal_Int64 SAL_CALL getAccessibleStateSet() override;
68
69 virtual css::uno::Reference< css::accessibility::XAccessibleContext> SAL_CALL getAccessibleContext() override { return this; }
70 virtual sal_Int32 SAL_CALL getForeground() override;
71 virtual sal_Int32 SAL_CALL getBackground() override;
72
81 void selectChild( RectPoint ePoint );
82 void FireChildFocus( RectPoint eButton );
83
84private:
85 virtual ~SvxRectCtlAccessibleContext() override;
86
87 // OCommonAccessibleSelection
88 // return if the specified child is visible => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
89 virtual bool implIsSelected(sal_Int64 nAccessibleChildIndex) override;
90
91 // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
92 virtual void implSelect(sal_Int64 nAccessibleChildIndex, bool bSelect) override;
93
94 // OCommonAccessibleComponent
95 virtual css::awt::Rectangle implGetBounds() override;
96
97 virtual void SAL_CALL disposing() override;
98
99 void checkChildIndex(sal_Int64 nIndex);
100
109 void selectChild( tools::Long nIndexOfChild );
110
115
118 OUString msName;
119
122
124 std::vector<rtl::Reference<SvxRectCtlChildAccessibleContext>> mvChildren;
125
128};
129
130class SvxRectCtlChildAccessibleContext final : public cppu::ImplInheritanceHelper<
131 ::comphelper::OAccessibleComponentHelper,
132 css::accessibility::XAccessible,
133 css::accessibility::XAccessibleValue,
134 css::accessibility::XAccessibleAction>
135{
136public:
138 const css::uno::Reference< css::accessibility::XAccessible>& rxParent,
139 OUString aName, OUString aDescription,
140 const tools::Rectangle& rBoundingBox,
141 tools::Long nIndexInParent );
142
143 // XAccessibleComponent
144 virtual void SAL_CALL grabFocus() override;
145 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& rPoint ) override;
146
147 // XAccessibleContext
148 virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
149 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 nIndex ) override;
150 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override;
151 virtual sal_Int16 SAL_CALL getAccessibleRole() override;
152 virtual OUString SAL_CALL getAccessibleDescription() override;
153 virtual OUString SAL_CALL getAccessibleName() override;
154 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override;
155 virtual sal_Int64 SAL_CALL getAccessibleStateSet() override;
156
157 virtual css::uno::Reference< css::accessibility::XAccessibleContext> SAL_CALL getAccessibleContext() override { return this; }
158
159 virtual sal_Int32 SAL_CALL getForeground() override;
160 virtual sal_Int32 SAL_CALL getBackground() override;
161
162 // XAccessibleValue
163 virtual css::uno::Any SAL_CALL
164 getCurrentValue() override;
165
166 virtual sal_Bool SAL_CALL
167 setCurrentValue( const css::uno::Any& aNumber ) override;
168
169 virtual css::uno::Any SAL_CALL
170 getMaximumValue() override;
171
172 virtual css::uno::Any SAL_CALL
173 getMinimumValue() override;
174
175 virtual css::uno::Any SAL_CALL
176 getMinimumIncrement() override;
177
178 // XAccessibleAction
179 virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) override;
180 virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) override;
181 virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) override;
182 virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) override;
183
184 // internal
186 void setStateChecked(bool bChecked);
187 void FireFocusEvent();
188
189private:
190 virtual ~SvxRectCtlChildAccessibleContext() override;
191
192 virtual void SAL_CALL disposing() override;
193
194 // OCommonAccessibleComponent
196 virtual css::awt::Rectangle implGetBounds( ) override;
197
203
207 OUString msName;
208
210 css::uno::Reference< css::accessibility::XAccessible >
212
215
218
221};
222
223
224#endif
225
226/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::awt::Rectangle implGetBounds() override
virtual OUString SAL_CALL getAccessibleDescription() override
virtual bool implIsSelected(sal_Int64 nAccessibleChildIndex) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &rPoint) override
virtual sal_Int32 SAL_CALL getForeground() override
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Return empty reference to indicate that the relation set is not supported.
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual void SAL_CALL disposing() override
void selectChild(RectPoint ePoint)
Selects a new child by point.
virtual void SAL_CALL grabFocus() override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
SvxRectCtlAccessibleContext(SvxRectCtl *pRepresentation)
std::vector< rtl::Reference< SvxRectCtlChildAccessibleContext > > mvChildren
array for all possible children
virtual sal_Int32 SAL_CALL getBackground() override
SvxRectCtl * mpRepr
pointer to internal representation
OUString msDescription
Description of this object.
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
tools::Long mnSelectedChild
actual selected child
virtual void implSelect(sal_Int64 nAccessibleChildIndex, bool bSelect) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
OUString msName
Name of this object.
virtual OUString SAL_CALL getAccessibleName() override
bool mbIsChecked
Indicates, if object is checked.
virtual css::uno::Any SAL_CALL getMaximumValue() override
virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding(sal_Int32 nIndex) override
virtual sal_Bool SAL_CALL doAccessibleAction(sal_Int32 nIndex) override
virtual void SAL_CALL grabFocus() override
virtual void SAL_CALL disposing() override
virtual css::uno::Any SAL_CALL getMinimumIncrement() override
tools::Long mnIndexInParent
index of child in parent
virtual OUString SAL_CALL getAccessibleActionDescription(sal_Int32 nIndex) override
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Return empty reference to indicate that the relation set is not supported.
virtual OUString SAL_CALL getAccessibleName() override
css::uno::Reference< css::accessibility::XAccessible > mxParent
Reference to the parent object.
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
virtual OUString SAL_CALL getAccessibleDescription() override
SvxRectCtlChildAccessibleContext(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, OUString aName, OUString aDescription, const tools::Rectangle &rBoundingBox, tools::Long nIndexInParent)
virtual sal_Bool SAL_CALL setCurrentValue(const css::uno::Any &aNumber) override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual sal_Int32 SAL_CALL getForeground() override
virtual sal_Int32 SAL_CALL getBackground() override
tools::Rectangle maBoundingBox
Bounding box.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &rPoint) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
OUString msDescription
Description of this object.
void setStateChecked(bool bChecked)
Sets the checked status.
virtual sal_Int32 SAL_CALL getAccessibleActionCount() override
virtual css::uno::Any SAL_CALL getCurrentValue() override
virtual css::awt::Rectangle implGetBounds() override
implements the calculation of the bounding rectangle
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
virtual css::uno::Any SAL_CALL getMinimumValue() override
sal_Int32 nIndex
OUString aName
long Long
RectPoint
Definition: rectenum.hxx:23
unsigned char sal_Bool