LibreOffice Module accessibility (master) 1
accessibletabbarbase.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
21#ifndef ACCESSIBILITY_EXT_ACCESSIBLETABBARPAGELIST
23#endif
24#include <svtools/tabbar.hxx>
25#include <vcl/vclevent.hxx>
26
27
28namespace accessibility
29{
30
31
33 m_pTabBar( nullptr )
34{
35 SetTabBarPointer( pTabBar );
36}
37
39{
41}
42
43IMPL_LINK( AccessibleTabBarBase, WindowEventListener, VclWindowEvent&, rEvent, void )
44{
45 vcl::Window* pEventWindow = rEvent.GetWindow();
46 OSL_ENSURE( pEventWindow, "AccessibleTabBarBase::WindowEventListener: no window!" );
47
48 if( ( rEvent.GetId() == VclEventId::TabbarPageRemoved ) &&
49 ( static_cast<sal_uInt16>(reinterpret_cast<sal_IntPtr>(rEvent.GetData())) == TabBar::PAGE_NOT_FOUND ) &&
50 (dynamic_cast<AccessibleTabBarPageList *>(this) == nullptr))
51 {
52 return;
53 }
54
55 if ( !pEventWindow->IsAccessibilityEventsSuppressed() || (rEvent.GetId() == VclEventId::ObjectDying) )
56 ProcessWindowEvent( rEvent );
57}
58
60{
61 if( rVclWindowEvent.GetId() == VclEventId::ObjectDying )
63}
64
65// XComponent
66
68{
69 OAccessibleExtendedComponentHelper::disposing();
71}
72
73// private
74
76{
77 OSL_ENSURE( !m_pTabBar, "AccessibleTabBarBase::SetTabBarPointer - multiple call" );
78 m_pTabBar = pTabBar;
79 if( m_pTabBar )
80 m_pTabBar->AddEventListener( LINK( this, AccessibleTabBarBase, WindowEventListener ) );
81}
82
84{
85 if( m_pTabBar )
86 {
87 m_pTabBar->RemoveEventListener( LINK( this, AccessibleTabBarBase, WindowEventListener ) );
88 m_pTabBar = nullptr;
89 }
90}
91
92
93} // namespace accessibility
94
95
96/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static const sal_uInt16 PAGE_NOT_FOUND
VclEventId GetId() const
virtual void SAL_CALL disposing() override
virtual void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent)
bool IsAccessibilityEventsSuppressed(bool bTraverseParentPath=true)
IMPL_LINK(AccessibleDocumentViewBase, WindowChildEventListener, VclWindowEvent &, rEvent, void)