Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / accessibility / inc / standard / vclxaccessibleedit.hxx
bloba6207c202c423944ea03241fa089db6e26eebf73
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEEDIT_HXX
21 #define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEEDIT_HXX
23 #include <standard/vclxaccessibletextcomponent.hxx>
24 #include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
25 #include <com/sun/star/accessibility/XAccessibleAction.hpp>
27 #include <cppuhelper/implbase2.hxx>
30 // class VCLXAccessibleEdit
33 typedef ::cppu::ImplHelper2<
34 css::accessibility::XAccessibleAction,
35 css::accessibility::XAccessibleEditableText > VCLXAccessibleEdit_BASE;
37 class VCLXAccessibleEdit final : public VCLXAccessibleTextComponent,
38 public VCLXAccessibleEdit_BASE
40 friend class VCLXAccessibleBox;
42 private:
43 sal_Int32 m_nCaretPosition;
45 virtual ~VCLXAccessibleEdit() override = default;
47 virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
48 virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override;
49 sal_Int16 implGetAccessibleRole();
51 // OCommonAccessibleText
52 virtual OUString implGetText() override;
53 virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override;
55 public:
56 VCLXAccessibleEdit( VCLXWindow* pVCLXindow );
58 // XInterface
59 DECLARE_XINTERFACE()
61 // XTypeProvider
62 DECLARE_XTYPEPROVIDER()
64 // XServiceInfo
65 virtual OUString SAL_CALL getImplementationName() override;
66 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
68 // XAccessibleContext
69 virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override;
70 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override;
71 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
73 // XAccessibleAction
74 virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) override;
75 virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) override;
76 virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) override;
77 virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) override;
79 // XAccessibleText
80 virtual sal_Int32 SAL_CALL getCaretPosition( ) override;
81 virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) override;
82 virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) override;
83 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) override;
84 virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) override;
85 virtual sal_Int32 SAL_CALL getCharacterCount( ) override;
86 virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override;
87 virtual OUString SAL_CALL getSelectedText( ) override;
88 virtual sal_Int32 SAL_CALL getSelectionStart( ) override;
89 virtual sal_Int32 SAL_CALL getSelectionEnd( ) override;
90 virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
91 virtual OUString SAL_CALL getText( ) override;
92 virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
93 virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
94 virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
95 virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
96 virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
98 // XAccessibleEditableText
99 virtual sal_Bool SAL_CALL cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
100 virtual sal_Bool SAL_CALL pasteText( sal_Int32 nIndex ) override;
101 virtual sal_Bool SAL_CALL deleteText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
102 virtual sal_Bool SAL_CALL insertText( const OUString& sText, sal_Int32 nIndex ) override;
103 virtual sal_Bool SAL_CALL replaceText( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const OUString& sReplacement ) override;
104 virtual sal_Bool SAL_CALL setAttributes( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const css::uno::Sequence< css::beans::PropertyValue >& aAttributeSet ) override;
105 virtual sal_Bool SAL_CALL setText( const OUString& sText ) override;
108 #endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEEDIT_HXX
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */