Coverage Report

Created: 2025-12-31 10:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/toolkit/inc/controls/table/AccessibleGridControl.hxx
Line
Count
Source
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 "AccessibleGridControlBase.hxx"
23
#include "AccessibleGridControlTable.hxx"
24
#include "tablecontrol.hxx"
25
26
#include <cppuhelper/weakref.hxx>
27
#include <rtl/ref.hxx>
28
29
namespace accessibility {
30
31
    class AccessibleGridControlHeader;
32
33
34
/** This class represents the complete accessible Grid Control object. */
35
    class AccessibleGridControl final : public AccessibleGridControlBase
36
{
37
0
    virtual ~AccessibleGridControl() override = default;
38
39
    /** Cleans up members. */
40
    using AccessibleGridControlBase::disposing;
41
    virtual void SAL_CALL disposing() override;
42
43
    // XAccessibleContext -----------------------------------------------------
44
45
    /** @return  The count of visible children. */
46
    virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
47
48
    /** @return  The XAccessible interface of the specified child. */
49
    virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
50
    getAccessibleChild( sal_Int64 nChildIndex ) override;
51
52
    virtual sal_Int16 SAL_CALL getAccessibleRole() override;
53
54
    // XAccessibleComponent ---------------------------------------------------
55
56
    /** @return
57
            The accessible child rendered under the given point.
58
    */
59
    virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
60
    getAccessibleAtPoint( const css::awt::Point& rPoint ) override;
61
62
    /** Grabs the focus to the Grid Control. */
63
    virtual void SAL_CALL grabFocus() override;
64
65
    // XServiceInfo -----------------------------------------------------------
66
67
    /** @return
68
            The name of this class.
69
    */
70
    virtual OUString SAL_CALL getImplementationName() override;
71
72
public:
73
    AccessibleGridControl(
74
        const css::uno::Reference< css::accessibility::XAccessible >& _rxParent,
75
        svt::table::TableControl& _rTable);
76
77
    // helper functions
78
79
     /** commitCellEvent commit the event at all listeners of the table
80
         @param nEventId
81
             the event id
82
         @param rNewValue
83
             the new value
84
         @param rOldValue
85
             the old value
86
     */
87
     void commitCellEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue,
88
             const css::uno::Any& rOldValue);
89
90
     /** commitTableEvent commit the event at all listeners of the table
91
         @param nEventId
92
             the event id
93
         @param rNewValue
94
             the new value
95
         @param rOldValue
96
             the old value
97
     */
98
     void commitTableEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue,
99
             const css::uno::Any& rOldValue);
100
101
private:
102
    // internal virtual methods -----------------------------------------------
103
104
    /** @attention  This method requires locked mutex's and a living object.
105
        @return  The bounding box (VCL rect.) in screen coordinates. */
106
    virtual AbsoluteScreenPixelRectangle implGetBoundingBoxOnScreen() override;
107
108
    // internal helper methods ------------------------------------------------
109
110
    /** The data table child. */
111
    rtl::Reference<AccessibleGridControlTable>                m_xTable;
112
113
    /** The header bar for rows. */
114
    rtl::Reference<AccessibleGridControlHeader>               m_xRowHeaderBar;
115
116
    /** The header bar for columns (first row of the table). */
117
    rtl::Reference<AccessibleGridControlHeader>               m_xColumnHeaderBar;
118
119
    /** @return  The count of visible children. */
120
    inline sal_Int64 implGetAccessibleChildCount();
121
};
122
123
} // namespace accessibility
124
125
126
127
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */