Avoid potential negative array index access to cached text.
[LibreOffice.git] / accessibility / inc / extended / AccessibleBrowseBoxTable.hxx
blob8892ff384e9ee15bcfd9ffb154f9be22f5437940
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
23 #include <extended/AccessibleBrowseBoxTableBase.hxx>
26 namespace accessibility {
28 /** This class represents the accessible object of the data table of a
29 BrowseBox control. */
30 class AccessibleBrowseBoxTable : public AccessibleBrowseBoxTableBase
32 friend class AccessibleBrowseBox; // to create header bars
34 public:
35 AccessibleBrowseBoxTable(
36 const css::uno::Reference< css::accessibility::XAccessible >& rxParent,
37 ::vcl::IAccessibleTableProvider& rBrowseBox );
39 protected:
40 virtual ~AccessibleBrowseBoxTable() override;
42 public:
43 // XAccessibleContext
45 /** @return The XAccessible interface of the specified child. */
46 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
47 getAccessibleChild( sal_Int64 nChildIndex ) override;
49 /** @return The index of this object among the parent's children. */
50 virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override;
52 // XAccessibleComponent
54 /** @return The accessible child rendered under the given point. */
55 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
56 getAccessibleAtPoint( const css::awt::Point& rPoint ) override;
58 /** Grabs the focus to (the current cell of) the data table. */
59 virtual void SAL_CALL grabFocus() override;
61 // XAccessibleTable
63 /** @return The description text of the specified row. */
64 virtual OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) override;
66 /** @return The description text of the specified column. */
67 virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) override;
69 /** @return The XAccessibleTable interface of the row header bar. */
70 virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL
71 getAccessibleRowHeaders() override;
73 /** @return The XAccessibleTable interface of the column header bar. */
74 virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL
75 getAccessibleColumnHeaders() override;
77 /** @return An index list of completely selected rows. */
78 virtual css::uno::Sequence< sal_Int32 > SAL_CALL
79 getSelectedAccessibleRows() override;
81 /** @return An index list of completely selected columns. */
82 virtual css::uno::Sequence< sal_Int32 > SAL_CALL
83 getSelectedAccessibleColumns() override;
85 /** @return TRUE, if the specified row is completely selected. */
86 virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) override;
88 /** @return TRUE, if the specified column is completely selected. */
89 virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) override;
91 /** @return The XAccessible interface of the cell object at the specified
92 cell position. */
93 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
94 getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
96 /** @return TRUE, if the specified cell is selected. */
97 virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) override;
99 // XServiceInfo
101 /** @return The name of this class. */
102 virtual OUString SAL_CALL getImplementationName() override;
104 protected:
105 // internal virtual methods
107 /** @attention This method requires locked mutex's and a living object.
108 @return The bounding box (VCL rect.) relative to the parent window. */
109 virtual tools::Rectangle implGetBoundingBox() override;
110 /** @attention This method requires locked mutex's and a living object.
111 @return The bounding box (VCL rect.) in screen coordinates. */
112 virtual AbsoluteScreenPixelRectangle implGetBoundingBoxOnScreen() override;
114 // internal helper methods
116 /** @attention This method requires a locked mutex.
117 @return The XAccessibleTable interface of the specified header bar.
118 @throws css::uno::RuntimeException
120 css::uno::Reference< css::accessibility::XAccessibleTable >
121 implGetHeaderBar( sal_Int32 nChildIndex );
125 } // namespace accessibility
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */