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_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETEXTCOMPONENT_HXX
21 #define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETEXTCOMPONENT_HXX
22 
23 #include <toolkit/awt/vclxaccessiblecomponent.hxx>
24 #include <comphelper/accessibletexthelper.hxx>
25 
26 
27 //  class VCLXAccessibleTextComponent
28 
29 
30 typedef ::cppu::ImplHelper1 <
31     css::accessibility::XAccessibleText >  VCLXAccessibleTextComponent_BASE;
32 
33 class VCLXAccessibleTextComponent : public VCLXAccessibleComponent,
34                                     public ::comphelper::OCommonAccessibleText,
35                                     public VCLXAccessibleTextComponent_BASE
36 {
37     OUString                                m_sText;
38 
39 protected:
40     void                                    SetText( const OUString& sText );
41 
42     virtual void                            ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override;
43 
44     // OCommonAccessibleText
45     virtual OUString                        implGetText() override;
46     virtual css::lang::Locale               implGetLocale() override;
47     virtual void                            implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override;
48 
49     // XComponent
50     virtual void SAL_CALL                   disposing() override;
51 
52 public:
53     VCLXAccessibleTextComponent( VCLXWindow* pVCLXWindow );
54 
55     // XInterface
56     DECLARE_XINTERFACE()
57 
58     // XTypeProvider
59     DECLARE_XTYPEPROVIDER()
60 
61     // XAccessibleText
62     virtual sal_Int32 SAL_CALL getCaretPosition() override;
63     virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) override;
64     virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) override;
65     virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) override;
66     virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) override;
67     virtual sal_Int32 SAL_CALL getCharacterCount() override;
68     virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override;
69     virtual OUString SAL_CALL getSelectedText() override;
70     virtual sal_Int32 SAL_CALL getSelectionStart() override;
71     virtual sal_Int32 SAL_CALL getSelectionEnd() override;
72     virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
73     virtual OUString SAL_CALL getText() override;
74     virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
75     virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
76     virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
77     virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
78     virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
79 };
80 
81 
82 #endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETEXTCOMPONENT_HXX
83 
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
85