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_Int64 SAL_CALL
108 getAccessibleChildCount() override;
109
112 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
113 getAccessibleChild(sal_Int64 nIndex) override;
114
116 virtual sal_Int64 SAL_CALL getAccessibleStateSet() override;
117
118 //===== XAccessibleSelection ============================================
119
120 virtual void SAL_CALL selectAccessibleChild(
121 sal_Int64 nChildIndex ) override;
122 virtual sal_Bool SAL_CALL isAccessibleChildSelected(
123 sal_Int64 nChildIndex ) override;
124 virtual void SAL_CALL clearAccessibleSelection( ) override;
125 virtual void SAL_CALL selectAllAccessibleChildren( ) override;
126 virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount( ) override;
127 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(
128 sal_Int64 nSelectedChildIndex ) override;
129 virtual void SAL_CALL deselectAccessibleChild(
130 sal_Int64 nSelectedChildIndex ) override;
131 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
132protected:
134 virtual OUString
136
138 virtual OUString
139 createAccessibleName() override;
140
141public:
143
147 virtual void SAL_CALL
149 const css::uno::Reference<css::accessibility::XAccessibleEventListener>& xListener) override;
150
151 // Remove an existing event listener.
152 virtual void SAL_CALL
154 const css::uno::Reference<css::accessibility::XAccessibleEventListener>& xListener) override;
155
157
160 virtual OUString SAL_CALL
161 getImplementationName() override;
162
164
167 virtual css::uno::Sequence<sal_Int8> SAL_CALL
168 getImplementationId() override;
169
170private:
171 std::unique_ptr<accessibility::AccessibleTextHelper> mpTextHelper;
174protected:
176private:
179
180 bool IsDefunc(sal_Int64 nParentStates);
181
182 void CreateTextHelper();
185
187 virtual sal_Int32 SAL_CALL getForeground( ) override;
188
189 virtual sal_Int32 SAL_CALL getBackground( ) override;
190
191 sal_Int32 GetFgBgColor( const OUString &strPropColor) ;
192};
193
195{
196private:
198
199protected:
201 virtual tools::Rectangle GetBoundingBoxOnScreen() const override;
202
204 virtual tools::Rectangle GetBoundingBox() const override;
205
206public:
208 : ScAccessibleEditObject(eObjectType)
209 , m_pController(pController)
210 {
211 }
212
213 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
214
215 // for mapping positions/sizes within the TextView to a11y
216 virtual OutputDevice* GetOutputDeviceForView() override;
217
219 virtual void SAL_CALL disposing() override;
220};
221
223{
224public:
226};
227
228/* 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 void SAL_CALL deselectAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
Return the set of current states.
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::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
Return the specified child or NULL if index is invalid.
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 void SAL_CALL selectAccessibleChild(sal_Int64 nChildIndex) override
virtual sal_Int32 SAL_CALL getBackground() 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 css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int64 nSelectedChildIndex) override
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 sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int64 nChildIndex) override
virtual OUString createAccessibleName() override
Return the object's current name.
virtual void SAL_CALL acquire() noexcept override
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_Int64 SAL_CALL getAccessibleChildCount() override
===== XAccessibleContext ==============================================
virtual void SAL_CALL clearAccessibleSelection() override
virtual void SAL_CALL release() noexcept override
unsigned char sal_Bool
signed char sal_Int8