LibreOffice Module accessibility (master) 1
accessibletablistbox.cxx
Go to the documentation of this file.
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
23#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
24
25namespace accessibility
26{
27
28
29 // class AccessibleTabListBox -----------------------------------------------------
30
31 using namespace ::com::sun::star::accessibility;
32 using namespace ::com::sun::star::uno;
33 using namespace ::com::sun::star::lang;
34 using namespace ::com::sun::star;
35
36
37 // Ctor() and Dtor()
38
40 :AccessibleBrowseBox( rxParent, nullptr, rBox )
41 ,m_pTabListBox( &rBox )
42 {
43 osl_atomic_increment( &m_refCount );
44 {
45 setCreator( this );
46 }
47 osl_atomic_decrement( &m_refCount );
48 }
49
50
52 {
53 if ( isAlive() )
54 {
55 // increment ref count to prevent double call of Dtor
56 osl_atomic_increment( &m_refCount );
57 dispose();
58 }
59 }
60
62 {
63 return new AccessibleTabListBoxTable( this, *m_pTabListBox );
64 }
65
66 // XInterface -----------------------------------------------------------------
68
69 // XTypeProvider --------------------------------------------------------------
71
72 // XAccessibleContext ---------------------------------------------------------
73
74 sal_Int64 SAL_CALL AccessibleTabListBox::getAccessibleChildCount()
75 {
76 return 2; // header and table
77 }
78
80 {
81 return this;
82 }
83
86 {
87 SolarMethodGuard aGuard(getMutex());
89
90 if ( nChildIndex < 0 || nChildIndex > 1 )
91 throw IndexOutOfBoundsException();
92
94 if (nChildIndex == 0)
95 {
97 xRet = implGetHeaderBar( AccessibleBrowseBoxObjType::ColumnHeaderBar );
98 }
99 else if (nChildIndex == 1)
100 xRet = implGetTable();
101
102 if ( !xRet.is() )
103 throw RuntimeException("getAccessibleChild called with NULL xRet",getXWeak());
104
105 return xRet;
106 }
107
108
109}// namespace accessibility
110
111
112/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class represents the complete accessible BrowseBox object.
css::uno::Reference< css::accessibility::XAccessible > implGetTable()
This method creates (once) and returns the accessible data table child.
void setCreator(const css::uno::Reference< css::accessibility::XAccessible > &_rxCreator)
sets the XAccessible which created the context
css::uno::Reference< css::accessibility::XAccessible > implGetHeaderBar(AccessibleBrowseBoxObjType eObjType)
This method creates (once) and returns the specified header bar.
AccessibleTabListBox(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, SvHeaderTabListBox &rBox)
ctor()
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nChildIndex) override
css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
VclPtr< SvHeaderTabListBox > m_pTabListBox
virtual rtl::Reference< AccessibleBrowseBoxTable > createAccessibleTable() override
This method creates and returns an accessible table.
virtual ~AccessibleTabListBox() override
dtor()
ULONG m_refCount
IMPLEMENT_FORWARD_XTYPEPROVIDER2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
void dispose()