/src/libreoffice/vcl/inc/accessibility/accessibletablistboxtable.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 <com/sun/star/accessibility/XAccessibleSelection.hpp> |
23 | | #include <vcl/accessibility/AccessibleBrowseBoxTable.hxx> |
24 | | #include <vcl/vclptr.hxx> |
25 | | |
26 | | class SvHeaderTabListBox; |
27 | | |
28 | | class AccessibleTabListBoxTable final |
29 | | : public cppu::ImplInheritanceHelper<AccessibleBrowseBoxTable, |
30 | | css::accessibility::XAccessibleSelection> |
31 | | { |
32 | | private: |
33 | | VclPtr<SvHeaderTabListBox> m_pTabListBox; |
34 | | |
35 | | css::uno::Reference< css::accessibility::XAccessible > m_xCurChild; |
36 | | |
37 | | void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); |
38 | | DECL_LINK( WindowEventListener, VclWindowEvent&, void ); |
39 | | |
40 | | // helpers ---------------------------------------------------------------- |
41 | | |
42 | | /** Throws an exception, if nIndex is not a valid child index. */ |
43 | | void ensureValidIndex( sal_Int64 _nIndex ) const; |
44 | | |
45 | | /** Selects the specified row. */ |
46 | | void implSelectRow( sal_Int32 _nRow, bool _bSelect ); |
47 | | |
48 | | /** Returns the count of rows in the table. */ |
49 | | sal_Int32 implGetRowCount() const override; |
50 | | /** Returns the total column count in the table. */ |
51 | | sal_Int32 implGetColumnCount() const override; |
52 | | /** Returns the count of selected rows in the table. */ |
53 | | sal_Int32 implGetSelRowCount() const; |
54 | | |
55 | | /** Returns the row index from cell index. */ |
56 | | sal_Int32 implGetRow( sal_Int64 _nIndex ) const |
57 | 0 | { |
58 | 0 | auto nColCount = implGetColumnCount(); |
59 | | assert(nColCount != 0); |
60 | 0 | return _nIndex / nColCount; |
61 | 0 | } |
62 | | |
63 | | /** Returns the absolute row index of the nSelRow-th selected row. */ |
64 | | sal_Int32 implGetSelRow( sal_Int32 _nSelRow ) const; |
65 | | |
66 | | public: |
67 | | /** ctor() |
68 | | @param rxParent XAccessible interface of the parent object. |
69 | | @param rBox The HeaderTabListBox control. */ |
70 | | AccessibleTabListBoxTable(const rtl::Reference<comphelper::OAccessible>& rpParent, |
71 | | SvHeaderTabListBox& rBox); |
72 | | |
73 | | private: |
74 | | /** dtor() */ |
75 | | virtual ~AccessibleTabListBoxTable() override; |
76 | | |
77 | | public: |
78 | | // XAccessibleSelection |
79 | | void SAL_CALL selectAccessibleChild( sal_Int64 nChildIndex ) override; |
80 | | sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int64 nChildIndex ) override; |
81 | | void SAL_CALL clearAccessibleSelection( ) override; |
82 | | void SAL_CALL selectAllAccessibleChildren( ) override; |
83 | | sal_Int64 SAL_CALL getSelectedAccessibleChildCount( ) override; |
84 | | css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override; |
85 | | void SAL_CALL deselectAccessibleChild( sal_Int64 nSelectedChildIndex ) override; |
86 | | }; |
87 | | |
88 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |