LCOV - code coverage report
Current view: top level - accessibility/source/extended - accessibletabbarbase.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 38 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 9 0.0 %
Legend: Lines: hit not hit

          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             : #include "accessibility/extended/accessibletabbarbase.hxx"
      21             : #ifndef ACCESSIBILITY_EXT_ACCESSIBLETABBARPAGELIST
      22             : #include "accessibility/extended/accessibletabbarpagelist.hxx"
      23             : #endif
      24             : #include <toolkit/helper/externallock.hxx>
      25             : #include <svtools/tabbar.hxx>
      26             : 
      27             : 
      28             : namespace accessibility
      29             : {
      30             : 
      31             : 
      32           0 : AccessibleTabBarBase::AccessibleTabBarBase( TabBar* pTabBar ) :
      33             :     AccessibleExtendedComponentHelper_BASE( new VCLExternalSolarLock() ),
      34           0 :     m_pTabBar( 0 )
      35             : {
      36           0 :     m_pExternalLock = static_cast< VCLExternalSolarLock* >( getExternalLock() );
      37           0 :     SetTabBarPointer( pTabBar );
      38           0 : }
      39             : 
      40           0 : AccessibleTabBarBase::~AccessibleTabBarBase()
      41             : {
      42           0 :     ClearTabBarPointer();
      43           0 :     DELETEZ( m_pExternalLock );
      44           0 : }
      45             : 
      46           0 : IMPL_LINK( AccessibleTabBarBase, WindowEventListener, VclSimpleEvent*, pEvent )
      47             : {
      48           0 :     VclWindowEvent* pWinEvent = dynamic_cast< VclWindowEvent* >( pEvent );
      49             :     OSL_ENSURE( pWinEvent, "AccessibleTabBarBase::WindowEventListener - unknown window event" );
      50           0 :     if( pWinEvent )
      51             :     {
      52           0 :         vcl::Window* pEventWindow = pWinEvent->GetWindow();
      53             :         OSL_ENSURE( pEventWindow, "AccessibleTabBarBase::WindowEventListener: no window!" );
      54             : 
      55           0 :         if( ( pWinEvent->GetId() == VCLEVENT_TABBAR_PAGEREMOVED ) &&
      56           0 :             ( (sal_uInt16)reinterpret_cast<sal_IntPtr>(pWinEvent->GetData()) == TabBar::PAGE_NOT_FOUND ) &&
      57           0 :             ( dynamic_cast< AccessibleTabBarPageList *> (this) != NULL ) )
      58             :         {
      59           0 :             return 0;
      60             :         }
      61             : 
      62           0 :         if ( !pEventWindow->IsAccessibilityEventsSuppressed() || (pWinEvent->GetId() == VCLEVENT_OBJECT_DYING) )
      63           0 :             ProcessWindowEvent( *pWinEvent );
      64             :     }
      65           0 :     return 0;
      66             : }
      67             : 
      68           0 : void AccessibleTabBarBase::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
      69             : {
      70           0 :     if( rVclWindowEvent.GetId() == VCLEVENT_OBJECT_DYING )
      71           0 :         ClearTabBarPointer();
      72           0 : }
      73             : 
      74             : // XComponent
      75             : 
      76           0 : void AccessibleTabBarBase::disposing()
      77             : {
      78           0 :     AccessibleExtendedComponentHelper_BASE::disposing();
      79           0 :     ClearTabBarPointer();
      80           0 : }
      81             : 
      82             : // private
      83             : 
      84           0 : void AccessibleTabBarBase::SetTabBarPointer( TabBar* pTabBar )
      85             : {
      86             :     OSL_ENSURE( !m_pTabBar, "AccessibleTabBarBase::SetTabBarPointer - multiple call" );
      87           0 :     m_pTabBar = pTabBar;
      88           0 :     if( m_pTabBar )
      89           0 :         m_pTabBar->AddEventListener( LINK( this, AccessibleTabBarBase, WindowEventListener ) );
      90           0 : }
      91             : 
      92           0 : void AccessibleTabBarBase::ClearTabBarPointer()
      93             : {
      94           0 :     if( m_pTabBar )
      95             :     {
      96           0 :         m_pTabBar->RemoveEventListener( LINK( this, AccessibleTabBarBase, WindowEventListener ) );
      97           0 :         m_pTabBar = 0;
      98             :     }
      99           0 : }
     100             : 
     101             : 
     102             : }   // namespace accessibility
     103             : 
     104             : 
     105             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11