Coverage Report

Created: 2025-07-07 10:01

/src/libreoffice/vcl/inc/accessibility/vclxaccessibletabpage.hxx
Line
Count
Source (jump to first uncovered line)
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
#pragma once
21
22
#include <com/sun/star/accessibility/XAccessible.hpp>
23
#include <com/sun/star/lang/XServiceInfo.hpp>
24
#include <comphelper/accessibletexthelper.hxx>
25
#include <cppuhelper/implbase.hxx>
26
#include <vcl/vclptr.hxx>
27
28
29
class TabControl;
30
31
class VCLXAccessibleTabPage final
32
    : public cppu::ImplInheritanceHelper<comphelper::OAccessibleTextHelper, css::lang::XServiceInfo>
33
{
34
    friend class VCLXAccessibleTabControl;
35
36
private:
37
    VclPtr<TabControl>      m_pTabControl;
38
    sal_uInt16              m_nPageId;
39
    bool                    m_bFocused;
40
    bool                    m_bSelected;
41
    OUString                m_sPageText;
42
43
    sal_Int64 implGetAccessibleChildCount();
44
45
    bool                    IsFocused() const;
46
    bool                    IsSelected() const;
47
48
    void                    SetFocused( bool bFocused );
49
    void                    SetSelected( bool bSelected );
50
    void                    SetPageText( const OUString& sPageText );
51
    OUString                GetPageText();
52
53
    void                    Update( bool bNew );
54
55
0
    sal_uInt16              GetPageId() const { return m_nPageId; }
56
57
    void            FillAccessibleStateSet( sal_Int64& rStateSet );
58
59
    // OAccessible
60
    virtual css::awt::Rectangle implGetBounds(  ) override;
61
62
    // OCommonAccessibleText
63
    virtual OUString                        implGetText() override;
64
    virtual css::lang::Locale  implGetLocale() override;
65
    virtual void                            implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override;
66
67
    // XComponent
68
    virtual void SAL_CALL   disposing() override;
69
70
public:
71
    VCLXAccessibleTabPage( TabControl* pTabControl, sal_uInt16 nPageId );
72
    virtual ~VCLXAccessibleTabPage() override;
73
74
    // XServiceInfo
75
    virtual OUString SAL_CALL getImplementationName() override;
76
    virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) override;
77
    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
78
79
    // XAccessibleContext
80
    virtual sal_Int64 SAL_CALL getAccessibleChildCount(  ) override;
81
    virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
82
    virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent(  ) override;
83
    virtual sal_Int64 SAL_CALL getAccessibleIndexInParent(  ) override;
84
    virtual sal_Int16 SAL_CALL getAccessibleRole(  ) override;
85
    virtual OUString SAL_CALL getAccessibleDescription(  ) override;
86
    virtual OUString SAL_CALL getAccessibleName(  ) override;
87
    virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) override;
88
    virtual sal_Int64 SAL_CALL getAccessibleStateSet(  ) override;
89
    virtual css::lang::Locale SAL_CALL getLocale(  ) override;
90
91
    // XAccessibleComponent
92
    virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
93
    virtual void SAL_CALL grabFocus(  ) override;
94
    virtual sal_Int32 SAL_CALL getForeground(  ) override;
95
    virtual sal_Int32 SAL_CALL getBackground(  ) override;
96
97
    // XAccessibleText
98
    virtual OUString SAL_CALL getText() override;
99
    virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) override;
100
    virtual sal_Int32 SAL_CALL getCharacterCount() override;
101
    virtual sal_Int32 SAL_CALL getCaretPosition() override;
102
    virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) override;
103
    virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) override;
104
    virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) override;
105
    virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override;
106
    virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
107
    virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
108
    virtual OUString SAL_CALL getTextRange(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override;
109
    virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override;
110
};
111
112
113
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */