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 .
20 #ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENUITEM_HXX
21 #define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENUITEM_HXX
23 #include <standard/accessiblemenuitemcomponent.hxx>
25 #include <com/sun/star/accessibility/XAccessibleAction.hpp>
26 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
28 #include <cppuhelper/implbase3.hxx>
29 #include <comphelper/accessibletexthelper.hxx>
32 // class VCLXAccessibleMenuItem
35 typedef ::cppu::ImplHelper3
<
36 css::accessibility::XAccessibleText
,
37 css::accessibility::XAccessibleAction
,
38 css::accessibility::XAccessibleValue
> VCLXAccessibleMenuItem_BASE
;
40 class VCLXAccessibleMenuItem
: public OAccessibleMenuItemComponent
,
41 public ::comphelper::OCommonAccessibleText
,
42 public VCLXAccessibleMenuItem_BASE
45 virtual bool IsFocused() override
;
46 virtual bool IsSelected() override
;
47 virtual bool IsChecked() override
;
49 virtual bool IsHighlighted() override
;
51 virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper
& rStateSet
) override
;
53 // OCommonAccessibleText
54 virtual OUString
implGetText() final override
;
55 virtual css::lang::Locale
implGetLocale() override
;
56 virtual void implGetSelection( sal_Int32
& nStartIndex
, sal_Int32
& nEndIndex
) override final
;
59 VCLXAccessibleMenuItem( Menu
* pParent
, sal_uInt16 nItemPos
, Menu
* pMenu
= nullptr );
65 DECLARE_XTYPEPROVIDER()
68 virtual OUString SAL_CALL
getImplementationName() override
;
69 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
72 virtual sal_Int16 SAL_CALL
getAccessibleRole( ) override
;
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
) final 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() final override
;
81 virtual sal_Int32 SAL_CALL
getIndexAtPoint( const css::awt::Point
& aPoint
) override
;
82 virtual OUString SAL_CALL
getSelectedText() override final
;
83 virtual sal_Int32 SAL_CALL
getSelectionStart() override final
;
84 virtual sal_Int32 SAL_CALL
getSelectionEnd() override final
;
85 virtual sal_Bool SAL_CALL
setSelection( sal_Int32 nStartIndex
, sal_Int32 nEndIndex
) override
;
86 virtual OUString SAL_CALL
getText() final 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
;
94 virtual sal_Int32 SAL_CALL
getAccessibleActionCount( ) final override
;
95 virtual sal_Bool SAL_CALL
doAccessibleAction ( sal_Int32 nIndex
) override
;
96 virtual OUString SAL_CALL
getAccessibleActionDescription ( sal_Int32 nIndex
) override
;
97 virtual css::uno::Reference
< css::accessibility::XAccessibleKeyBinding
> SAL_CALL
getAccessibleActionKeyBinding( sal_Int32 nIndex
) override
;
100 virtual css::uno::Any SAL_CALL
getCurrentValue( ) override
;
101 virtual sal_Bool SAL_CALL
setCurrentValue( const css::uno::Any
& aNumber
) override
;
102 virtual css::uno::Any SAL_CALL
getMaximumValue( ) override
;
103 virtual css::uno::Any SAL_CALL
getMinimumValue( ) override
;
106 #endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENUITEM_HXX
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */