LCOV - code coverage report
Current view: top level - libreoffice/forms/source/solar/component - navbarcontrol.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 10 224 4.5 %
Date: 2012-12-17 Functions: 3 36 8.3 %
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             : 
      21             : #include "navbarcontrol.hxx"
      22             : #include "frm_strings.hxx"
      23             : #include "frm_module.hxx"
      24             : #include "FormComponent.hxx"
      25             : #include "componenttools.hxx"
      26             : #include "navtoolbar.hxx"
      27             : #include "commandimageprovider.hxx"
      28             : #include "commanddescriptionprovider.hxx"
      29             : 
      30             : #include <com/sun/star/awt/XView.hpp>
      31             : #include <com/sun/star/awt/PosSize.hpp>
      32             : #include <com/sun/star/form/runtime/FormFeature.hpp>
      33             : #include <com/sun/star/awt/XControlModel.hpp>
      34             : #include <com/sun/star/graphic/XGraphic.hpp>
      35             : 
      36             : #include <comphelper/processfactory.hxx>
      37             : #include <tools/debug.hxx>
      38             : #include <tools/diagnose_ex.h>
      39             : #include <vcl/svapp.hxx>
      40             : 
      41             : //--------------------------------------------------------------------------
      42           9 : extern "C" void SAL_CALL createRegistryInfo_ONavigationBarControl()
      43             : {
      44           9 :     static ::frm::OMultiInstanceAutoRegistration< ::frm::ONavigationBarControl > aAutoRegistration;
      45           9 : }
      46             : 
      47             : //.........................................................................
      48             : namespace frm
      49             : {
      50             : //.........................................................................
      51             : 
      52             :     using namespace ::com::sun::star::uno;
      53             :     using namespace ::com::sun::star::beans;
      54             :     using namespace ::com::sun::star::awt;
      55             :     using namespace ::com::sun::star::lang;
      56             :     using namespace ::com::sun::star::frame;
      57             :     using namespace ::com::sun::star::graphic;
      58             :     namespace FormFeature = ::com::sun::star::form::runtime::FormFeature;
      59             : 
      60             : #define FORWARD_TO_PEER_1( unoInterface, method, param1 )   \
      61             :     Reference< unoInterface > xTypedPeer( getPeer(), UNO_QUERY );   \
      62             :     if ( xTypedPeer.is() )  \
      63             :     {   \
      64             :         xTypedPeer->method( param1 );  \
      65             :     }
      66             : 
      67             : #define FORWARD_TO_PEER_1_RET( returnType, unoInterface, method, param1 )   \
      68             :     returnType aReturn; \
      69             :     Reference< unoInterface > xTypedPeer( getPeer(), UNO_QUERY );   \
      70             :     if ( xTypedPeer.is() )  \
      71             :     {   \
      72             :         aReturn = xTypedPeer->method( param1 );  \
      73             :     }   \
      74             :     return aReturn;
      75             : 
      76             : #define FORWARD_TO_PEER_3( unoInterface, method, param1, param2, param3 )   \
      77             :     Reference< unoInterface > xTypedPeer( getPeer(), UNO_QUERY );   \
      78             :     if ( xTypedPeer.is() )  \
      79             :     {   \
      80             :         xTypedPeer->method( param1, param2, param3 );  \
      81             :     }
      82             : 
      83             : #define FORWARD_TO_PEER_3_RET( returnType, unoInterface, method, param1, param2, param3 )   \
      84             :     returnType aReturn; \
      85             :     Reference< unoInterface > xTypedPeer( getPeer(), UNO_QUERY );   \
      86             :     if ( xTypedPeer.is() )  \
      87             :     {   \
      88             :         aReturn = xTypedPeer->method( param1, param2, param3 );  \
      89             :     }   \
      90             :     return aReturn;
      91             : 
      92             :     //==================================================================
      93             :     // ONavigationBarControl
      94             :     //==================================================================
      95             :     DBG_NAME( ONavigationBarControl )
      96             :     //------------------------------------------------------------------
      97           0 :     ONavigationBarControl::ONavigationBarControl( const Reference< XMultiServiceFactory >& _rxORB )
      98           0 :         :UnoControl( _rxORB )
      99             :     {
     100             :         DBG_CTOR( ONavigationBarControl, NULL );
     101           0 :     }
     102             : 
     103             :     //------------------------------------------------------------------
     104           0 :     ONavigationBarControl::~ONavigationBarControl()
     105             :     {
     106             :         DBG_DTOR( ONavigationBarControl, NULL );
     107           0 :     }
     108             : 
     109             :     //------------------------------------------------------------------
     110           0 :     IMPLEMENT_FORWARD_XTYPEPROVIDER2( ONavigationBarControl, UnoControl, ONavigationBarControl_Base )
     111             : 
     112             :     //------------------------------------------------------------------
     113           0 :     Any SAL_CALL ONavigationBarControl::queryAggregation( const Type& _rType ) throw ( RuntimeException )
     114             :     {
     115           0 :         Any aReturn = UnoControl::queryAggregation( _rType );
     116             : 
     117           0 :         if ( !aReturn.hasValue() )
     118           0 :             aReturn = ONavigationBarControl_Base::queryInterface( _rType );
     119             : 
     120           0 :         return aReturn;
     121             :     }
     122             : 
     123             :     //------------------------------------------------------------------
     124             :     namespace
     125             :     {
     126             :         //..............................................................
     127           0 :         static WinBits lcl_getWinBits_nothrow( const Reference< XControlModel >& _rxModel )
     128             :         {
     129           0 :             WinBits nBits = 0;
     130             :             try
     131             :             {
     132           0 :                 Reference< XPropertySet > xProps( _rxModel, UNO_QUERY );
     133           0 :                 if ( xProps.is() )
     134             :                 {
     135           0 :                     sal_Int16 nBorder = 0;
     136           0 :                     xProps->getPropertyValue( PROPERTY_BORDER ) >>= nBorder;
     137           0 :                     if ( nBorder )
     138           0 :                         nBits |= WB_BORDER;
     139             : 
     140           0 :                     sal_Bool bTabStop = sal_False;
     141           0 :                     if ( xProps->getPropertyValue( PROPERTY_TABSTOP ) >>= bTabStop )
     142           0 :                         nBits |= ( bTabStop ? WB_TABSTOP : WB_NOTABSTOP );
     143           0 :                 }
     144             :             }
     145           0 :             catch( const Exception& )
     146             :             {
     147             :                 DBG_UNHANDLED_EXCEPTION();
     148             :             }
     149           0 :             return nBits;
     150             :         }
     151             :     }
     152             : 
     153             :     //------------------------------------------------------------------
     154           0 :     void SAL_CALL ONavigationBarControl::createPeer( const Reference< XToolkit >& /*_rToolkit*/, const Reference< XWindowPeer >& _rParentPeer ) throw( RuntimeException )
     155             :     {
     156           0 :         SolarMutexGuard aGuard;
     157             : 
     158           0 :         if (!getPeer().is())
     159             :         {
     160           0 :             mbCreatingPeer = sal_True;
     161             : 
     162             :             // determine the VLC window for the parent
     163           0 :             Window* pParentWin = NULL;
     164           0 :             if ( _rParentPeer.is() )
     165             :             {
     166           0 :                 VCLXWindow* pParentXWin = VCLXWindow::GetImplementation( _rParentPeer );
     167           0 :                 if ( pParentXWin )
     168           0 :                     pParentWin = pParentXWin->GetWindow();
     169             :                 DBG_ASSERT( pParentWin, "ONavigationBarControl::createPeer: could not obtain the VCL-level parent window!" );
     170             :             }
     171             : 
     172             :             // create the peer
     173           0 :             ONavigationBarPeer* pPeer = ONavigationBarPeer::Create( maContext.getLegacyServiceFactory(), pParentWin, getModel() );
     174             :             DBG_ASSERT( pPeer, "ONavigationBarControl::createPeer: invalid peer returned!" );
     175           0 :             if ( pPeer )
     176             :                 // by definition, the returned component is aquired once
     177           0 :                 pPeer->release();
     178             : 
     179             :             // announce the peer to the base class
     180           0 :             setPeer( pPeer );
     181             : 
     182             :             // initialize ourself (and thus the peer) with the model properties
     183           0 :             updateFromModel();
     184             : 
     185           0 :             Reference< XView >  xPeerView( getPeer(), UNO_QUERY );
     186           0 :             if ( xPeerView.is() )
     187             :             {
     188           0 :                 xPeerView->setZoom( maComponentInfos.nZoomX, maComponentInfos.nZoomY );
     189           0 :                 xPeerView->setGraphics( mxGraphics );
     190             :             }
     191             : 
     192             :             // a lot of initial settings from our component infos
     193           0 :             setPosSize( maComponentInfos.nX, maComponentInfos.nY, maComponentInfos.nWidth, maComponentInfos.nHeight, PosSize::POSSIZE );
     194             : 
     195           0 :             pPeer->setVisible   ( maComponentInfos.bVisible && !mbDesignMode );
     196           0 :             pPeer->setEnable    ( maComponentInfos.bEnable                   );
     197           0 :             pPeer->setDesignMode( mbDesignMode                               );
     198             : 
     199           0 :             peerCreated();
     200             : 
     201           0 :             mbCreatingPeer = sal_False;
     202             : 
     203           0 :             OControl::initFormControlPeer( getPeer() );
     204           0 :         }
     205           0 :     }
     206             : 
     207             :     //------------------------------------------------------------------
     208           0 :     ::rtl::OUString SAL_CALL ONavigationBarControl::getImplementationName()  throw( RuntimeException )
     209             :     {
     210           0 :         return getImplementationName_Static();
     211             :     }
     212             : 
     213             :     //------------------------------------------------------------------
     214           0 :     Sequence< ::rtl::OUString > SAL_CALL ONavigationBarControl::getSupportedServiceNames()  throw( RuntimeException )
     215             :     {
     216           0 :         return getSupportedServiceNames_Static();
     217             :     }
     218             : 
     219             :     //------------------------------------------------------------------
     220          18 :     ::rtl::OUString SAL_CALL ONavigationBarControl::getImplementationName_Static()
     221             :     {
     222          18 :         return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.form.ONavigationBarControl" ) );
     223             :     }
     224             : 
     225             :     //------------------------------------------------------------------
     226           9 :     Sequence< ::rtl::OUString > SAL_CALL ONavigationBarControl::getSupportedServiceNames_Static()
     227             :     {
     228           9 :         Sequence< ::rtl::OUString > aServices( 2 );
     229           9 :         aServices[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControl" ) );
     230           9 :         aServices[ 1 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.control.NavigationToolBar" ) );
     231           9 :         return aServices;
     232             :     }
     233             : 
     234             :     //------------------------------------------------------------------
     235           0 :     Reference< XInterface > SAL_CALL ONavigationBarControl::Create( const Reference< XMultiServiceFactory >& _rxFactory )
     236             :     {
     237           0 :         return *( new ONavigationBarControl( _rxFactory ) );
     238             :     }
     239             : 
     240             :     //------------------------------------------------------------------
     241           0 :     void SAL_CALL ONavigationBarControl::registerDispatchProviderInterceptor( const Reference< XDispatchProviderInterceptor >& _rxInterceptor ) throw (RuntimeException)
     242             :     {
     243           0 :         FORWARD_TO_PEER_1( XDispatchProviderInterception, registerDispatchProviderInterceptor, _rxInterceptor );
     244           0 :     }
     245             : 
     246             :     //------------------------------------------------------------------
     247           0 :     void SAL_CALL ONavigationBarControl::releaseDispatchProviderInterceptor( const Reference< XDispatchProviderInterceptor >& _rxInterceptor ) throw (RuntimeException)
     248             :     {
     249           0 :         FORWARD_TO_PEER_1( XDispatchProviderInterception, releaseDispatchProviderInterceptor, _rxInterceptor );
     250           0 :     }
     251             : 
     252             :     //------------------------------------------------------------------
     253           0 :     void SAL_CALL ONavigationBarControl::setDesignMode( sal_Bool _bOn ) throw( RuntimeException )
     254             :     {
     255           0 :         UnoControl::setDesignMode( _bOn );
     256           0 :         FORWARD_TO_PEER_1( XVclWindowPeer, setDesignMode, _bOn );
     257           0 :     }
     258             : 
     259             :     //==================================================================
     260             :     // ONavigationBarPeer
     261             :     //==================================================================
     262             :     DBG_NAME( ONavigationBarPeer )
     263             :     //------------------------------------------------------------------
     264           0 :     ONavigationBarPeer* ONavigationBarPeer::Create( const Reference< XMultiServiceFactory >& _rxORB,
     265             :         Window* _pParentWindow, const Reference< XControlModel >& _rxModel )
     266             :     {
     267             :         DBG_TESTSOLARMUTEX();
     268             : 
     269             :         // the peer itself
     270           0 :         ONavigationBarPeer* pPeer = new ONavigationBarPeer( _rxORB );
     271           0 :         pPeer->acquire();   // by definition, the returned object is aquired once
     272             : 
     273             :         // the VCL control for the peer
     274           0 :         Reference< XModel > xContextDocument( getXModel( _rxModel ) );
     275             :         NavigationToolBar* pNavBar = new NavigationToolBar(
     276             :             _pParentWindow,
     277             :             lcl_getWinBits_nothrow( _rxModel ),
     278             :             createDocumentCommandImageProvider( _rxORB, xContextDocument ),
     279             :             createDocumentCommandDescriptionProvider( comphelper::getComponentContext(_rxORB), xContextDocument )
     280           0 :         );
     281             : 
     282             :         // some knittings
     283           0 :         pNavBar->setDispatcher( pPeer );
     284           0 :         pNavBar->SetComponentInterface( pPeer );
     285             : 
     286             :         // we want a faster repeating rate for the slots in this
     287             :         // toolbox
     288           0 :         AllSettings aSettings = pNavBar->GetSettings();
     289           0 :         MouseSettings aMouseSettings = aSettings.GetMouseSettings();
     290           0 :         aMouseSettings.SetButtonRepeat( 10 );
     291           0 :         aSettings.SetMouseSettings( aMouseSettings );
     292           0 :         pNavBar->SetSettings( aSettings, sal_True );
     293             : 
     294             :         // outta here
     295           0 :         return pPeer;
     296             :     }
     297             : 
     298             :     //------------------------------------------------------------------
     299           0 :     ONavigationBarPeer::ONavigationBarPeer( const Reference< XMultiServiceFactory >& _rxORB )
     300           0 :         :OFormNavigationHelper( _rxORB )
     301             :     {
     302             :         DBG_CTOR( ONavigationBarPeer, NULL );
     303           0 :     }
     304             : 
     305             :     //------------------------------------------------------------------
     306           0 :     ONavigationBarPeer::~ONavigationBarPeer()
     307             :     {
     308             :         DBG_DTOR( ONavigationBarPeer, NULL );
     309           0 :     }
     310             : 
     311             :     //------------------------------------------------------------------
     312           0 :     IMPLEMENT_FORWARD_XINTERFACE2( ONavigationBarPeer, VCLXWindow, OFormNavigationHelper )
     313             : 
     314             :     //------------------------------------------------------------------
     315           0 :     IMPLEMENT_FORWARD_XTYPEPROVIDER2( ONavigationBarPeer, VCLXWindow, OFormNavigationHelper )
     316             : 
     317             :     //------------------------------------------------------------------
     318           0 :     void SAL_CALL ONavigationBarPeer::dispose(  ) throw( RuntimeException )
     319             :     {
     320           0 :         VCLXWindow::dispose();
     321           0 :         OFormNavigationHelper::dispose();
     322           0 :     }
     323             : 
     324             :     //------------------------------------------------------------------
     325           0 :     void SAL_CALL ONavigationBarPeer::setProperty( const ::rtl::OUString& _rPropertyName, const Any& _rValue ) throw( RuntimeException )
     326             :     {
     327           0 :         SolarMutexGuard aGuard;
     328             : 
     329           0 :         NavigationToolBar* pNavBar = static_cast< NavigationToolBar* >( GetWindow() );
     330           0 :         if ( !pNavBar )
     331             :         {
     332           0 :             VCLXWindow::setProperty( _rPropertyName, _rValue );
     333           0 :             return;
     334             :         }
     335             : 
     336           0 :         bool bVoid = !_rValue.hasValue();
     337             : 
     338           0 :         sal_Bool  bBoolValue = sal_False;
     339           0 :         sal_Int32 nColor = COL_TRANSPARENT;
     340             : 
     341             :         // TODO: more generic mechanisms for this (the grid control implementation,
     342             :         // when used herein, will do the same stuff for lot of these)
     343             : 
     344           0 :         if ( _rPropertyName.equals( PROPERTY_BACKGROUNDCOLOR ) )
     345             :         {
     346           0 :             Wallpaper aTest = pNavBar->GetBackground();
     347           0 :             if ( bVoid )
     348             :             {
     349           0 :                 pNavBar->SetBackground( pNavBar->GetSettings().GetStyleSettings().GetFaceColor() );
     350           0 :                 pNavBar->SetControlBackground();
     351             :             }
     352             :             else
     353             :             {
     354           0 :                 OSL_VERIFY( _rValue >>= nColor );
     355           0 :                 Color aColor( nColor );
     356           0 :                 pNavBar->SetBackground( aColor );
     357           0 :                 pNavBar->SetControlBackground( aColor );
     358           0 :             }
     359             :         }
     360           0 :         else if ( _rPropertyName.equals( PROPERTY_TEXTLINECOLOR ) )
     361             :         {
     362           0 :             if ( bVoid )
     363             :             {
     364           0 :                 pNavBar->SetTextLineColor();
     365             :             }
     366             :             else
     367             :             {
     368           0 :                 OSL_VERIFY( _rValue >>= nColor );
     369           0 :                 Color aColor( nColor );
     370           0 :                 pNavBar->SetTextLineColor( nColor );
     371             :             }
     372             :         }
     373           0 :         else if ( _rPropertyName.equals( PROPERTY_ICONSIZE ) )
     374             :         {
     375           0 :             sal_Int16 nInt16Value = 0;
     376           0 :             OSL_VERIFY( _rValue >>= nInt16Value );
     377           0 :             pNavBar->SetImageSize( nInt16Value ? NavigationToolBar::eLarge : NavigationToolBar::eSmall );
     378             :         }
     379           0 :         else if ( _rPropertyName.equals( PROPERTY_SHOW_POSITION ) )
     380             :         {
     381           0 :             OSL_VERIFY( _rValue >>= bBoolValue );
     382           0 :             pNavBar->ShowFunctionGroup( NavigationToolBar::ePosition, bBoolValue );
     383             :         }
     384           0 :         else if ( _rPropertyName.equals( PROPERTY_SHOW_NAVIGATION ) )
     385             :         {
     386           0 :             OSL_VERIFY( _rValue >>= bBoolValue );
     387           0 :             pNavBar->ShowFunctionGroup( NavigationToolBar::eNavigation, bBoolValue );
     388             :         }
     389           0 :         else if ( _rPropertyName.equals( PROPERTY_SHOW_RECORDACTIONS ) )
     390             :         {
     391           0 :             OSL_VERIFY( _rValue >>= bBoolValue );
     392           0 :             pNavBar->ShowFunctionGroup( NavigationToolBar::eRecordActions, bBoolValue );
     393             :         }
     394           0 :         else if ( _rPropertyName.equals( PROPERTY_SHOW_FILTERSORT ) )
     395             :         {
     396           0 :             OSL_VERIFY( _rValue >>= bBoolValue );
     397           0 :             pNavBar->ShowFunctionGroup( NavigationToolBar::eFilterSort, bBoolValue );
     398             :         }
     399             :         else
     400             :         {
     401           0 :             VCLXWindow::setProperty( _rPropertyName, _rValue );
     402           0 :         }
     403             :     }
     404             : 
     405             :     //------------------------------------------------------------------
     406           0 :     Any SAL_CALL ONavigationBarPeer::getProperty( const ::rtl::OUString& _rPropertyName ) throw( RuntimeException )
     407             :     {
     408           0 :         SolarMutexGuard aGuard;
     409             : 
     410           0 :         Any aReturn;
     411           0 :         NavigationToolBar* pNavBar = static_cast< NavigationToolBar* >( GetWindow() );
     412             : 
     413           0 :         if ( _rPropertyName.equals( PROPERTY_BACKGROUNDCOLOR ) )
     414             :         {
     415           0 :             aReturn <<= (sal_Int32)pNavBar->GetControlBackground().GetColor();
     416             :         }
     417           0 :         else if ( _rPropertyName.equals( PROPERTY_TEXTLINECOLOR ) )
     418             :         {
     419           0 :             aReturn <<= (sal_Int32)pNavBar->GetTextLineColor().GetColor();
     420             :         }
     421           0 :         else if ( _rPropertyName.equals( PROPERTY_ICONSIZE ) )
     422             :         {
     423           0 :             sal_Int16 nIconType = ( NavigationToolBar::eLarge == pNavBar->GetImageSize() )
     424           0 :                                 ? 1 : 0;
     425           0 :             aReturn <<= nIconType;
     426             :         }
     427           0 :         else if ( _rPropertyName.equals( PROPERTY_SHOW_POSITION ) )
     428             :         {
     429           0 :             aReturn <<= (sal_Bool)( pNavBar->IsFunctionGroupVisible( NavigationToolBar::ePosition ) );
     430             :         }
     431           0 :         else if ( _rPropertyName.equals( PROPERTY_SHOW_NAVIGATION ) )
     432             :         {
     433           0 :             aReturn <<= (sal_Bool)( pNavBar->IsFunctionGroupVisible( NavigationToolBar::eNavigation ) );
     434             :         }
     435           0 :         else if ( _rPropertyName.equals( PROPERTY_SHOW_RECORDACTIONS ) )
     436             :         {
     437           0 :             aReturn <<= (sal_Bool)( pNavBar->IsFunctionGroupVisible( NavigationToolBar::eRecordActions ) );
     438             :         }
     439           0 :         else if ( _rPropertyName.equals( PROPERTY_SHOW_FILTERSORT ) )
     440             :         {
     441           0 :             aReturn <<= (sal_Bool)( pNavBar->IsFunctionGroupVisible( NavigationToolBar::eFilterSort ) );
     442             :         }
     443             :         else
     444           0 :             aReturn = VCLXWindow::getProperty( _rPropertyName );
     445             : 
     446           0 :         return aReturn;
     447             :     }
     448             : 
     449             :     //------------------------------------------------------------------
     450           0 :     void ONavigationBarPeer::interceptorsChanged( )
     451             :     {
     452           0 :         if ( isDesignMode() )
     453             :             // not interested in if we're in design mode
     454           0 :             return;
     455             : 
     456           0 :         OFormNavigationHelper::interceptorsChanged();
     457             :     }
     458             : 
     459             :     //------------------------------------------------------------------
     460           0 :     void ONavigationBarPeer::featureStateChanged( sal_Int16 _nFeatureId, sal_Bool _bEnabled )
     461             :     {
     462             :         // enable this button on the toolbox
     463           0 :         NavigationToolBar* pNavBar = static_cast< NavigationToolBar* >( GetWindow() );
     464           0 :         if ( pNavBar )
     465             :         {
     466           0 :             pNavBar->enableFeature( _nFeatureId, _bEnabled );
     467             : 
     468             :             // is it a feature with additional state information?
     469           0 :             if ( _nFeatureId == FormFeature::ToggleApplyFilter )
     470             :             {   // additional boolean state
     471           0 :                 pNavBar->checkFeature( _nFeatureId, getBooleanState( _nFeatureId ) );
     472             :             }
     473           0 :             else if ( _nFeatureId == FormFeature::TotalRecords )
     474             :             {
     475           0 :                 pNavBar->setFeatureText( _nFeatureId, getStringState( _nFeatureId ) );
     476             :             }
     477           0 :             else if ( _nFeatureId == FormFeature::MoveAbsolute )
     478             :             {
     479           0 :                 pNavBar->setFeatureText( _nFeatureId, rtl::OUString::valueOf(getIntegerState(_nFeatureId)) );
     480             :             }
     481             :         }
     482             : 
     483             :         // base class
     484           0 :         OFormNavigationHelper::featureStateChanged( _nFeatureId, _bEnabled );
     485           0 :     }
     486             : 
     487             :     //------------------------------------------------------------------
     488           0 :     void ONavigationBarPeer::allFeatureStatesChanged( )
     489             :     {
     490             :         // force the control to update it's states
     491           0 :         NavigationToolBar* pNavBar = static_cast< NavigationToolBar* >( GetWindow() );
     492           0 :         if ( pNavBar )
     493           0 :             pNavBar->setDispatcher( this );
     494             : 
     495             :         // base class
     496           0 :         OFormNavigationHelper::allFeatureStatesChanged( );
     497           0 :     }
     498             : 
     499             :     //------------------------------------------------------------------
     500           0 :     bool ONavigationBarPeer::isEnabled( sal_Int16 _nFeatureId ) const
     501             :     {
     502           0 :         if ( const_cast< ONavigationBarPeer* >( this )->isDesignMode() )
     503           0 :            return false;
     504             : 
     505           0 :         return OFormNavigationHelper::isEnabled( _nFeatureId );
     506             :     }
     507             : 
     508             :     //------------------------------------------------------------------
     509           0 :     void SAL_CALL ONavigationBarPeer::setDesignMode( sal_Bool _bOn ) throw( RuntimeException )
     510             :     {
     511           0 :         VCLXWindow::setDesignMode( _bOn  );
     512             : 
     513           0 :         if ( _bOn )
     514           0 :             disconnectDispatchers();
     515             :         else
     516           0 :             connectDispatchers();
     517             :             // this will connect if not already connected and just update else
     518           0 :     }
     519             : 
     520             :     //------------------------------------------------------------------
     521           0 :     void SAL_CALL ONavigationBarPeer::disposing( const EventObject& _rSource ) throw (RuntimeException)
     522             :     {
     523           0 :         VCLXWindow::disposing( _rSource );
     524           0 :         OFormNavigationHelper::disposing( _rSource );
     525           0 :     }
     526             : 
     527             :     //------------------------------------------------------------------
     528           0 :     void ONavigationBarPeer::getSupportedFeatures( ::std::vector< sal_Int16 >& _rFeatureIds )
     529             :     {
     530           0 :         _rFeatureIds.push_back( FormFeature::MoveAbsolute );
     531           0 :         _rFeatureIds.push_back( FormFeature::TotalRecords );
     532           0 :         _rFeatureIds.push_back( FormFeature::MoveToFirst );
     533           0 :         _rFeatureIds.push_back( FormFeature::MoveToPrevious );
     534           0 :         _rFeatureIds.push_back( FormFeature::MoveToNext );
     535           0 :         _rFeatureIds.push_back( FormFeature::MoveToLast );
     536           0 :         _rFeatureIds.push_back( FormFeature::SaveRecordChanges );
     537           0 :         _rFeatureIds.push_back( FormFeature::UndoRecordChanges );
     538           0 :         _rFeatureIds.push_back( FormFeature::MoveToInsertRow );
     539           0 :         _rFeatureIds.push_back( FormFeature::DeleteRecord );
     540           0 :         _rFeatureIds.push_back( FormFeature::ReloadForm );
     541           0 :         _rFeatureIds.push_back( FormFeature::RefreshCurrentControl );
     542           0 :         _rFeatureIds.push_back( FormFeature::SortAscending );
     543           0 :         _rFeatureIds.push_back( FormFeature::SortDescending );
     544           0 :         _rFeatureIds.push_back( FormFeature::InteractiveSort );
     545           0 :         _rFeatureIds.push_back( FormFeature::AutoFilter );
     546           0 :         _rFeatureIds.push_back( FormFeature::InteractiveFilter );
     547           0 :         _rFeatureIds.push_back( FormFeature::ToggleApplyFilter );
     548           0 :         _rFeatureIds.push_back( FormFeature::RemoveFilterAndSort );
     549           0 :     }
     550             : 
     551             : //.........................................................................
     552             : }   // namespace frm
     553             : //.........................................................................
     554             : 
     555             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10