/src/libreoffice/vcl/inc/accessibility/vclxaccessibletextcomponent.hxx
Line | Count | Source |
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 | | |
22 | | #include <comphelper/accessibletexthelper.hxx> |
23 | | #include <cppuhelper/implbase.hxx> |
24 | | #include <vcl/accessibility/vclxaccessiblecomponent.hxx> |
25 | | |
26 | | |
27 | | |
28 | | |
29 | | class VCLXAccessibleTextComponent : public cppu::ImplInheritanceHelper< |
30 | | VCLXAccessibleComponent, |
31 | | css::accessibility::XAccessibleText>, |
32 | | public ::comphelper::OCommonAccessibleText |
33 | | { |
34 | | OUString m_sText; |
35 | | |
36 | | // accessible name the object had when SetText was called last time |
37 | | OUString m_sOldName; |
38 | | |
39 | | protected: |
40 | | void SetText( const OUString& sText ); |
41 | | |
42 | | // Whether text segments for old/new value in AccessibleEventId::TEXT_CHANGED |
43 | | // event should always include the whole old and new text instead of just |
44 | | // the characters that changed between the two |
45 | 0 | virtual bool PreferFullTextInTextChangedEvent() { return false; }; |
46 | | |
47 | | virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; |
48 | | |
49 | | // OCommonAccessibleText |
50 | | virtual OUString implGetText() override; |
51 | | virtual css::lang::Locale implGetLocale() override; |
52 | | virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; |
53 | | |
54 | | // XComponent |
55 | | virtual void SAL_CALL disposing() override; |
56 | | |
57 | | public: |
58 | | VCLXAccessibleTextComponent(vcl::Window* pWindow); |
59 | | |
60 | | // XAccessibleText |
61 | | virtual sal_Int32 SAL_CALL getCaretPosition() override; |
62 | | virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) override; |
63 | | virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) override; |
64 | | virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) override; |
65 | | virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) override; |
66 | | virtual sal_Int32 SAL_CALL getCharacterCount() override; |
67 | | virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override; |
68 | | virtual OUString SAL_CALL getSelectedText() override; |
69 | | virtual sal_Int32 SAL_CALL getSelectionStart() override; |
70 | | virtual sal_Int32 SAL_CALL getSelectionEnd() override; |
71 | | virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; |
72 | | virtual OUString SAL_CALL getText() override; |
73 | | virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; |
74 | | virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; |
75 | | virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; |
76 | | virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; |
77 | | virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; |
78 | | virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; |
79 | | }; |
80 | | |
81 | | |
82 | | |
83 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |