tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / accessibility / inc / standard / vclxaccessibleedit.hxx
blob6469101be7752717d5ffb12201551cf8aa86085f
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 #pragma once
22 #include <standard/vclxaccessibletextcomponent.hxx>
23 #include <com/sun/star/accessibility/AccessibleScrollType.hpp>
24 #include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
25 #include <com/sun/star/accessibility/XAccessibleAction.hpp>
27 #include <cppuhelper/implbase.hxx>
28 #include <vcl/toolkit/edit.hxx>
31 class VCLXAccessibleEdit : public cppu::ImplInheritanceHelper<
32 VCLXAccessibleTextComponent,
33 css::accessibility::XAccessibleAction,
34 css::accessibility::XAccessibleEditableText>
36 friend class VCLXAccessibleBox;
38 private:
39 sal_Int32 m_nCaretPosition;
41 protected:
42 virtual ~VCLXAccessibleEdit() override = default;
44 virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
45 virtual void FillAccessibleStateSet( sal_Int64& rStateSet ) override;
46 sal_Int16 implGetAccessibleRole();
48 // OCommonAccessibleText
49 virtual OUString implGetText() override;
50 virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override;
52 // VCLXAccessibleTextComponent
53 virtual bool PreferFullTextInTextChangedEvent() override;
55 public:
56 VCLXAccessibleEdit(Edit* pEdit);
58 // XServiceInfo
59 virtual OUString SAL_CALL getImplementationName() override;
60 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
62 // XAccessibleContext
63 virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
64 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
65 virtual OUString SAL_CALL getAccessibleName() override;
66 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
68 // XAccessibleAction
69 virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) override;
70 virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) override;
71 virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) override;
72 virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) override;
74 // XAccessibleText
75 virtual sal_Int32 SAL_CALL getCaretPosition( ) override;
76 virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) override;
77 virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) override;
78 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) override;
79 virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) override;
80 virtual sal_Int32 SAL_CALL getCharacterCount( ) override;
81 virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override;
82 virtual OUString SAL_CALL getSelectedText( ) override;
83 virtual sal_Int32 SAL_CALL getSelectionStart( ) override;
84 virtual sal_Int32 SAL_CALL getSelectionEnd( ) override;
85 virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
86 virtual OUString SAL_CALL getText( ) override;
87 virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
88 virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
89 virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
90 virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
91 virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
92 virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override;
94 // XAccessibleEditableText
95 virtual sal_Bool SAL_CALL cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
96 virtual sal_Bool SAL_CALL pasteText( sal_Int32 nIndex ) override;
97 virtual sal_Bool SAL_CALL deleteText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
98 virtual sal_Bool SAL_CALL insertText( const OUString& sText, sal_Int32 nIndex ) override;
99 virtual sal_Bool SAL_CALL replaceText( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const OUString& sReplacement ) override;
100 virtual sal_Bool SAL_CALL setAttributes( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const css::uno::Sequence< css::beans::PropertyValue >& aAttributeSet ) override;
101 virtual sal_Bool SAL_CALL setText( const OUString& sText ) override;
103 private:
104 bool isComboBoxChild();
105 bool isEditable();
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */