/src/libreoffice/vcl/source/accessibility/accessibletablistbox.cxx
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 | | #include <accessibility/accessibletablistbox.hxx> |
21 | | #include <accessibility/accessibletablistboxtable.hxx> |
22 | | #include <vcl/toolkit/svtabbx.hxx> |
23 | | #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> |
24 | | |
25 | | // class AccessibleTabListBox ----------------------------------------------------- |
26 | | |
27 | | using namespace ::com::sun::star::accessibility; |
28 | | using namespace ::com::sun::star::uno; |
29 | | using namespace ::com::sun::star::lang; |
30 | | using namespace ::com::sun::star; |
31 | | |
32 | | |
33 | | // Ctor() and Dtor() |
34 | | |
35 | | AccessibleTabListBox::AccessibleTabListBox(const rtl::Reference<comphelper::OAccessible>& rpParent, |
36 | | SvHeaderTabListBox& rBox) |
37 | 0 | : AccessibleBrowseBox(rpParent, rBox) |
38 | 0 | , m_pTabListBox(&rBox) |
39 | 0 | { |
40 | 0 | } |
41 | | |
42 | | |
43 | | AccessibleTabListBox::~AccessibleTabListBox() |
44 | 0 | { |
45 | 0 | if ( isAlive() ) |
46 | 0 | { |
47 | | // increment ref count to prevent double call of Dtor |
48 | 0 | osl_atomic_increment( &m_refCount ); |
49 | 0 | dispose(); |
50 | 0 | } |
51 | 0 | } |
52 | | |
53 | | rtl::Reference<AccessibleBrowseBoxTable> AccessibleTabListBox::createAccessibleTable() |
54 | 0 | { |
55 | 0 | return new AccessibleTabListBoxTable( this, *m_pTabListBox ); |
56 | 0 | } |
57 | | |
58 | | // XAccessibleContext --------------------------------------------------------- |
59 | | |
60 | | sal_Int64 SAL_CALL AccessibleTabListBox::getAccessibleChildCount() |
61 | 0 | { |
62 | | // only the table; header is handled by HeaderBar (which is a sibling of the SvHeaderTabListBox) |
63 | 0 | return 1; |
64 | 0 | } |
65 | | |
66 | | Reference< XAccessible > SAL_CALL |
67 | | AccessibleTabListBox::getAccessibleChild( sal_Int64 nChildIndex ) |
68 | 0 | { |
69 | 0 | SolarMethodGuard aGuard(getMutex()); |
70 | 0 | ensureIsAlive(); |
71 | |
|
72 | 0 | if (nChildIndex != 0) |
73 | 0 | throw IndexOutOfBoundsException(); |
74 | | |
75 | 0 | return getTable(); |
76 | 0 | } |
77 | | |
78 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |