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

Generated by: LCOV version 1.10