LibreOffice Module editeng (master) 1
AccessibleComponentBase.cxx
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
21
22#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
23
24#include <tools/color.hxx>
25
26using namespace ::com::sun::star;
27using namespace ::com::sun::star::accessibility;
28
29namespace accessibility {
30
31// internal
32
34{
35}
36
37
39{
40}
41
42// XAccessibleComponent
43
45 const css::awt::Point& aPoint)
46{
47 awt::Size aSize (getSize());
48 return (aPoint.X >= 0)
49 && (aPoint.X < aSize.Width)
50 && (aPoint.Y >= 0)
51 && (aPoint.Y < aSize.Height);
52}
53
54
55uno::Reference<XAccessible > SAL_CALL
57 const awt::Point& /*aPoint*/)
58{
59 return uno::Reference<XAccessible>();
60}
61
62
63awt::Rectangle SAL_CALL AccessibleComponentBase::getBounds()
64{
65 return awt::Rectangle();
66}
67
68
70{
71 awt::Rectangle aBBox (getBounds());
72 return awt::Point (aBBox.X, aBBox.Y);
73}
74
75
77{
78 return awt::Point();
79}
80
81
82css::awt::Size SAL_CALL AccessibleComponentBase::getSize()
83{
84 awt::Rectangle aBBox (getBounds());
85 return awt::Size (aBBox.Width, aBBox.Height);
86}
87
88
90{
91 uno::Reference<XAccessibleContext> xContext (this, uno::UNO_QUERY);
92 uno::Reference<XAccessibleSelection> xSelection (
93 xContext->getAccessibleParent(), uno::UNO_QUERY);
94 if (xSelection.is())
95 {
96 // Do a single selection on this object.
97 xSelection->clearAccessibleSelection();
98 xSelection->selectAccessibleChild (xContext->getAccessibleIndexInParent());
99 }
100}
101
102
104{
105 return sal_Int32(COL_BLACK);
106}
107
108
110{
111 return sal_Int32(COL_WHITE);
112}
113
114
115// XAccessibleExtendedComponent
116
117css::uno::Reference< css::awt::XFont > SAL_CALL
119{
120 return uno::Reference<awt::XFont>();
121}
122
123
125{
126 return OUString();
127}
128
129
131{
132 return OUString();
133}
134
135// XTypeProvider
136
137uno::Sequence<uno::Type>
139{
140 static const uno::Sequence aTypeList {
143 return aTypeList;
144}
145
146
147} // end of namespace accessibility
148
149/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString SAL_CALL getToolTipText() override
virtual css::awt::Point SAL_CALL getLocation() override
The default implementation uses the result of <member>getBounds</member> to determine the location.
virtual void SAL_CALL grabFocus() override
The default implementation does nothing.
virtual css::awt::Rectangle SAL_CALL getBounds() override
The default implementation returns an empty rectangle.
virtual OUString SAL_CALL getTitledBorderText() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
virtual sal_Int32 SAL_CALL getForeground() override
Returns black as the default foreground color.
virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
The default implementation returns an empty reference.
virtual sal_Int32 SAL_CALL getBackground() override
Returns white as the default background color.
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
The default implementation returns an empty position, i.e.
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
The default implementation uses the result of <member>getBounds</member> to determine whether the giv...
virtual css::awt::Size SAL_CALL getSize() override
The default implementation uses the result of <member>getBounds</member> to determine the size.
css::uno::Type const & get()
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
unsigned char sal_Bool