Coverage Report

Created: 2026-06-30 11:14

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