LCOV - code coverage report
Current view: top level - libreoffice/UnoControls/source/controls - statusindicator.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 173 0.0 %
Date: 2012-12-27 Functions: 0 26 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 "statusindicator.hxx"
      21             : 
      22             : #include <com/sun/star/awt/InvalidateStyle.hpp>
      23             : #include <com/sun/star/awt/WindowAttribute.hpp>
      24             : #include <cppuhelper/typeprovider.hxx>
      25             : 
      26             : #include "progressbar.hxx"
      27             : 
      28             : using namespace ::cppu                  ;
      29             : using namespace ::osl                   ;
      30             : using namespace ::rtl                   ;
      31             : using namespace ::com::sun::star::uno   ;
      32             : using namespace ::com::sun::star::lang  ;
      33             : using namespace ::com::sun::star::awt   ;
      34             : using namespace ::com::sun::star::task  ;
      35             : 
      36             : namespace unocontrols{
      37             : 
      38             : //____________________________________________________________________________________________________________
      39             : //  construct/destruct
      40             : //____________________________________________________________________________________________________________
      41             : 
      42           0 : StatusIndicator::StatusIndicator( const Reference< XComponentContext >& rxContext )
      43           0 :     : BaseContainerControl  ( rxContext  )
      44             : {
      45             :     // Its not allowed to work with member in this method (refcounter !!!)
      46             :     // But with a HACK (++refcount) its "OK" :-(
      47           0 :     ++m_refCount ;
      48             : 
      49             :     // Create instances for fixedtext and progress ...
      50           0 :     m_xText         = Reference< XFixedText >   ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY );
      51           0 :     m_xProgressBar  = Reference< XProgressBar > ( rxContext->getServiceManager()->createInstanceWithContext( SERVICENAME_PROGRESSBAR, rxContext ), UNO_QUERY );
      52             :     // ... cast controls to Reference< XControl > and set model ...
      53             :     // ( ProgressBar has no model !!! )
      54           0 :     Reference< XControl > xTextControl      ( m_xText       , UNO_QUERY );
      55           0 :     Reference< XControl > xProgressControl  ( m_xProgressBar, UNO_QUERY );
      56           0 :     xTextControl->setModel( Reference< XControlModel >( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) );
      57             :     // ... and add controls to basecontainercontrol!
      58           0 :     addControl( CONTROLNAME_TEXT, xTextControl    );
      59           0 :     addControl( CONTROLNAME_PROGRESSBAR, xProgressControl    );
      60             :     // FixedText make it automaticly visible by himself ... but not the progressbar !!!
      61             :     // it must be set explicitly
      62           0 :     Reference< XWindow > xProgressWindow( m_xProgressBar, UNO_QUERY );
      63           0 :     xProgressWindow->setVisible( sal_True );
      64             :     // Reset to defaults !!!
      65             :     // (progressbar take automaticly its own defaults)
      66           0 :     m_xText->setText( STATUSINDICATOR_DEFAULT_TEXT );
      67             : 
      68           0 :     --m_refCount ;
      69           0 : }
      70             : 
      71           0 : StatusIndicator::~StatusIndicator()
      72             : {
      73             :     // Release all references
      74           0 :     m_xText         = Reference< XFixedText >();
      75           0 :     m_xProgressBar  = Reference< XProgressBar >();
      76           0 : }
      77             : 
      78             : //____________________________________________________________________________________________________________
      79             : //  XInterface
      80             : //____________________________________________________________________________________________________________
      81             : 
      82           0 : Any SAL_CALL StatusIndicator::queryInterface( const Type& rType ) throw( RuntimeException )
      83             : {
      84             :     // Attention:
      85             :     //  Don't use mutex or guard in this method!!! Is a method of XInterface.
      86           0 :     Any aReturn ;
      87           0 :     Reference< XInterface > xDel = BaseContainerControl::impl_getDelegator();
      88           0 :     if ( xDel.is() )
      89             :     {
      90             :         // If an delegator exist, forward question to his queryInterface.
      91             :         // Delegator will ask his own queryAggregation!
      92           0 :         aReturn = xDel->queryInterface( rType );
      93             :     }
      94             :     else
      95             :     {
      96             :         // If an delegator unknown, forward question to own queryAggregation.
      97           0 :         aReturn = queryAggregation( rType );
      98             :     }
      99             : 
     100           0 :     return aReturn ;
     101             : }
     102             : 
     103             : //____________________________________________________________________________________________________________
     104             : //  XInterface
     105             : //____________________________________________________________________________________________________________
     106             : 
     107           0 : void SAL_CALL StatusIndicator::acquire() throw()
     108             : {
     109             :     // Attention:
     110             :     //  Don't use mutex or guard in this method!!! Is a method of XInterface.
     111             : 
     112             :     // Forward to baseclass
     113           0 :     BaseControl::acquire();
     114           0 : }
     115             : 
     116             : //____________________________________________________________________________________________________________
     117             : //  XInterface
     118             : //____________________________________________________________________________________________________________
     119             : 
     120           0 : void SAL_CALL StatusIndicator::release() throw()
     121             : {
     122             :     // Attention:
     123             :     //  Don't use mutex or guard in this method!!! Is a method of XInterface.
     124             : 
     125             :     // Forward to baseclass
     126           0 :     BaseControl::release();
     127           0 : }
     128             : 
     129             : //____________________________________________________________________________________________________________
     130             : //  XTypeProvider
     131             : //____________________________________________________________________________________________________________
     132             : 
     133           0 : Sequence< Type > SAL_CALL StatusIndicator::getTypes() throw( RuntimeException )
     134             : {
     135             :     // Optimize this method !
     136             :     // We initialize a static variable only one time. And we don't must use a mutex at every call!
     137             :     // For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL!
     138             :     static OTypeCollection* pTypeCollection = NULL ;
     139             : 
     140           0 :     if ( pTypeCollection == NULL )
     141             :     {
     142             :         // Ready for multithreading; get global mutex for first call of this method only! see before
     143           0 :         MutexGuard aGuard( Mutex::getGlobalMutex() );
     144             : 
     145             :         // Control these pointer again ... it can be, that another instance will be faster then these!
     146           0 :         if ( pTypeCollection == NULL )
     147             :         {
     148             :             // Create a static typecollection ...
     149           0 :             static OTypeCollection aTypeCollection  ( ::getCppuType(( const Reference< XLayoutConstrains    >*)NULL )   ,
     150           0 :                                                       ::getCppuType(( const Reference< XStatusIndicator >*)NULL )   ,
     151             :                                                       BaseContainerControl::getTypes()
     152           0 :                                                     );
     153             :             // ... and set his address to static pointer!
     154           0 :             pTypeCollection = &aTypeCollection ;
     155           0 :         }
     156             :     }
     157             : 
     158           0 :     return pTypeCollection->getTypes();
     159             : }
     160             : 
     161             : //____________________________________________________________________________________________________________
     162             : //  XAggregation
     163             : //____________________________________________________________________________________________________________
     164             : 
     165           0 : Any SAL_CALL StatusIndicator::queryAggregation( const Type& aType ) throw( RuntimeException )
     166             : {
     167             :     // Ask for my own supported interfaces ...
     168             :     // Attention: XTypeProvider and XInterface are supported by OComponentHelper!
     169             :     Any aReturn ( ::cppu::queryInterface( aType                                     ,
     170             :                                           static_cast< XLayoutConstrains*   > ( this )  ,
     171             :                                           static_cast< XStatusIndicator*    > ( this )
     172             :                                         )
     173           0 :                 );
     174             : 
     175             :     // If searched interface not supported by this class ...
     176           0 :     if ( aReturn.hasValue() == sal_False )
     177             :     {
     178             :         // ... ask baseclasses.
     179           0 :         aReturn = BaseControl::queryAggregation( aType );
     180             :     }
     181             : 
     182           0 :     return aReturn ;
     183             : }
     184             : 
     185             : //____________________________________________________________________________________________________________
     186             : //  XStatusIndicator
     187             : //____________________________________________________________________________________________________________
     188             : 
     189           0 : void SAL_CALL StatusIndicator::start( const OUString& sText, sal_Int32 nRange ) throw( RuntimeException )
     190             : {
     191             :     // Ready for multithreading
     192           0 :     MutexGuard aGuard( m_aMutex );
     193             : 
     194             :     // Initialize status controls with given values.
     195           0 :     m_xText->setText( sText );
     196           0 :     m_xProgressBar->setRange( 0, nRange );
     197             :     // force repaint ... fixedtext has changed !
     198           0 :     impl_recalcLayout ( WindowEvent(static_cast< OWeakObject* >(this),0,0,impl_getWidth(),impl_getHeight(),0,0,0,0) ) ;
     199           0 : }
     200             : 
     201             : //____________________________________________________________________________________________________________
     202             : //  XStatusIndicator
     203             : //____________________________________________________________________________________________________________
     204             : 
     205           0 : void SAL_CALL StatusIndicator::end() throw( RuntimeException )
     206             : {
     207             :     // Ready for multithreading
     208           0 :     MutexGuard aGuard( m_aMutex );
     209             : 
     210             :     // Clear values of status controls.
     211           0 :     m_xText->setText( OUString() );
     212           0 :     m_xProgressBar->setValue( 0 );
     213           0 :     setVisible( sal_False );
     214           0 : }
     215             : 
     216             : //____________________________________________________________________________________________________________
     217             : //  XStatusIndicator
     218             : //____________________________________________________________________________________________________________
     219             : 
     220           0 : void SAL_CALL StatusIndicator::setText( const OUString& sText ) throw( RuntimeException )
     221             : {
     222             :     // Ready for multithreading
     223           0 :     MutexGuard aGuard( m_aMutex );
     224             : 
     225             :     // Take text on right control
     226           0 :     m_xText->setText( sText );
     227           0 : }
     228             : 
     229             : //____________________________________________________________________________________________________________
     230             : //  XStatusIndicator
     231             : //____________________________________________________________________________________________________________
     232             : 
     233           0 : void SAL_CALL StatusIndicator::setValue( sal_Int32 nValue ) throw( RuntimeException )
     234             : {
     235             :     // Ready for multithreading
     236           0 :     MutexGuard aGuard( m_aMutex );
     237             : 
     238             :     // Take value on right control
     239           0 :     m_xProgressBar->setValue( nValue );
     240           0 : }
     241             : 
     242             : //____________________________________________________________________________________________________________
     243             : //  XStatusIndicator
     244             : //____________________________________________________________________________________________________________
     245             : 
     246           0 : void SAL_CALL StatusIndicator::reset() throw( RuntimeException )
     247             : {
     248             :     // Ready for multithreading
     249           0 :     MutexGuard aGuard( m_aMutex );
     250             : 
     251             :     // Clear values of status controls.
     252             :     // (Don't hide the window! User will reset current values ... but he will not finish using of indicator!)
     253           0 :     m_xText->setText( OUString() );
     254           0 :     m_xProgressBar->setValue( 0 );
     255           0 : }
     256             : 
     257             : //____________________________________________________________________________________________________________
     258             : //  XLayoutConstrains
     259             : //____________________________________________________________________________________________________________
     260             : 
     261           0 : Size SAL_CALL StatusIndicator::getMinimumSize () throw( RuntimeException )
     262             : {
     263           0 :     return Size (STATUSINDICATOR_DEFAULT_WIDTH, STATUSINDICATOR_DEFAULT_HEIGHT) ;
     264             : }
     265             : 
     266             : //____________________________________________________________________________________________________________
     267             : //  XLayoutConstrains
     268             : //____________________________________________________________________________________________________________
     269             : 
     270           0 : Size SAL_CALL StatusIndicator::getPreferredSize () throw( RuntimeException )
     271             : {
     272             :     // Ready for multithreading
     273           0 :     ClearableMutexGuard aGuard ( m_aMutex ) ;
     274             : 
     275             :     // get information about required place of child controls
     276           0 :     Reference< XLayoutConstrains >  xTextLayout ( m_xText, UNO_QUERY );
     277           0 :     Size                            aTextSize   = xTextLayout->getPreferredSize();
     278             : 
     279           0 :     aGuard.clear () ;
     280             : 
     281             :     // calc preferred size of status indicator
     282           0 :     sal_Int32 nWidth  = impl_getWidth()                 ;
     283           0 :     sal_Int32 nHeight = (2*STATUSINDICATOR_FREEBORDER)+aTextSize.Height ;
     284             : 
     285             :     // norm to minimum
     286           0 :     if ( nWidth<STATUSINDICATOR_DEFAULT_WIDTH )
     287             :     {
     288           0 :         nWidth = STATUSINDICATOR_DEFAULT_WIDTH ;
     289             :     }
     290           0 :     if ( nHeight<STATUSINDICATOR_DEFAULT_HEIGHT )
     291             :     {
     292           0 :         nHeight = STATUSINDICATOR_DEFAULT_HEIGHT ;
     293             :     }
     294             : 
     295             :     // return to caller
     296           0 :     return Size ( nWidth, nHeight ) ;
     297             : }
     298             : 
     299             : //____________________________________________________________________________________________________________
     300             : //  XLayoutConstrains
     301             : //____________________________________________________________________________________________________________
     302             : 
     303           0 : Size SAL_CALL StatusIndicator::calcAdjustedSize ( const Size& /*rNewSize*/ ) throw( RuntimeException )
     304             : {
     305           0 :     return getPreferredSize () ;
     306             : }
     307             : 
     308             : //____________________________________________________________________________________________________________
     309             : //  XControl
     310             : //____________________________________________________________________________________________________________
     311             : 
     312           0 : void SAL_CALL StatusIndicator::createPeer (
     313             :     const Reference< XToolkit > & rToolkit,
     314             :     const Reference< XWindowPeer > & rParent
     315             : ) throw( RuntimeException )
     316             : {
     317           0 :     if( getPeer().is() == sal_False )
     318             :     {
     319           0 :         BaseContainerControl::createPeer( rToolkit, rParent );
     320             : 
     321             :         // If user forget to call "setPosSize()", we have still a correct size.
     322             :         // And a "MinimumSize" IS A "MinimumSize"!
     323             :         // We change not the position of control at this point.
     324           0 :         Size aDefaultSize = getMinimumSize () ;
     325           0 :         setPosSize ( 0, 0, aDefaultSize.Width, aDefaultSize.Height, PosSize::SIZE ) ;
     326             :     }
     327           0 : }
     328             : 
     329             : //____________________________________________________________________________________________________________
     330             : //  XControl
     331             : //____________________________________________________________________________________________________________
     332             : 
     333           0 : sal_Bool SAL_CALL StatusIndicator::setModel ( const Reference< XControlModel > & /*rModel*/ ) throw( RuntimeException )
     334             : {
     335             :     // We have no model.
     336           0 :     return sal_False ;
     337             : }
     338             : 
     339             : //____________________________________________________________________________________________________________
     340             : //  XControl
     341             : //____________________________________________________________________________________________________________
     342             : 
     343           0 : Reference< XControlModel > SAL_CALL StatusIndicator::getModel () throw( RuntimeException )
     344             : {
     345             :     // We have no model.
     346             :     // return (XControlModel*)this ;
     347           0 :     return Reference< XControlModel >  () ;
     348             : }
     349             : 
     350             : //____________________________________________________________________________________________________________
     351             : //  XComponent
     352             : //____________________________________________________________________________________________________________
     353             : 
     354           0 : void SAL_CALL StatusIndicator::dispose () throw( RuntimeException )
     355             : {
     356             :     // Ready for multithreading
     357           0 :     MutexGuard aGuard ( m_aMutex ) ;
     358             : 
     359             :     // "removeControl()" control the state of a reference
     360           0 :     Reference< XControl >  xTextControl     ( m_xText       , UNO_QUERY );
     361           0 :     Reference< XControl >  xProgressControl ( m_xProgressBar, UNO_QUERY );
     362             : 
     363           0 :     removeControl( xTextControl     );
     364           0 :     removeControl( xProgressControl );
     365             : 
     366             :     // do'nt use "...->clear ()" or "... = XFixedText ()"
     367             :     // when other hold a reference at this object !!!
     368           0 :     xTextControl->dispose();
     369           0 :     xProgressControl->dispose();
     370           0 :     BaseContainerControl::dispose();
     371           0 : }
     372             : 
     373             : //____________________________________________________________________________________________________________
     374             : //  XWindow
     375             : //____________________________________________________________________________________________________________
     376             : 
     377           0 : void SAL_CALL StatusIndicator::setPosSize (
     378             :     sal_Int32 nX,
     379             :     sal_Int32 nY,
     380             :     sal_Int32 nWidth,
     381             :     sal_Int32 nHeight,
     382             :     sal_Int16 nFlags
     383             : ) throw( RuntimeException )
     384             : {
     385           0 :     Rectangle   aBasePosSize = getPosSize () ;
     386           0 :     BaseContainerControl::setPosSize (nX, nY, nWidth, nHeight, nFlags) ;
     387             : 
     388             :     // if position or size changed
     389           0 :     if (
     390             :         ( nWidth  != aBasePosSize.Width ) ||
     391             :         ( nHeight != aBasePosSize.Height)
     392             :        )
     393             :     {
     394             :         // calc new layout for controls
     395           0 :         impl_recalcLayout ( WindowEvent(static_cast< OWeakObject* >(this),0,0,nWidth,nHeight,0,0,0,0) ) ;
     396             :         // clear background (!)
     397             :         // [Children were repainted in "recalcLayout" by setPosSize() automaticly!]
     398           0 :         getPeer()->invalidate(2);
     399             :         // and repaint the control
     400           0 :         impl_paint ( 0, 0, impl_getGraphicsPeer() ) ;
     401             :     }
     402           0 : }
     403             : 
     404             : //____________________________________________________________________________________________________________
     405             : //  impl but public method to register service
     406             : //____________________________________________________________________________________________________________
     407             : 
     408           0 : const Sequence< OUString > StatusIndicator::impl_getStaticSupportedServiceNames()
     409             : {
     410           0 :     MutexGuard aGuard( Mutex::getGlobalMutex() );
     411           0 :     Sequence< OUString > seqServiceNames( 1 );
     412           0 :     seqServiceNames.getArray() [0] = SERVICENAME_STATUSINDICATOR;
     413           0 :     return seqServiceNames ;
     414             : }
     415             : 
     416             : //____________________________________________________________________________________________________________
     417             : //  impl but public method to register service
     418             : //____________________________________________________________________________________________________________
     419             : 
     420           0 : const OUString StatusIndicator::impl_getStaticImplementationName()
     421             : {
     422           0 :     return OUString(IMPLEMENTATIONNAME_STATUSINDICATOR);
     423             : }
     424             : 
     425             : //____________________________________________________________________________________________________________
     426             : //  protected method
     427             : //____________________________________________________________________________________________________________
     428             : 
     429           0 : WindowDescriptor* StatusIndicator::impl_getWindowDescriptor( const Reference< XWindowPeer >& xParentPeer )
     430             : {
     431             :     // - used from "createPeer()" to set the values of an ::com::sun::star::awt::WindowDescriptor !!!
     432             :     // - if you will change the descriptor-values, you must override this virtuell function
     433             :     // - the caller must release the memory for this dynamical descriptor !!!
     434             : 
     435           0 :     WindowDescriptor* pDescriptor = new WindowDescriptor ;
     436             : 
     437           0 :     pDescriptor->Type               =   WindowClass_SIMPLE                              ;
     438           0 :     pDescriptor->WindowServiceName  =   "floatingwindow"                                ;
     439           0 :     pDescriptor->ParentIndex        =   -1                                              ;
     440           0 :     pDescriptor->Parent             =   xParentPeer                                     ;
     441           0 :     pDescriptor->Bounds             =   getPosSize ()                                   ;
     442             : 
     443           0 :     return pDescriptor ;
     444             : }
     445             : 
     446             : //____________________________________________________________________________________________________________
     447             : //  protected method
     448             : //____________________________________________________________________________________________________________
     449             : 
     450           0 : void StatusIndicator::impl_paint ( sal_Int32 nX, sal_Int32 nY, const Reference< XGraphics > & rGraphics )
     451             : {
     452             :     // This paint method ist not buffered !!
     453             :     // Every request paint the completely control. ( but only, if peer exist )
     454           0 :      if ( rGraphics.is () )
     455             :     {
     456           0 :         MutexGuard  aGuard (m_aMutex) ;
     457             : 
     458             :         // background = gray
     459           0 :         Reference< XWindowPeer > xPeer( impl_getPeerWindow(), UNO_QUERY );
     460           0 :         if( xPeer.is() == sal_True )
     461           0 :             xPeer->setBackground( STATUSINDICATOR_BACKGROUNDCOLOR );
     462             : 
     463             :         // FixedText background = gray
     464           0 :         Reference< XControl > xTextControl( m_xText, UNO_QUERY );
     465           0 :         xPeer = xTextControl->getPeer();
     466           0 :         if( xPeer.is() == sal_True )
     467           0 :             xPeer->setBackground( STATUSINDICATOR_BACKGROUNDCOLOR );
     468             : 
     469             :         // Progress background = gray
     470           0 :         xPeer = Reference< XWindowPeer >( m_xProgressBar, UNO_QUERY );
     471           0 :         if( xPeer.is() == sal_True )
     472           0 :             xPeer->setBackground( STATUSINDICATOR_BACKGROUNDCOLOR );
     473             : 
     474             :         // paint shadow border
     475           0 :         rGraphics->setLineColor ( STATUSINDICATOR_LINECOLOR_BRIGHT                          );
     476           0 :         rGraphics->drawLine     ( nX, nY, impl_getWidth(), nY               );
     477           0 :         rGraphics->drawLine     ( nX, nY, nX             , impl_getHeight() );
     478             : 
     479           0 :         rGraphics->setLineColor ( STATUSINDICATOR_LINECOLOR_SHADOW                                                              );
     480           0 :         rGraphics->drawLine     ( impl_getWidth()-1, impl_getHeight()-1, impl_getWidth()-1, nY                  );
     481           0 :         rGraphics->drawLine     ( impl_getWidth()-1, impl_getHeight()-1, nX               , impl_getHeight()-1  );
     482             :     }
     483           0 : }
     484             : 
     485             : //____________________________________________________________________________________________________________
     486             : //  protected method
     487             : //____________________________________________________________________________________________________________
     488             : 
     489           0 : void StatusIndicator::impl_recalcLayout ( const WindowEvent& aEvent )
     490             : {
     491             :     sal_Int32   nX_ProgressBar          ;
     492             :     sal_Int32   nY_ProgressBar          ;
     493             :     sal_Int32   nWidth_ProgressBar      ;
     494             :     sal_Int32   nHeight_ProgressBar     ;
     495             :     sal_Int32   nX_Text                 ;
     496             :     sal_Int32   nY_Text                 ;
     497             :     sal_Int32   nWidth_Text             ;
     498             :     sal_Int32   nHeight_Text            ;
     499             : 
     500             :     // Ready for multithreading
     501           0 :     MutexGuard aGuard ( m_aMutex ) ;
     502             : 
     503             :     // get information about required place of child controls
     504           0 :     Size                            aWindowSize     ( aEvent.Width, aEvent.Height );
     505           0 :     Reference< XLayoutConstrains >  xTextLayout     ( m_xText, UNO_QUERY );
     506           0 :     Size                            aTextSize       = xTextLayout->getPreferredSize();
     507             : 
     508           0 :     if( aWindowSize.Width < STATUSINDICATOR_DEFAULT_WIDTH )
     509             :     {
     510           0 :         aWindowSize.Width = STATUSINDICATOR_DEFAULT_WIDTH;
     511             :     }
     512           0 :     if( aWindowSize.Height < STATUSINDICATOR_DEFAULT_HEIGHT )
     513             :     {
     514           0 :         aWindowSize.Height = STATUSINDICATOR_DEFAULT_HEIGHT;
     515             :     }
     516             : 
     517             :     // calc position and size of child controls
     518           0 :     nX_Text             = STATUSINDICATOR_FREEBORDER                                    ;
     519           0 :     nY_Text             = STATUSINDICATOR_FREEBORDER                                    ;
     520           0 :     nWidth_Text         = aTextSize.Width                               ;
     521           0 :     nHeight_Text        = aTextSize.Height                              ;
     522             : 
     523           0 :     nX_ProgressBar      = nX_Text+nWidth_Text+STATUSINDICATOR_FREEBORDER                ;
     524           0 :     nY_ProgressBar      = nY_Text                                       ;
     525           0 :     nWidth_ProgressBar  = aWindowSize.Width-nWidth_Text-(3*STATUSINDICATOR_FREEBORDER)  ;
     526           0 :     nHeight_ProgressBar = nHeight_Text                                  ;
     527             : 
     528             :     // Set new position and size on all controls
     529           0 :     Reference< XWindow >  xTextWindow       ( m_xText       , UNO_QUERY );
     530           0 :     Reference< XWindow >  xProgressWindow   ( m_xProgressBar, UNO_QUERY );
     531             : 
     532           0 :     xTextWindow->setPosSize     ( nX_Text       , nY_Text       , nWidth_Text       , nHeight_Text          , 15 ) ;
     533           0 :     xProgressWindow->setPosSize ( nX_ProgressBar, nY_ProgressBar, nWidth_ProgressBar, nHeight_ProgressBar   , 15 ) ;
     534           0 : }
     535             : 
     536             : }   // namespace unocontrols
     537             : 
     538             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10