LCOV - code coverage report
Current view: top level - sfx2/source/statbar - stbitem.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 142 223 63.7 %
Date: 2014-11-03 Functions: 14 32 43.8 %
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 <svl/stritem.hxx>
      21             : #include <com/sun/star/util/URL.hpp>
      22             : #include <com/sun/star/util/URLTransformer.hpp>
      23             : #include <com/sun/star/util/XURLTransformer.hpp>
      24             : #include <com/sun/star/frame/XController.hpp>
      25             : #include <com/sun/star/lang/XUnoTunnel.hpp>
      26             : #include <com/sun/star/frame/status/ItemStatus.hpp>
      27             : #include <com/sun/star/frame/status/ItemState.hpp>
      28             : #include <com/sun/star/awt/MouseButton.hpp>
      29             : 
      30             : #include <vcl/status.hxx>
      31             : 
      32             : #include <sfx2/app.hxx>
      33             : #include <sfx2/stbitem.hxx>
      34             : #include "sfxtypes.hxx"
      35             : #include <sfx2/msg.hxx>
      36             : #include <sfx2/bindings.hxx>
      37             : #include <sfx2/msgpool.hxx>
      38             : #include <sfx2/module.hxx>
      39             : #include <sfx2/dispatch.hxx>
      40             : #include <sfx2/unoctitm.hxx>
      41             : #include <sfx2/objsh.hxx>
      42             : #include <sfx2/sfx.hrc>
      43             : 
      44             : #include <comphelper/processfactory.hxx>
      45             : #include <svl/eitem.hxx>
      46             : #include <svl/intitem.hxx>
      47             : #include <toolkit/helper/vclunohelper.hxx>
      48             : #include <toolkit/helper/convert.hxx>
      49             : 
      50             : using namespace ::com::sun::star;
      51             : 
      52             : 
      53             : 
      54           0 : sal_uInt16 SfxStatusBarControl::convertAwtToVCLMouseButtons( sal_Int16 nAwtMouseButtons )
      55             : {
      56           0 :     sal_uInt16 nVCLMouseButtons( 0 );
      57             : 
      58           0 :     if ( nAwtMouseButtons & awt::MouseButton::LEFT )
      59           0 :         nVCLMouseButtons |= MOUSE_LEFT;
      60           0 :     if ( nAwtMouseButtons & awt::MouseButton::RIGHT )
      61           0 :         nVCLMouseButtons |= MOUSE_RIGHT;
      62           0 :     if ( nAwtMouseButtons & awt::MouseButton::MIDDLE )
      63           0 :         nVCLMouseButtons |= MOUSE_MIDDLE;
      64             : 
      65           0 :     return nVCLMouseButtons;
      66             : }
      67             : 
      68             : 
      69             : 
      70       15036 : svt::StatusbarController* SAL_CALL SfxStatusBarControllerFactory(
      71             :     const uno::Reference< frame::XFrame >& rFrame,
      72             :     StatusBar* pStatusBar,
      73             :     unsigned short nID,
      74             :     const OUString& aCommandURL )
      75             : {
      76       15036 :     SolarMutexGuard aGuard;
      77             : 
      78       30072 :     util::URL aTargetURL;
      79       15036 :     aTargetURL.Complete = aCommandURL;
      80       30072 :     uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
      81       15036 :     xTrans->parseStrict( aTargetURL );
      82             : 
      83       15036 :     SfxObjectShell* pObjShell = NULL;
      84       30072 :     uno::Reference < frame::XController > xController;
      85       30072 :     uno::Reference < frame::XModel > xModel;
      86       15036 :     if ( rFrame.is() )
      87             :     {
      88       15036 :         xController = rFrame->getController();
      89       15036 :         if ( xController.is() )
      90       15036 :             xModel = xController->getModel();
      91             :     }
      92             : 
      93       15036 :     if ( xModel.is() )
      94             :     {
      95             :         // Get tunnel from model to retrieve the SfxObjectShell pointer from it
      96       15036 :         ::com::sun::star::uno::Reference < ::com::sun::star::lang::XUnoTunnel > xObj( xModel, uno::UNO_QUERY );
      97       30072 :         ::com::sun::star::uno::Sequence < sal_Int8 > aSeq = SvGlobalName( SFX_GLOBAL_CLASSID ).GetByteSequence();
      98       15036 :         if ( xObj.is() )
      99             :         {
     100       15028 :             sal_Int64 nHandle = xObj->getSomething( aSeq );
     101       15028 :             if ( nHandle )
     102       14960 :                         pObjShell = reinterpret_cast< SfxObjectShell* >( sal::static_int_cast< sal_IntPtr >( nHandle ));
     103       15036 :         }
     104             :     }
     105             : 
     106       15036 :     SfxModule*     pModule   = pObjShell ? pObjShell->GetModule() : NULL;
     107       15036 :     SfxSlotPool*   pSlotPool = 0;
     108             : 
     109       15036 :     if ( pModule )
     110       14960 :         pSlotPool = pModule->GetSlotPool();
     111             :     else
     112          76 :         pSlotPool = &(SfxSlotPool::GetSlotPool( NULL ));
     113             : 
     114       15036 :     const SfxSlot* pSlot = pSlotPool->GetUnoSlot( aTargetURL.Path );
     115       15036 :     if ( pSlot )
     116             :     {
     117       14994 :         sal_uInt16 nSlotId = pSlot->GetSlotId();
     118       14994 :         if ( nSlotId > 0 )
     119             :         {
     120       14994 :             OString aCmd(".uno:");
     121       14994 :             aCmd += pSlot->GetUnoName();
     122       14994 :             pStatusBar->SetHelpId( nSlotId, aCmd );
     123       14994 :             return SfxStatusBarControl::CreateControl( nSlotId, nID, pStatusBar, pModule );
     124             :         }
     125             :     }
     126             : 
     127       15078 :     return NULL;
     128             : }
     129             : 
     130             : 
     131             : 
     132       12544 : SfxStatusBarControl::SfxStatusBarControl
     133             : (
     134             :     sal_uInt16      nSlotID,            /* Slot-Id which is connected to this
     135             :                                        instance. If a Slot-Id is set to != 0 at
     136             :                                        registration it will always be set there.
     137             :                                     */
     138             : 
     139             : 
     140             :     sal_uInt16      nCtrlID,            /* ID of this controller in the status bar */
     141             : 
     142             :     StatusBar&  rBar                /* Reference to the StatusBar,for which
     143             :                                        this Control was created. */
     144             : )
     145             : 
     146             : 
     147             : /*  [Description]
     148             : 
     149             :     Constructor of the SfxStatusBarControl Class. The Subclasses are
     150             :     created at the Factory if necessary.
     151             : 
     152             :     Instances of this base class are created for all StatusBar-fields
     153             :     for which no specific ones have been registered.
     154             : */
     155             : 
     156             : :   svt::StatusbarController(),
     157             :     nSlotId( nSlotID ),
     158             :     nId( nCtrlID ),
     159       12544 :     pBar( &rBar )
     160             : {
     161       12544 : }
     162             : 
     163             : 
     164             : 
     165       12544 : SfxStatusBarControl::~SfxStatusBarControl()
     166             : 
     167             : /*  [Description]
     168             : 
     169             :     Destructor of the SfxStatusBarControl Class. The Class and its Subclasses
     170             :     are destroyed by SFx.
     171             : */
     172             : 
     173       12544 : {}
     174             : 
     175             : 
     176             : // XInterface
     177       50176 : uno::Any SAL_CALL SfxStatusBarControl::queryInterface( const uno::Type & rType )
     178             : throw( uno::RuntimeException, std::exception)
     179             : {
     180       50176 :     return svt::StatusbarController::queryInterface( rType );
     181             : }
     182             : 
     183      199170 : void SAL_CALL SfxStatusBarControl::acquire() throw()
     184             : {
     185      199170 :     OWeakObject::acquire();
     186      199170 : }
     187             : 
     188      199170 : void SAL_CALL SfxStatusBarControl::release() throw()
     189             : {
     190      199170 :     OWeakObject::release();
     191      199170 : }
     192             : 
     193             : 
     194             : // XEventListener
     195           0 : void SAL_CALL SfxStatusBarControl::disposing( const lang::EventObject& aEvent )
     196             : throw( uno::RuntimeException, std::exception )
     197             : {
     198           0 :     svt::StatusbarController::disposing( aEvent );
     199           0 : }
     200             : 
     201             : 
     202             : // XComponent
     203       12544 : void SAL_CALL SfxStatusBarControl::dispose()
     204             : throw (uno::RuntimeException, std::exception)
     205             : {
     206       12544 :     svt::StatusbarController::dispose();
     207       12544 : }
     208             : 
     209             : 
     210             : // XStatusListener
     211       18372 : void SAL_CALL SfxStatusBarControl::statusChanged( const frame::FeatureStateEvent& rEvent )
     212             : throw ( ::com::sun::star::uno::RuntimeException, std::exception )
     213             : {
     214       18372 :     SfxViewFrame* pViewFrame = NULL;
     215       18372 :     uno::Reference < frame::XController > xController;
     216             : 
     217       36744 :     SolarMutexGuard aGuard;
     218       18372 :     if ( m_xFrame.is() )
     219       18372 :         xController = m_xFrame->getController();
     220             : 
     221       36744 :     uno::Reference < frame::XDispatchProvider > xProvider( xController, uno::UNO_QUERY );
     222       18372 :     if ( xProvider.is() )
     223             :     {
     224       18372 :         uno::Reference < frame::XDispatch > xDisp = xProvider->queryDispatch( rEvent.FeatureURL, OUString(), 0 );
     225       18372 :         if ( xDisp.is() )
     226             :         {
     227       18372 :             uno::Reference< lang::XUnoTunnel > xTunnel( xDisp, uno::UNO_QUERY );
     228       18372 :             SfxOfficeDispatch* pDisp = NULL;
     229       18372 :             if ( xTunnel.is() )
     230             :             {
     231       18372 :                 sal_Int64 nImplementation = xTunnel->getSomething(SfxOfficeDispatch::impl_getStaticIdentifier());
     232       18372 :                 pDisp = reinterpret_cast< SfxOfficeDispatch* >(sal::static_int_cast< sal_IntPtr >( nImplementation ));
     233             :             }
     234             : 
     235       18372 :             if ( pDisp )
     236       18372 :                 pViewFrame = pDisp->GetDispatcher_Impl()->GetFrame();
     237       18372 :         }
     238             :     }
     239             : 
     240       18372 :     sal_uInt16 nSlotID = 0;
     241       18372 :     SfxSlotPool& rPool = SfxSlotPool::GetSlotPool( pViewFrame );
     242       18372 :     const SfxSlot* pSlot = rPool.GetUnoSlot( rEvent.FeatureURL.Path );
     243       18372 :     if ( pSlot )
     244       18372 :         nSlotID = pSlot->GetSlotId();
     245             : 
     246       18372 :     if ( nSlotID > 0 )
     247             :     {
     248       18372 :         if ( rEvent.Requery )
     249           0 :             svt::StatusbarController::statusChanged( rEvent );
     250             :         else
     251             :         {
     252       18372 :             SfxItemState eState = SfxItemState::DISABLED;
     253       18372 :             SfxPoolItem* pItem = NULL;
     254       18372 :             if ( rEvent.IsEnabled )
     255             :             {
     256       17485 :                 eState = SfxItemState::DEFAULT;
     257       17485 :                 uno::Type pType = rEvent.State.getValueType();
     258             : 
     259       17485 :                 if ( pType == ::getVoidCppuType() )
     260             :                 {
     261        3896 :                     pItem = new SfxVoidItem( nSlotID );
     262        3896 :                     eState = SfxItemState::UNKNOWN;
     263             :                 }
     264       13589 :                 else if ( pType == ::getBooleanCppuType() )
     265             :                 {
     266        2755 :                     bool bTemp = false;
     267        2755 :                     rEvent.State >>= bTemp ;
     268        2755 :                     pItem = new SfxBoolItem( nSlotID, bTemp );
     269             :                 }
     270       10834 :                 else if ( pType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() )
     271             :                 {
     272           0 :                     sal_uInt16 nTemp = 0;
     273           0 :                     rEvent.State >>= nTemp ;
     274           0 :                     pItem = new SfxUInt16Item( nSlotID, nTemp );
     275             :                 }
     276       10834 :                 else if ( pType == cppu::UnoType<sal_uInt32>::get() )
     277             :                 {
     278           0 :                     sal_uInt32 nTemp = 0;
     279           0 :                     rEvent.State >>= nTemp ;
     280           0 :                     pItem = new SfxUInt32Item( nSlotID, nTemp );
     281             :                 }
     282       10834 :                 else if ( pType == cppu::UnoType<OUString>::get() )
     283             :                 {
     284        2865 :                     OUString sTemp ;
     285        2865 :                     rEvent.State >>= sTemp ;
     286        2865 :                     pItem = new SfxStringItem( nSlotID, sTemp );
     287             :                 }
     288        7969 :                 else if ( pType == cppu::UnoType< ::com::sun::star::frame::status::ItemStatus>::get() )
     289             :                 {
     290           0 :                     frame::status::ItemStatus aItemStatus;
     291           0 :                     rEvent.State >>= aItemStatus;
     292           0 :                     eState = (SfxItemState) aItemStatus.State;
     293           0 :                     pItem = new SfxVoidItem( nSlotID );
     294             :                 }
     295             :                 else
     296             :                 {
     297        7969 :                     if ( pSlot )
     298        7969 :                         pItem = pSlot->GetType()->CreateItem();
     299        7969 :                     if ( pItem )
     300             :                     {
     301        7969 :                         pItem->SetWhich( nSlotID );
     302        7969 :                         pItem->PutValue( rEvent.State );
     303             :                     }
     304             :                     else
     305           0 :                         pItem = new SfxVoidItem( nSlotID );
     306       17485 :                 }
     307             :             }
     308             : 
     309       18372 :             StateChanged( nSlotID, eState, pItem );
     310       18372 :             delete pItem;
     311             :         }
     312       18372 :     }
     313       18372 : }
     314             : 
     315             : 
     316             : // XStatusbarController
     317             : 
     318           0 : sal_Bool SAL_CALL SfxStatusBarControl::mouseButtonDown(
     319             :     const awt::MouseEvent& rMouseEvent )
     320             : throw ( uno::RuntimeException, std::exception )
     321             : {
     322           0 :     SolarMutexGuard aGuard;
     323           0 :     ::Point aPos( rMouseEvent.X, rMouseEvent.Y );
     324             : 
     325             :     ::MouseEvent aMouseEvent( aPos,
     326             :                               (sal_uInt16)rMouseEvent.ClickCount,
     327             :                               0,
     328           0 :                               convertAwtToVCLMouseButtons( rMouseEvent.Buttons ),
     329           0 :                               0 );
     330             : 
     331           0 :     return MouseButtonDown( aMouseEvent );
     332             : }
     333             : 
     334             : 
     335             : 
     336           0 : sal_Bool SAL_CALL SfxStatusBarControl::mouseMove(
     337             :     const awt::MouseEvent& rMouseEvent )
     338             : throw (uno::RuntimeException, std::exception)
     339             : {
     340           0 :     SolarMutexGuard aGuard;
     341           0 :     ::Point aPos( rMouseEvent.X, rMouseEvent.Y );
     342             : 
     343             :     ::MouseEvent aMouseEvent( aPos,
     344             :                               (sal_uInt16)rMouseEvent.ClickCount,
     345             :                               0,
     346           0 :                               convertAwtToVCLMouseButtons( rMouseEvent.Buttons ),
     347           0 :                               0 );
     348           0 :     return MouseMove( aMouseEvent );
     349             : }
     350             : 
     351             : 
     352             : 
     353           0 : sal_Bool SAL_CALL SfxStatusBarControl::mouseButtonUp(
     354             :     const ::awt::MouseEvent& rMouseEvent )
     355             : throw ( uno::RuntimeException, std::exception )
     356             : {
     357           0 :     SolarMutexGuard aGuard;
     358           0 :     ::Point aPos( rMouseEvent.X, rMouseEvent.Y );
     359             : 
     360             :     ::MouseEvent aMouseEvent( aPos,
     361             :                               (sal_uInt16)rMouseEvent.ClickCount,
     362             :                               0,
     363           0 :                               convertAwtToVCLMouseButtons( rMouseEvent.Buttons ),
     364           0 :                               0 );
     365           0 :     return MouseButtonUp( aMouseEvent );
     366             : }
     367             : 
     368             : 
     369             : 
     370           0 : void SAL_CALL SfxStatusBarControl::command(
     371             :     const awt::Point& rPos,
     372             :     ::sal_Int32 nCommand,
     373             :     sal_Bool /*bMouseEvent*/,
     374             :     const ::com::sun::star::uno::Any& /*aData*/ )
     375             : throw (::com::sun::star::uno::RuntimeException, std::exception)
     376             : {
     377           0 :     SolarMutexGuard aGuard;
     378           0 :     ::Point aPos( rPos.X, rPos.Y );
     379           0 :     CommandEvent aCmdEvent( aPos, (sal_uInt16)nCommand, true, NULL );
     380             : 
     381           0 :     Command( aCmdEvent );
     382           0 : }
     383             : 
     384             : 
     385             : 
     386       12000 : void SAL_CALL SfxStatusBarControl::paint(
     387             :     const uno::Reference< awt::XGraphics >& xGraphics,
     388             :     const awt::Rectangle& rOutputRectangle,
     389             :     ::sal_Int32 nStyle )
     390             : throw ( ::uno::RuntimeException, std::exception )
     391             : {
     392       12000 :     SolarMutexGuard aGuard;
     393             : 
     394       12000 :     OutputDevice* pOutDev = VCLUnoHelper::GetOutputDevice( xGraphics );
     395       12000 :     if ( pOutDev )
     396             :     {
     397       12000 :         ::Rectangle aRect = VCLRectangle( rOutputRectangle );
     398       12000 :         UserDrawEvent aUserDrawEvent( pOutDev, aRect, pBar->GetCurItemId(), (sal_uInt16)nStyle );
     399       12000 :         Paint( aUserDrawEvent );
     400       12000 :     }
     401       12000 : }
     402             : 
     403             : 
     404             : 
     405           0 : void SAL_CALL SfxStatusBarControl::click( const awt::Point& )
     406             : throw ( uno::RuntimeException, std::exception )
     407             : {
     408           0 :     SolarMutexGuard aGuard;
     409           0 :     Click();
     410           0 : }
     411             : 
     412             : 
     413             : 
     414           0 : void SAL_CALL SfxStatusBarControl::doubleClick( const awt::Point& )
     415             : throw ( uno::RuntimeException, std::exception )
     416             : {
     417           0 :     SolarMutexGuard aGuard;
     418           0 :     DoubleClick();
     419           0 : }
     420             : 
     421             : 
     422             : // old sfx2 interface
     423             : 
     424             : 
     425          36 : void SfxStatusBarControl::StateChanged
     426             : (
     427             :     sal_uInt16              nSID,
     428             :     SfxItemState        eState,
     429             :     const SfxPoolItem*  pState  /* Pointer to SfxPoolItem, is only valid
     430             :                                    withih this Method call. This can be a
     431             :                                    Null-Pointer, a Pointer to SfxVoidItem
     432             :                                    or of this Type found registered by the
     433             :                                    Subclass of SfxStatusBarControl.
     434             :                                 */
     435             : )
     436             : 
     437             : /*  [Description]
     438             : 
     439             :     The base implementation includes items of type SfxStringItem
     440             :     where the text is entered in the status row field and
     441             :     SfxVoidItem, where the field is emptied. The base implementation
     442             :     should not be called in overloaded methods.
     443             : */
     444             : 
     445             : {
     446             :     DBG_ASSERT( pBar != 0, "setting state to dangling StatusBar" );
     447             : 
     448          36 :     const SfxStringItem* pStr = PTR_CAST( SfxStringItem, pState );
     449          36 :     if ( eState == SfxItemState::DEFAULT && pStr )
     450           0 :         pBar->SetItemText( nSID, pStr->GetValue() );
     451             :     else
     452             :     {
     453             :         DBG_ASSERT( eState != SfxItemState::DEFAULT || pState->ISA(SfxVoidItem),
     454             :                     "wrong SfxPoolItem subclass in SfxStatusBarControl" );
     455          36 :         pBar->SetItemText( nSID, OUString() );
     456             :     }
     457          36 : }
     458             : 
     459             : 
     460             : 
     461           0 : bool SfxStatusBarControl::MouseButtonDown( const MouseEvent & )
     462             : 
     463             : /*  [Description]
     464             : 
     465             :     This virtual method forwards the Event MouseButtonDown() of the
     466             :     StatusBar if the mouse position is within the range of the items,
     467             :     or if the mouse was captured by <SfxStatusBarControl::CaptureMouse()>
     468             : 
     469             :     The default implementation is empty and returns FALSE.
     470             : 
     471             :     [Return value]
     472             : 
     473             :     sal_Bool                TRUE
     474             :            The event has been processed and is not intended to
     475             :            be forwarded to StatusBar
     476             : 
     477             :                         FALSE
     478             :            The event was not processed and is to be
     479             :            be forwarded to StatusBar
     480             : */
     481             : 
     482             : {
     483           0 :     return false;
     484             : }
     485             : 
     486             : 
     487             : 
     488           0 : bool SfxStatusBarControl::MouseMove( const MouseEvent & )
     489             : 
     490             : /*  [Description]
     491             : 
     492             :     This virtual method forwards the Event MouseMove() of the
     493             :     StatusBar if the mouse position is within the range of the items,
     494             :     or if the mouse was captured by <SfxStatusBarControl::CaptureMouse()>
     495             : 
     496             :     The default implementation is empty and returns FALSE.
     497             : 
     498             :     [Return value]
     499             : 
     500             :     sal_Bool                TRUE
     501             :            The event has been processed and is not intended to
     502             :            be forwarded to StatusBar
     503             : 
     504             :                         FALSE
     505             :            The event was not processed and is to be
     506             :            be forwarded to StatusBar
     507             : */
     508             : 
     509             : {
     510           0 :     return false;
     511             : }
     512             : 
     513             : 
     514             : 
     515           0 : bool SfxStatusBarControl::MouseButtonUp( const MouseEvent & )
     516             : 
     517             : /*  [Description]
     518             : 
     519             :     This virtual method forwards the Event MouseButtonUp() of the
     520             :     StatusBar if the mouse position is within the range of the items,
     521             :     or if the mouse was captured by <SfxStatusBarControl::CaptureMouse()>
     522             : 
     523             :     The default implementation is empty and returns FALSE.
     524             : 
     525             :     [Return value]
     526             : 
     527             :     sal_Bool                TRUE
     528             :            The event has been processed and is not intended to
     529             :            be forwarded to StatusBar
     530             : 
     531             :                         FALSE
     532             :            The event was not processed and is to be
     533             :            be forwarded to StatusBar
     534             : */
     535             : 
     536             : {
     537           0 :     return false;
     538             : }
     539             : 
     540             : 
     541             : 
     542           0 : void SfxStatusBarControl::Command( const CommandEvent& )
     543             : 
     544             : /*  [Description]
     545             : 
     546             :     This virtual method is called when a CommandEvent is recived by
     547             :     SfxStatusBarControl.
     548             : 
     549             :     The default implementation is empty.
     550             : */
     551             : 
     552             : {
     553           0 : }
     554             : 
     555             : 
     556             : 
     557           0 : void SfxStatusBarControl::Click()
     558             : 
     559             : /*  [Description]
     560             : 
     561             :     This virtual method is called when the user clicks on the
     562             :     field in the status row that belongs to this control.
     563             : 
     564             :     The default implementation is empty.
     565             : */
     566             : 
     567             : {
     568           0 : }
     569             : 
     570             : 
     571             : 
     572           0 : void SfxStatusBarControl::DoubleClick()
     573             : 
     574             : /*  [Description]
     575             : 
     576             :     This virtual method is called when the user double-clicks on the
     577             :     field in the status row that belongs to this control.
     578             : */
     579             : 
     580             : {
     581           0 :     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
     582           0 :     execute( aArgs );
     583           0 : }
     584             : 
     585             : 
     586             : 
     587           0 : void SfxStatusBarControl::Paint
     588             : (
     589             :     const UserDrawEvent& /* Reference to an UserDrawEvent */
     590             : )
     591             : 
     592             : /*  [Description]
     593             : 
     594             :     This virtual method is called to paint the contents if the field
     595             :     at hand is marked with SIB_USERDRAW. The output must be obtained
     596             :     within the Rectangle of rUDEvt.GetRect() by the OutputDevice
     597             :     given by rUDEvt.GetDevice().
     598             : 
     599             :     The default implementation is empty.
     600             : */
     601             : 
     602             : {
     603           0 : }
     604             : 
     605             : 
     606             : 
     607           0 : void SfxStatusBarControl::CaptureMouse()
     608             : {
     609           0 : }
     610             : 
     611             : 
     612             : 
     613           0 : void SfxStatusBarControl::ReleaseMouse()
     614             : {
     615           0 : }
     616             : 
     617             : 
     618             : 
     619       14994 : SfxStatusBarControl* SfxStatusBarControl::CreateControl
     620             : (
     621             :     sal_uInt16     nSlotID,
     622             :     sal_uInt16     nStbId,
     623             :     StatusBar* pBar,
     624             :     SfxModule* pMod
     625             : )
     626             : {
     627       14994 :     SolarMutexGuard aGuard;
     628       14994 :     SfxApplication *pApp = SfxGetpApp();
     629             : 
     630             :     SfxSlotPool *pSlotPool;
     631       14994 :     if ( pMod )
     632       14960 :         pSlotPool = pMod->GetSlotPool();
     633             :     else
     634          34 :         pSlotPool = &SfxSlotPool::GetSlotPool();
     635             : 
     636       14994 :     TypeId aSlotType = pSlotPool->GetSlotType(nSlotID);
     637       14994 :     if ( aSlotType )
     638             :     {
     639       14994 :         if ( pMod )
     640             :         {
     641       14960 :             SfxStbCtrlFactArr_Impl *pFactories = pMod->GetStbCtrlFactories_Impl();
     642       14960 :             if ( pFactories )
     643             :             {
     644       14960 :                 SfxStbCtrlFactArr_Impl &rFactories = *pFactories;
     645       90206 :                 for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory )
     646      118300 :                 if ( rFactories[nFactory].nTypeId == aSlotType &&
     647       35078 :                      ( ( rFactories[nFactory].nSlotId == 0 ) ||
     648       17112 :                      ( rFactories[nFactory].nSlotId == nSlotID) ) )
     649       12544 :                     return rFactories[nFactory].pCtor( nSlotID, nStbId, *pBar );
     650             :             }
     651             :         }
     652             : 
     653        2450 :         SfxStbCtrlFactArr_Impl &rFactories = pApp->GetStbCtrlFactories_Impl();
     654        2450 :         for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory )
     655           0 :         if ( rFactories[nFactory].nTypeId == aSlotType &&
     656           0 :              ( ( rFactories[nFactory].nSlotId == 0 ) ||
     657           0 :              ( rFactories[nFactory].nSlotId == nSlotID) ) )
     658           0 :             return rFactories[nFactory].pCtor( nSlotID, nStbId, *pBar );
     659             :     }
     660             : 
     661        2450 :     return NULL;
     662             : }
     663             : 
     664             : 
     665        1872 : void SfxStatusBarControl::RegisterStatusBarControl(SfxModule* pMod, SfxStbCtrlFactory* pFact)
     666             : {
     667        1872 :     SfxGetpApp()->RegisterStatusBarControl_Impl( pMod, pFact );
     668        2823 : }
     669             : 
     670             : 
     671             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10