Branch data Line data Source code
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 : : #ifndef ACCESSIBILITY_EXT_ACCESSIBLETABLISTBOXTABLE_HXX
21 : : #define ACCESSIBILITY_EXT_ACCESSIBLETABLISTBOXTABLE_HXX
22 : :
23 : : #include "AccessibleBrowseBoxTable.hxx"
24 : : #include <comphelper/uno3.hxx>
25 : : #include <cppuhelper/implbase1.hxx>
26 : : #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
27 : :
28 : : class SvHeaderTabListBox;
29 : :
30 : : // ============================================================================
31 : :
32 : : namespace accessibility {
33 : :
34 : : typedef ::cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessibleSelection >
35 : : AccessibleTabListBoxTableImplHelper;
36 : :
37 : : class AccessibleTabListBoxTable : public AccessibleBrowseBoxTable, public AccessibleTabListBoxTableImplHelper
38 : : {
39 : : private:
40 : : SvHeaderTabListBox* m_pTabListBox;
41 : :
42 : : void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
43 : : DECL_LINK( WindowEventListener, VclSimpleEvent* );
44 : :
45 : : // helpers ----------------------------------------------------------------
46 : :
47 : : /** Throws an exception, if nIndex is not a valid child index. */
48 : : void ensureValidIndex( sal_Int32 _nIndex ) const
49 : : SAL_THROW( ( ::com::sun::star::lang::IndexOutOfBoundsException ) );
50 : :
51 : : /** Returns true, if the specified row is selected. */
52 : : sal_Bool implIsRowSelected( sal_Int32 _nRow ) const;
53 : : /** Selects the specified row. */
54 : : void implSelectRow( sal_Int32 _nRow, sal_Bool _bSelect );
55 : :
56 : : /** Returns the count of rows in the table. */
57 : : sal_Int32 implGetRowCount() const;
58 : : /** Returns the total column count in the table. */
59 : : sal_Int32 implGetColumnCount() const;
60 : : /** Returns the count of selected rows in the table. */
61 : : sal_Int32 implGetSelRowCount() const;
62 : : /** Returns the total cell count in the table (including header). */
63 : 0 : inline sal_Int32 implGetCellCount() const { return implGetRowCount() * implGetColumnCount(); }
64 : :
65 : : /** Returns the row index from cell index. */
66 : 0 : inline sal_Int32 implGetRow( sal_Int32 _nIndex ) const { return _nIndex / implGetColumnCount(); }
67 : : /** Returns the column index from cell index. */
68 : : inline sal_Int32 implGetColumn( sal_Int32 _nIndex ) const { return _nIndex % implGetColumnCount(); }
69 : : /** Returns the absolute row index of the nSelRow-th selected row. */
70 : : sal_Int32 implGetSelRow( sal_Int32 _nSelRow ) const;
71 : : /** Returns the child index from cell position. */
72 : : inline sal_Int32 implGetIndex( sal_Int32 _nRow, sal_Int32 _nColumn ) const { return _nRow * implGetColumnCount() + _nColumn; }
73 : :
74 : : public:
75 : : /** ctor()
76 : : @param rxParent XAccessible interface of the parent object.
77 : : @param rBox The HeaderTabListBox control. */
78 : : AccessibleTabListBoxTable(
79 : : const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent,
80 : : SvHeaderTabListBox& rBox );
81 : :
82 : : protected:
83 : : /** dtor() */
84 : : virtual ~AccessibleTabListBoxTable();
85 : :
86 : : public:
87 : : // XInterface
88 : : DECLARE_XINTERFACE( )
89 : :
90 : : // XTypeProvider
91 : : DECLARE_XTYPEPROVIDER( )
92 : :
93 : : // XServiceInfo
94 : : virtual ::rtl::OUString SAL_CALL getImplementationName (void)
95 : : throw (::com::sun::star::uno::RuntimeException);
96 : :
97 : : // XAccessibleSelection
98 : : void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
99 : : sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
100 : : void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException);
101 : : void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException);
102 : : sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
103 : : ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
104 : : void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
105 : : };
106 : :
107 : : // ============================================================================
108 : :
109 : : } // namespace accessibility
110 : :
111 : : // ============================================================================
112 : :
113 : : #endif // ACCESSIBILITY_EXT_ACCESSIBLETABLISTBOX_HXX
114 : :
115 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|