LibreOffice Module editeng (master) 1
AccessibleStaticTextBase.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#ifndef INCLUDED_EDITENG_ACCESSIBLESTATICTEXTBASE_HXX
21#define INCLUDED_EDITENG_ACCESSIBLESTATICTEXTBASE_HXX
22
23#include <memory>
24#include <tools/gen.hxx>
26#include <com/sun/star/uno/Reference.hxx>
27#include <com/sun/star/accessibility/AccessibleScrollType.hpp>
28#include <com/sun/star/accessibility/XAccessibleText.hpp>
29#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
30#include <com/sun/star/accessibility/TextSegment.hpp>
32
33namespace com::sun::star::accessibility { class XAccessible; }
34
35class SvxEditSource;
36
37namespace accessibility
38{
39
40 class AccessibleStaticTextBase_Impl;
41
42 typedef ::cppu::ImplHelper2<
43 css::accessibility::XAccessibleText,
44 css::accessibility::XAccessibleTextAttributes > AccessibleStaticTextBase_BASE;
45
90 {
91
92 public:
103 explicit AccessibleStaticTextBase( ::std::unique_ptr< SvxEditSource > && pEditSource );
104
106
107 private:
110
111 public:
112
140 void SetEditSource( ::std::unique_ptr< SvxEditSource > && pEditSource );
141
152 void SetEventSource( const css::uno::Reference< css::accessibility::XAccessible >& rInterface );
153
167 void SetOffset( const Point& rPoint );
168
177 void Dispose();
178
179 // XAccessibleText interface implementation
180 virtual sal_Int32 SAL_CALL getCaretPosition() override;
181 virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) override;
182 virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) override;
183 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) override;
184 virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) override;
185 virtual sal_Int32 SAL_CALL getCharacterCount() override;
186 virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override;
187 virtual OUString SAL_CALL getSelectedText() override;
188 virtual sal_Int32 SAL_CALL getSelectionStart() override;
189 virtual sal_Int32 SAL_CALL getSelectionEnd() override;
191 virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
192 virtual OUString SAL_CALL getText() override;
193 virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
195 virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
197 virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
199 virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
201 virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
202 virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override;
203
204 // XAccessibleTextAttributes
205 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getDefaultAttributes( const css::uno::Sequence< OUString >& RequestedAttributes ) override;
206 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getRunAttributes( sal_Int32 Index, const css::uno::Sequence< OUString >& RequestedAttributes ) override;
207
208 // child-related methods from XAccessibleContext
210 virtual sal_Int64 SAL_CALL getAccessibleChildCount();
213 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i );
214
215 // child-related methods from XAccessibleComponent
217 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint );
218
219 protected:
220 tools::Rectangle GetParagraphBoundingBox() const;
221
222 private:
223
225 const std::unique_ptr< AccessibleStaticTextBase_Impl > mpImpl;
226
227 };
228
229} // end of namespace accessibility
230
231#endif // INCLUDED_EDITENG_ACCESSIBLESTATICTEXTBASE_HXX
232
233/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
Wrapper class for unified EditEngine/Outliner access.
Definition: unoedsrc.hxx:56
Helper class for objects containing EditEngine/Outliner text.
AccessibleStaticTextBase(::std::unique_ptr< SvxEditSource > &&pEditSource)
Create accessible text object for given edit source.
const std::unique_ptr< AccessibleStaticTextBase_Impl > mpImpl
@dyn
AccessibleStaticTextBase(const AccessibleStaticTextBase &)=delete
#define EDITENG_DLLPUBLIC
Definition: editengdllapi.h:28
::cppu::ImplHelper2< css::accessibility::XAccessibleText, css::accessibility::XAccessibleTextAttributes > AccessibleStaticTextBase_BASE
void Dispose(const T &xInterface)
unsigned char sal_Bool
sal_uInt16 sal_Unicode