LibreOffice Module sc (master) 1
AccessibleEditObject.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
23
24#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
25#include <address.hxx>
26#include <vcl/vclptr.hxx>
27#include <vcl/customweld.hxx>
28
29#include <memory>
30
31namespace accessibility
32{
33 class AccessibleTextHelper;
34}
35class EditView;
36class ScTextWnd;
37namespace vcl { class Window; }
38
45 public css::accessibility::XAccessibleSelection
46{
47public:
49 {
53 };
54
56 const css::uno::Reference<css::accessibility::XAccessible>& rxParent,
57 EditView* pEditView, vcl::Window* pWin, const OUString& rName,
58 const OUString& rDescription, EditObjectType eObjectType);
59
60 void InitAcc(
61 const css::uno::Reference<css::accessibility::XAccessible>& rxParent,
62 EditView* pEditView, const OUString& rName, const OUString& rDescription);
63
64protected:
65 virtual ~ScAccessibleEditObject() override;
66
68
70
71public:
73
74 virtual void SAL_CALL disposing() override;
75
76 void LostFocus();
77
78 void GotFocus();
80
81 virtual css::uno::Any SAL_CALL queryInterface(
82 css::uno::Type const & rType ) override;
83
84 virtual void SAL_CALL acquire() noexcept override;
85
86 virtual void SAL_CALL release() noexcept override;
88
89 virtual css::uno::Reference< css::accessibility::XAccessible >
90 SAL_CALL getAccessibleAtPoint(
91 const css::awt::Point& rPoint ) override;
92
94
95protected:
97 virtual tools::Rectangle GetBoundingBoxOnScreen() const override;
98
100 virtual tools::Rectangle GetBoundingBox() const override;
101
102public:
104
107 virtual sal_Int32 SAL_CALL
108 getAccessibleChildCount() override;
109
112 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
113 getAccessibleChild(sal_Int32 nIndex) override;
114
116 virtual css::uno::Reference<
117 css::accessibility::XAccessibleStateSet> SAL_CALL
118 getAccessibleStateSet() override;
119
120 //===== XAccessibleSelection ============================================
121
122 virtual void SAL_CALL selectAccessibleChild(
123 sal_Int32 nChildIndex ) override;
124 virtual sal_Bool SAL_CALL isAccessibleChildSelected(
125 sal_Int32 nChildIndex ) override;
126 virtual void SAL_CALL clearAccessibleSelection( ) override;
127 virtual void SAL_CALL selectAllAccessibleChildren( ) override;
128 virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) override;
129 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(
130 sal_Int32 nSelectedChildIndex ) override;
131 virtual void SAL_CALL deselectAccessibleChild(
132 sal_Int32 nSelectedChildIndex ) override;
133 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
134protected:
136 virtual OUString
138
140 virtual OUString
141 createAccessibleName() override;
142
143public:
145
149 virtual void SAL_CALL
151 const css::uno::Reference<css::accessibility::XAccessibleEventListener>& xListener) override;
152
153 // Remove an existing event listener.
154 virtual void SAL_CALL
156 const css::uno::Reference<css::accessibility::XAccessibleEventListener>& xListener) override;
157
159
162 virtual OUString SAL_CALL
163 getImplementationName() override;
164
166
169 virtual css::uno::Sequence<sal_Int8> SAL_CALL
170 getImplementationId() override;
171
172private:
173 std::unique_ptr<accessibility::AccessibleTextHelper> mpTextHelper;
176protected:
178private:
181
182 bool IsDefunc(
183 const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates);
184
185 void CreateTextHelper();
188
190 virtual sal_Int32 SAL_CALL getForeground( ) override;
191
192 virtual sal_Int32 SAL_CALL getBackground( ) override;
193
194 sal_Int32 GetFgBgColor( const OUString &strPropColor) ;
195};
196
198{
199private:
201
202protected:
204 virtual tools::Rectangle GetBoundingBoxOnScreen() const override;
205
207 virtual tools::Rectangle GetBoundingBox() const override;
208
209public:
211 : ScAccessibleEditObject(eObjectType)
212 , m_pController(pController)
213 {
214 }
215
216 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
217
218 // for mapping positions/sizes within the TextView to a11y
219 virtual OutputDevice* GetOutputDeviceForView() override;
220
222 virtual void SAL_CALL disposing() override;
223};
224
226{
227public:
229};
230
231/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL disposing() override
ScAccessibleEditControlObject(weld::CustomWidgetController *pController, EditObjectType eObjectType)
weld::CustomWidgetController * m_pController
@descr This base class provides an implementation of the AccessibleCell service.
std::unique_ptr< accessibility::AccessibleTextHelper > mpTextHelper
virtual OutputDevice * GetOutputDeviceForView()
virtual void SAL_CALL selectAllAccessibleChildren() override
virtual tools::Rectangle GetBoundingBox() const override
Return the object's current bounding box relative to the parent object.
VclPtr< vcl::Window > mpWindow
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
===== XAccessibleEventBroadcaster =====================================
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) override
===== XInterface =====================================================
virtual OUString SAL_CALL getImplementationName() override
===== XServiceInfo ====================================================
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
virtual void SAL_CALL disposing() override
virtual sal_Int32 SAL_CALL getBackground() override
virtual void SAL_CALL deselectAccessibleChild(sal_Int32 nSelectedChildIndex) override
ScAccessibleEditObject(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, EditView *pEditView, vcl::Window *pWin, const OUString &rName, const OUString &rDescription, EditObjectType eObjectType)
void InitAcc(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, EditView *pEditView, const OUString &rName, const OUString &rDescription)
virtual sal_Int32 SAL_CALL getForeground() override
===== XAccessibleComponent ============================================
sal_Int32 GetFgBgColor(const OUString &strPropColor)
virtual tools::Rectangle GetBoundingBoxOnScreen() const override
Return the object's current bounding box relative to the desktop.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &rPoint) override
===== XAccessibleComponent ============================================
virtual OUString createAccessibleDescription() override
Return this object's description.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int32 nSelectedChildIndex) override
virtual OUString createAccessibleName() override
Return the object's current name.
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int32 nChildIndex) override
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
===== XAccessibleContext ==============================================
virtual void SAL_CALL acquire() noexcept override
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
Return the set of current states.
virtual ~ScAccessibleEditObject() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
===== XTypeProvider ===================================================
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Return NULL to indicate that an empty relation set.
virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() override
virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 nIndex) override
Return the specified child or NULL if index is invalid.
virtual void SAL_CALL clearAccessibleSelection() override
virtual void SAL_CALL release() noexcept override
unsigned char sal_Bool
signed char sal_Int8