1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <com/sun/star/accessibility/AccessibleScrollType.hpp>
23 #include <com/sun/star/accessibility/XAccessible.hpp>
24 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
25 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
26 #include <com/sun/star/accessibility/XAccessibleText.hpp>
27 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/uno/Reference.h>
30 #include <cppuhelper/implbase.hxx>
36 namespace accessibility
{ class AccessibleTextHelper
; }
38 // classes and helper-classes used for accessibility in the graphic-window
44 css::lang::XServiceInfo
,
45 css::accessibility::XAccessible
,
46 css::accessibility::XAccessibleComponent
,
47 css::accessibility::XAccessibleContext
,
48 css::accessibility::XAccessibleText
,
49 css::accessibility::XAccessibleEventBroadcaster
51 SmGraphicAccessibleBaseClass
;
53 class SmGraphicAccessible final
:
54 public SmGraphicAccessibleBaseClass
57 /// client id in the AccessibleEventNotifier queue
60 SmGraphicWidget
* pWin
;
62 SmGraphicAccessible( const SmGraphicAccessible
& ) = delete;
63 SmGraphicAccessible
& operator = ( const SmGraphicAccessible
& ) = delete;
65 SmDocShell
* GetDoc_Impl();
66 OUString
GetAccessibleText_Impl();
69 explicit SmGraphicAccessible( SmGraphicWidget
*pGraphicWin
);
70 virtual ~SmGraphicAccessible() override
;
72 void ClearWin(); // to be called when view is destroyed
74 const sal_Int16 nAccessibleEventId
,
75 const css::uno::Any
&rOldVal
,
76 const css::uno::Any
&rNewVal
);
79 virtual css::uno::Reference
< css::accessibility::XAccessibleContext
> SAL_CALL
getAccessibleContext( ) override
;
81 // XAccessibleComponent
82 virtual sal_Bool SAL_CALL
containsPoint( const css::awt::Point
& aPoint
) override
;
83 virtual css::uno::Reference
< css::accessibility::XAccessible
> SAL_CALL
getAccessibleAtPoint( const css::awt::Point
& aPoint
) override
;
84 virtual css::awt::Rectangle SAL_CALL
getBounds( ) override
;
85 virtual css::awt::Point SAL_CALL
getLocation( ) override
;
86 virtual css::awt::Point SAL_CALL
getLocationOnScreen( ) override
;
87 virtual css::awt::Size SAL_CALL
getSize( ) override
;
88 virtual void SAL_CALL
grabFocus( ) override
;
89 virtual sal_Int32 SAL_CALL
getForeground( ) override
;
90 virtual sal_Int32 SAL_CALL
getBackground( ) override
;
93 virtual sal_Int64 SAL_CALL
getAccessibleChildCount( ) override
;
94 virtual css::uno::Reference
< css::accessibility::XAccessible
> SAL_CALL
getAccessibleChild( sal_Int64 i
) override
;
95 virtual css::uno::Reference
< css::accessibility::XAccessible
> SAL_CALL
getAccessibleParent( ) override
;
96 virtual sal_Int64 SAL_CALL
getAccessibleIndexInParent( ) override
;
97 virtual sal_Int16 SAL_CALL
getAccessibleRole( ) override
;
98 virtual OUString SAL_CALL
getAccessibleDescription( ) override
;
99 virtual OUString SAL_CALL
getAccessibleName( ) override
;
100 virtual css::uno::Reference
< css::accessibility::XAccessibleRelationSet
> SAL_CALL
getAccessibleRelationSet( ) override
;
101 virtual sal_Int64 SAL_CALL
getAccessibleStateSet( ) override
;
102 virtual css::lang::Locale SAL_CALL
getLocale( ) override
;
104 // XAccessibleEventBroadcaster
105 virtual void SAL_CALL
addAccessibleEventListener( const css::uno::Reference
< css::accessibility::XAccessibleEventListener
>& xListener
) override
;
106 virtual void SAL_CALL
removeAccessibleEventListener( const css::uno::Reference
< css::accessibility::XAccessibleEventListener
>& xListener
) override
;
109 virtual sal_Int32 SAL_CALL
getCaretPosition( ) override
;
110 virtual sal_Bool SAL_CALL
setCaretPosition ( sal_Int32 nIndex
) override
;
111 virtual sal_Unicode SAL_CALL
getCharacter( sal_Int32 nIndex
) override
;
112 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
getCharacterAttributes( sal_Int32 nIndex
, const css::uno::Sequence
< OUString
>& aRequestedAttributes
) override
;
113 virtual css::awt::Rectangle SAL_CALL
getCharacterBounds( sal_Int32 nIndex
) override
;
114 virtual sal_Int32 SAL_CALL
getCharacterCount( ) override
;
115 virtual sal_Int32 SAL_CALL
getIndexAtPoint( const css::awt::Point
& aPoint
) override
;
116 virtual OUString SAL_CALL
getSelectedText( ) override
;
117 virtual sal_Int32 SAL_CALL
getSelectionStart( ) override
;
118 virtual sal_Int32 SAL_CALL
getSelectionEnd( ) override
;
119 virtual sal_Bool SAL_CALL
setSelection( sal_Int32 nStartIndex
, sal_Int32 nEndIndex
) override
;
120 virtual OUString SAL_CALL
getText( ) override
;
121 virtual OUString SAL_CALL
getTextRange( sal_Int32 nStartIndex
, sal_Int32 nEndIndex
) override
;
122 virtual css::accessibility::TextSegment SAL_CALL
getTextAtIndex( sal_Int32 nIndex
, sal_Int16 aTextType
) override
;
123 virtual css::accessibility::TextSegment SAL_CALL
getTextBeforeIndex( sal_Int32 nIndex
, sal_Int16 aTextType
) override
;
124 virtual css::accessibility::TextSegment SAL_CALL
getTextBehindIndex( sal_Int32 nIndex
, sal_Int16 aTextType
) override
;
125 virtual sal_Bool SAL_CALL
copyText( sal_Int32 nStartIndex
, sal_Int32 nEndIndex
) override
;
126 virtual sal_Bool SAL_CALL
scrollSubstringTo( sal_Int32 nStartIndex
, sal_Int32 nEndIndex
, css::accessibility::AccessibleScrollType aScrollType
) override
;
129 virtual OUString SAL_CALL
getImplementationName( ) override
;
130 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
131 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */