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 .
21 #include <accessibility/accessiblebrowseboxcell.hxx>
22 #include <comphelper/accessibletexthelper.hxx>
23 #include <cppuhelper/implbase2.hxx>
24 #include <com/sun/star/accessibility/AccessibleScrollType.hpp>
26 typedef ::cppu::ImplHelper2
< css::accessibility::XAccessibleText
27 , css::accessibility::XAccessible
28 > AccessibleTextHelper_BASE
;
30 // implementation of a table cell of BrowseBox
31 class AccessibleBrowseBoxTableCell final
: public AccessibleBrowseBoxCell
32 ,public AccessibleTextHelper_BASE
33 ,public ::comphelper::OCommonAccessibleText
38 // OCommonAccessibleText
39 virtual OUString
implGetText() final override
;
40 virtual css::lang::Locale
implGetLocale() override
;
41 virtual void implGetSelection( sal_Int32
& nStartIndex
, sal_Int32
& nEndIndex
) override
;
44 AccessibleBrowseBoxTableCell( const css::uno::Reference
< css::accessibility::XAccessible
>& _rxParent
,
45 ::vcl::IAccessibleTableProvider
& _rBrowseBox
,
50 // XInterface -------------------------------------------------------------
52 /** Queries for a new interface. */
53 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
55 /** Acquires the object (calls acquire() on base class). */
56 virtual void SAL_CALL
acquire() noexcept override
;
58 /** Releases the object (calls release() on base class). */
59 virtual void SAL_CALL
release() noexcept override
;
62 using AccessibleBrowseBoxBase::disposing
;
63 virtual void SAL_CALL
disposing( const css::lang::EventObject
& Source
) override
;
65 /** @return The index of this object among the parent's children. */
66 virtual sal_Int64 SAL_CALL
getAccessibleIndexInParent() override
;
69 The name of this class.
71 virtual OUString SAL_CALL
getImplementationName() override
;
74 The count of visible children.
76 virtual sal_Int64 SAL_CALL
getAccessibleChildCount() override
;
79 The XAccessible interface of the specified child.
81 virtual css::uno::Reference
< css::accessibility::XAccessible
> SAL_CALL
82 getAccessibleChild( sal_Int64 nChildIndex
) override
;
84 /** Return a bitset of states of the current object.
86 sal_Int64
implCreateStateSet() override
;
88 // XAccessible ------------------------------------------------------------
90 /** @return The XAccessibleContext interface of this object. */
91 virtual css::uno::Reference
< css::accessibility::XAccessibleContext
> SAL_CALL
92 getAccessibleContext() override
;
95 virtual sal_Int32 SAL_CALL
getCaretPosition() override
;
96 virtual sal_Bool SAL_CALL
setCaretPosition( sal_Int32 nIndex
) override
;
97 virtual sal_Unicode SAL_CALL
getCharacter( sal_Int32 nIndex
) override
;
98 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
getCharacterAttributes( sal_Int32 nIndex
, const css::uno::Sequence
< OUString
>& aRequestedAttributes
) override
;
99 virtual css::awt::Rectangle SAL_CALL
getCharacterBounds( sal_Int32 nIndex
) override
;
100 virtual sal_Int32 SAL_CALL
getCharacterCount() override
;
101 virtual sal_Int32 SAL_CALL
getIndexAtPoint( const css::awt::Point
& aPoint
) override
;
102 virtual OUString SAL_CALL
getSelectedText() override
;
103 virtual sal_Int32 SAL_CALL
getSelectionStart() override
;
104 virtual sal_Int32 SAL_CALL
getSelectionEnd() override
;
105 virtual sal_Bool SAL_CALL
setSelection( sal_Int32 nStartIndex
, sal_Int32 nEndIndex
) override
;
106 virtual OUString SAL_CALL
getText() final override
;
107 virtual OUString SAL_CALL
getTextRange( sal_Int32 nStartIndex
, sal_Int32 nEndIndex
) override
;
108 virtual css::accessibility::TextSegment SAL_CALL
getTextAtIndex( sal_Int32 nIndex
, sal_Int16 aTextType
) override
;
109 virtual css::accessibility::TextSegment SAL_CALL
getTextBeforeIndex( sal_Int32 nIndex
, sal_Int16 aTextType
) override
;
110 virtual css::accessibility::TextSegment SAL_CALL
getTextBehindIndex( sal_Int32 nIndex
, sal_Int16 aTextType
) override
;
111 virtual sal_Bool SAL_CALL
copyText( sal_Int32 nStartIndex
, sal_Int32 nEndIndex
) override
;
112 virtual sal_Bool SAL_CALL
scrollSubstringTo( sal_Int32 nStartIndex
, sal_Int32 nEndIndex
, css::accessibility::AccessibleScrollType aScrollType
) override
;
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */