LCOV - code coverage report
Current view: top level - svtools/source/uno/wizard - unowizard.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 191 0.0 %
Date: 2012-08-25 Functions: 0 33 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 395 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       4                 :            :  *
       5                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       6                 :            :  *
       7                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       8                 :            :  *
       9                 :            :  * This file is part of OpenOffice.org.
      10                 :            :  *
      11                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      12                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      13                 :            :  * only, as published by the Free Software Foundation.
      14                 :            :  *
      15                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      16                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      17                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      18                 :            :  * GNU Lesser General Public License version 3 for more details
      19                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      20                 :            :  *
      21                 :            :  * You should have received a copy of the GNU Lesser General Public License
      22                 :            :  * version 3 along with OpenOffice.org.  If not, see
      23                 :            :  * <http://www.openoffice.org/license.html>
      24                 :            :  * for a copy of the LGPLv3 License.
      25                 :            :  *
      26                 :            :  ************************************************************************/
      27                 :            : 
      28                 :            : 
      29                 :            : #include "../unowizard.hxx"
      30                 :            : #include "wizardshell.hxx"
      31                 :            : 
      32                 :            : #include <com/sun/star/lang/XInitialization.hpp>
      33                 :            : #include <com/sun/star/beans/XPropertySetInfo.hpp>
      34                 :            : #include <com/sun/star/uno/XComponentContext.hpp>
      35                 :            : #include <com/sun/star/ucb/AlreadyInitializedException.hpp>
      36                 :            : #include <com/sun/star/ui/dialogs/XWizardController.hpp>
      37                 :            : #include <com/sun/star/ui/dialogs/WizardButton.hpp>
      38                 :            : 
      39                 :            : #include <tools/diagnose_ex.h>
      40                 :            : #include <rtl/strbuf.hxx>
      41                 :            : #include <osl/mutex.hxx>
      42                 :            : #include <vcl/svapp.hxx>
      43                 :            : #include <tools/urlobj.hxx>
      44                 :            : 
      45                 :            : //......................................................................................................................
      46                 :            : namespace svt { namespace uno
      47                 :            : {
      48                 :            : //......................................................................................................................
      49                 :            : 
      50                 :            :     /** === begin UNO using === **/
      51                 :            :     using ::com::sun::star::uno::Reference;
      52                 :            :     using ::com::sun::star::uno::XInterface;
      53                 :            :     using ::com::sun::star::uno::UNO_QUERY;
      54                 :            :     using ::com::sun::star::uno::UNO_QUERY_THROW;
      55                 :            :     using ::com::sun::star::uno::UNO_SET_THROW;
      56                 :            :     using ::com::sun::star::uno::Exception;
      57                 :            :     using ::com::sun::star::uno::RuntimeException;
      58                 :            :     using ::com::sun::star::uno::Any;
      59                 :            :     using ::com::sun::star::uno::makeAny;
      60                 :            :     using ::com::sun::star::uno::Sequence;
      61                 :            :     using ::com::sun::star::uno::Type;
      62                 :            :     using ::com::sun::star::lang::XServiceInfo;
      63                 :            :     using ::com::sun::star::ui::dialogs::XWizard;
      64                 :            :     using ::com::sun::star::lang::XInitialization;
      65                 :            :     using ::com::sun::star::beans::XPropertySetInfo;
      66                 :            :     using ::com::sun::star::uno::XComponentContext;
      67                 :            :     using ::com::sun::star::beans::Property;
      68                 :            :     using ::com::sun::star::lang::IllegalArgumentException;
      69                 :            :     using ::com::sun::star::ucb::AlreadyInitializedException;
      70                 :            :     using ::com::sun::star::ui::dialogs::XWizardController;
      71                 :            :     using ::com::sun::star::ui::dialogs::XWizardPage;
      72                 :            :     using ::com::sun::star::container::NoSuchElementException;
      73                 :            :     using ::com::sun::star::util::InvalidStateException;
      74                 :            :     using ::com::sun::star::awt::XWindow;
      75                 :            :     /** === end UNO using === **/
      76                 :            :     namespace WizardButton = ::com::sun::star::ui::dialogs::WizardButton;
      77                 :            : 
      78                 :            :     //------------------------------------------------------------------------------------------------------------------
      79                 :            :     namespace
      80                 :            :     {
      81                 :          0 :         sal_uInt32 lcl_convertWizardButtonToWZB( const sal_Int16 i_nWizardButton )
      82                 :            :         {
      83   [ #  #  #  #  :          0 :             switch ( i_nWizardButton )
                #  #  # ]
      84                 :            :             {
      85                 :          0 :             case WizardButton::NONE:        return WZB_NONE;
      86                 :          0 :             case WizardButton::NEXT:        return WZB_NEXT;
      87                 :          0 :             case WizardButton::PREVIOUS:    return WZB_PREVIOUS;
      88                 :          0 :             case WizardButton::FINISH:      return WZB_FINISH;
      89                 :          0 :             case WizardButton::CANCEL:      return WZB_CANCEL;
      90                 :          0 :             case WizardButton::HELP:        return WZB_HELP;
      91                 :            :             }
      92                 :            :             OSL_FAIL( "lcl_convertWizardButtonToWZB: invalid WizardButton constant!" );
      93                 :          0 :             return WZB_NONE;
      94                 :            :         }
      95                 :            :     }
      96                 :            : 
      97                 :            :     //==================================================================================================================
      98                 :            :     //= Wizard - implementation
      99                 :            :     //==================================================================================================================
     100                 :            :     //------------------------------------------------------------------------------------------------------------------
     101                 :          0 :     Wizard::Wizard( const Reference< XComponentContext >& _rxContext )
     102                 :            :         :Wizard_Base( _rxContext )
     103 [ #  # ][ #  # ]:          0 :         ,m_aContext( _rxContext )
                 [ #  # ]
     104                 :            :     {
     105                 :          0 :     }
     106                 :            : 
     107                 :            :     //--------------------------------------------------------------------
     108 [ #  # ][ #  # ]:          0 :     Wizard::~Wizard()
                 [ #  # ]
     109                 :            :     {
     110                 :            :         // we do this here cause the base class' call to destroyDialog won't reach us anymore : we're within an dtor,
     111                 :            :         // so this virtual-method-call the base class does does not work, we're already dead then ...
     112         [ #  # ]:          0 :         if ( m_pDialog )
     113                 :            :         {
     114         [ #  # ]:          0 :             ::osl::MutexGuard aGuard( m_aMutex );
     115         [ #  # ]:          0 :             if ( m_pDialog )
     116 [ #  # ][ #  # ]:          0 :                 destroyDialog();
     117                 :            :         }
     118         [ #  # ]:          0 :     }
     119                 :            : 
     120                 :            :     //--------------------------------------------------------------------
     121                 :          0 :     Reference< XInterface > SAL_CALL Wizard::Create( const Reference< XComponentContext >& _rxContext )
     122                 :            :     {
     123         [ #  # ]:          0 :         return *(new Wizard( _rxContext ) );
     124                 :            :     }
     125                 :            : 
     126                 :            :     //--------------------------------------------------------------------
     127                 :            :     namespace
     128                 :            :     {
     129                 :          0 :         static void lcl_checkPaths( const Sequence< Sequence< sal_Int16 > >& i_rPaths, const Reference< XInterface >& i_rContext )
     130                 :            :         {
     131                 :            :             // need at least one path
     132         [ #  # ]:          0 :             if ( i_rPaths.getLength() == 0 )
     133         [ #  # ]:          0 :                 throw IllegalArgumentException( ::rtl::OUString(), i_rContext, 2 );
     134                 :            : 
     135                 :            :             // each path must be of length 1, at least
     136         [ #  # ]:          0 :             for ( sal_Int32 i = 0; i < i_rPaths.getLength(); ++i )
     137                 :            :             {
     138         [ #  # ]:          0 :                 if ( i_rPaths[i].getLength() == 0 )
     139         [ #  # ]:          0 :                     throw IllegalArgumentException( ::rtl::OUString(), i_rContext, 2 );
     140                 :            : 
     141                 :            :                 // page IDs must be in ascending order
     142                 :          0 :                 sal_Int16 nPreviousPageID = i_rPaths[i][0];
     143         [ #  # ]:          0 :                 for ( sal_Int32 j=1; j<i_rPaths[i].getLength(); ++j )
     144                 :            :                 {
     145         [ #  # ]:          0 :                     if ( i_rPaths[i][j] <= nPreviousPageID )
     146                 :            :                     {
     147                 :          0 :                         ::rtl::OStringBuffer message;
     148         [ #  # ]:          0 :                         message.append( "Path " );
     149         [ #  # ]:          0 :                         message.append( i );
     150         [ #  # ]:          0 :                         message.append( ": invalid page ID sequence - each page ID must be greater than the previous one." );
     151                 :            :                         throw IllegalArgumentException(
     152                 :            :                             ::rtl::OStringToOUString( message.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US ),
     153 [ #  # ][ #  # ]:          0 :                             i_rContext, 2 );
     154                 :            :                     }
     155                 :          0 :                     nPreviousPageID = i_rPaths[i][j];
     156                 :            :                 }
     157                 :            :             }
     158                 :            : 
     159                 :            :             // if we have one path, that's okay
     160         [ #  # ]:          0 :             if ( i_rPaths.getLength() == 1 )
     161                 :          0 :                 return;
     162                 :            : 
     163                 :            :             // if we have multiple paths, they must start with the same page id
     164                 :          0 :             const sal_Int16 nFirstPageId = i_rPaths[0][0];
     165         [ #  # ]:          0 :             for ( sal_Int32 i = 0; i < i_rPaths.getLength(); ++i )
     166                 :            :             {
     167         [ #  # ]:          0 :                 if ( i_rPaths[i][0] != nFirstPageId )
     168                 :            :                     throw IllegalArgumentException(
     169                 :            :                         ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "All paths must start with the same page id." ) ),
     170 [ #  # ][ #  # ]:          0 :                         i_rContext, 2 );
     171                 :            :             }
     172                 :            :         }
     173                 :            :     }
     174                 :            : 
     175                 :            :     //--------------------------------------------------------------------
     176                 :          0 :     void SAL_CALL Wizard::initialize( const Sequence< Any >& i_Arguments ) throw (Exception, RuntimeException)
     177                 :            :     {
     178         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     179         [ #  # ]:          0 :         if ( m_bInitialized )
     180 [ #  # ][ #  # ]:          0 :             throw AlreadyInitializedException( ::rtl::OUString(), *this );
     181                 :            : 
     182         [ #  # ]:          0 :         if ( i_Arguments.getLength() != 2 )
     183 [ #  # ][ #  # ]:          0 :             throw IllegalArgumentException( ::rtl::OUString(), *this, -1 );
     184                 :            : 
     185                 :            :         // the second argument must be a XWizardController, for each constructor
     186         [ #  # ]:          0 :         m_xController.set( i_Arguments[1], UNO_QUERY );
     187         [ #  # ]:          0 :         if ( !m_xController.is() )
     188 [ #  # ][ #  # ]:          0 :             throw IllegalArgumentException( ::rtl::OUString(), *this, 2 );
     189                 :            : 
     190                 :            :         // the first arg is either a single path (short[]), or multiple paths (short[][])
     191         [ #  # ]:          0 :         Sequence< sal_Int16 > aSinglePath;
     192         [ #  # ]:          0 :         i_Arguments[0] >>= aSinglePath;
     193         [ #  # ]:          0 :         Sequence< Sequence< sal_Int16 > > aMultiplePaths;
     194         [ #  # ]:          0 :         i_Arguments[0] >>= aMultiplePaths;
     195                 :            : 
     196         [ #  # ]:          0 :         if ( !aMultiplePaths.getLength() )
     197                 :            :         {
     198         [ #  # ]:          0 :             aMultiplePaths.realloc(1);
     199 [ #  # ][ #  # ]:          0 :             aMultiplePaths[0] = aSinglePath;
     200                 :            :         }
     201 [ #  # ][ #  # ]:          0 :         lcl_checkPaths( aMultiplePaths, *this );
     202                 :            :         // if we survived this, the paths are valid, and we're done here ...
     203         [ #  # ]:          0 :         m_aWizardSteps = aMultiplePaths;
     204                 :            : 
     205 [ #  # ][ #  # ]:          0 :         m_bInitialized = true;
                 [ #  # ]
     206                 :          0 :     }
     207                 :            : 
     208                 :          0 :     static rtl::OString lcl_getHelpId( const ::rtl::OUString& _rHelpURL )
     209                 :            :     {
     210         [ #  # ]:          0 :         INetURLObject aHID( _rHelpURL );
     211         [ #  # ]:          0 :         if ( aHID.GetProtocol() == INET_PROT_HID )
     212 [ #  # ][ #  # ]:          0 :             return rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 );
     213                 :            :         else
     214 [ #  # ][ #  # ]:          0 :             return rtl::OUStringToOString( _rHelpURL, RTL_TEXTENCODING_UTF8 );
     215                 :            :     }
     216                 :            : 
     217                 :            :     //------------------------------------------------------------------------
     218                 :          0 :     static ::rtl::OUString lcl_getHelpURL( const rtl::OString& sHelpId )
     219                 :            :     {
     220                 :          0 :         ::rtl::OUStringBuffer aBuffer;
     221                 :            :         ::rtl::OUString aTmp(
     222         [ #  # ]:          0 :             rtl::OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 ) );
     223         [ #  # ]:          0 :         INetURLObject aHID( aTmp );
     224         [ #  # ]:          0 :         if ( aHID.GetProtocol() == INET_PROT_NOT_VALID )
     225         [ #  # ]:          0 :             aBuffer.appendAscii( INET_HID_SCHEME );
     226         [ #  # ]:          0 :         aBuffer.append( aTmp.getStr() );
     227 [ #  # ][ #  # ]:          0 :         return aBuffer.makeStringAndClear();
     228                 :            :     }
     229                 :            : 
     230                 :            :     //--------------------------------------------------------------------
     231                 :          0 :     Dialog* Wizard::createDialog( Window* i_pParent )
     232                 :            :     {
     233 [ #  # ][ #  # ]:          0 :         WizardShell* pDialog( new WizardShell( i_pParent, this, m_xController, m_aWizardSteps ) );
     234         [ #  # ]:          0 :         pDialog->SetHelpId(  lcl_getHelpId( m_sHelpURL ) );
     235         [ #  # ]:          0 :         pDialog->setTitleBase( m_sTitle );
     236                 :          0 :         return pDialog;
     237                 :            :     }
     238                 :            : 
     239                 :            :     //--------------------------------------------------------------------
     240                 :          0 :     void Wizard::destroyDialog()
     241                 :            :     {
     242         [ #  # ]:          0 :         if ( m_pDialog )
     243                 :          0 :             m_sHelpURL = lcl_getHelpURL( m_pDialog->GetHelpId() );
     244                 :            : 
     245                 :          0 :         Wizard_Base::destroyDialog();
     246                 :          0 :     }
     247                 :            : 
     248                 :            :     //--------------------------------------------------------------------
     249                 :          0 :     ::rtl::OUString SAL_CALL Wizard::getImplementationName_static() throw(RuntimeException)
     250                 :            :     {
     251                 :          0 :         return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svtools.uno.Wizard" ) );
     252                 :            :     }
     253                 :            : 
     254                 :            :     //--------------------------------------------------------------------
     255                 :          0 :     Sequence< ::rtl::OUString > SAL_CALL Wizard::getSupportedServiceNames_static() throw(RuntimeException)
     256                 :            :     {
     257                 :          0 :         Sequence< ::rtl::OUString > aServices(1);
     258 [ #  # ][ #  # ]:          0 :         aServices[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.Wizard" ) );
     259                 :          0 :         return aServices;
     260                 :            :     }
     261                 :            : 
     262                 :            :     //--------------------------------------------------------------------
     263                 :          0 :     ::rtl::OUString SAL_CALL Wizard::getImplementationName() throw(RuntimeException)
     264                 :            :     {
     265                 :          0 :         return getImplementationName_static();
     266                 :            :     }
     267                 :            : 
     268                 :            :     //--------------------------------------------------------------------
     269                 :          0 :     Sequence< ::rtl::OUString > SAL_CALL Wizard::getSupportedServiceNames() throw(RuntimeException)
     270                 :            :     {
     271                 :          0 :         return getSupportedServiceNames_static();
     272                 :            :     }
     273                 :            : 
     274                 :            :     //--------------------------------------------------------------------
     275                 :          0 :     Reference< XPropertySetInfo > SAL_CALL Wizard::getPropertySetInfo() throw(RuntimeException)
     276                 :            :     {
     277                 :          0 :         return createPropertySetInfo( getInfoHelper() );
     278                 :            :     }
     279                 :            : 
     280                 :            :     //--------------------------------------------------------------------
     281                 :          0 :     ::cppu::IPropertyArrayHelper& SAL_CALL Wizard::getInfoHelper()
     282                 :            :     {
     283                 :          0 :         return *const_cast< Wizard* >( this )->getArrayHelper();
     284                 :            :     }
     285                 :            : 
     286                 :            :     //--------------------------------------------------------------------
     287                 :          0 :     ::cppu::IPropertyArrayHelper* Wizard::createArrayHelper( ) const
     288                 :            :     {
     289         [ #  # ]:          0 :         Sequence< Property > aProps;
     290         [ #  # ]:          0 :         describeProperties( aProps );
     291 [ #  # ][ #  # ]:          0 :         return new ::cppu::OPropertyArrayHelper( aProps );
     292                 :            :     }
     293                 :            : 
     294                 :            :     //------------------------------------------------------------------------------------------------------------------
     295                 :          0 :     ::rtl::OUString SAL_CALL Wizard::getHelpURL() throw (RuntimeException)
     296                 :            :     {
     297         [ #  # ]:          0 :         SolarMutexGuard aSolarGuard;
     298         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     299                 :            : 
     300         [ #  # ]:          0 :         if ( !m_pDialog )
     301                 :          0 :             return m_sHelpURL;
     302                 :            : 
     303 [ #  # ][ #  # ]:          0 :         return lcl_getHelpURL( m_pDialog->GetHelpId() );
         [ #  # ][ #  # ]
     304                 :            :     }
     305                 :            : 
     306                 :            :     //------------------------------------------------------------------------------------------------------------------
     307                 :          0 :     void SAL_CALL Wizard::setHelpURL( const ::rtl::OUString& i_HelpURL ) throw (RuntimeException)
     308                 :            :     {
     309         [ #  # ]:          0 :         SolarMutexGuard aSolarGuard;
     310         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     311                 :            : 
     312         [ #  # ]:          0 :         if ( !m_pDialog )
     313                 :          0 :             m_sHelpURL = i_HelpURL;
     314                 :            :         else
     315 [ #  # ][ #  # ]:          0 :             m_pDialog->SetHelpId( lcl_getHelpId( i_HelpURL ) );
         [ #  # ][ #  # ]
     316                 :          0 :     }
     317                 :            : 
     318                 :            :     //------------------------------------------------------------------------------------------------------------------
     319                 :          0 :     Reference< XWindow > SAL_CALL Wizard::getDialogWindow() throw (RuntimeException)
     320                 :            :     {
     321         [ #  # ]:          0 :         SolarMutexGuard aSolarGuard;
     322         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     323                 :            : 
     324 [ #  # ][ #  # ]:          0 :         ENSURE_OR_RETURN( m_pDialog, "Wizard::getDialogWindow: illegal call (execution did not start, yet)!", NULL );
     325 [ #  # ][ #  # ]:          0 :         return Reference< XWindow >( m_pDialog->GetComponentInterface(), UNO_QUERY );
         [ #  # ][ #  # ]
     326                 :            :     }
     327                 :            : 
     328                 :            :     //------------------------------------------------------------------------------------------------------------------
     329                 :          0 :     void SAL_CALL Wizard::enableButton( ::sal_Int16 i_WizardButton, ::sal_Bool i_Enable ) throw (RuntimeException)
     330                 :            :     {
     331         [ #  # ]:          0 :         SolarMutexGuard aSolarGuard;
     332         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     333                 :            : 
     334         [ #  # ]:          0 :         WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog );
     335         [ #  # ]:          0 :         ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::enableButtons: invalid dialog implementation!" );
     336                 :            : 
     337 [ #  # ][ #  # ]:          0 :         pWizardImpl->enableButtons( lcl_convertWizardButtonToWZB( i_WizardButton ), i_Enable );
         [ #  # ][ #  # ]
                 [ #  # ]
     338                 :            :     }
     339                 :            : 
     340                 :            :     //------------------------------------------------------------------------------------------------------------------
     341                 :          0 :     void SAL_CALL Wizard::setDefaultButton( ::sal_Int16 i_WizardButton ) throw (RuntimeException)
     342                 :            :     {
     343         [ #  # ]:          0 :         SolarMutexGuard aSolarGuard;
     344         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     345                 :            : 
     346         [ #  # ]:          0 :         WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog );
     347         [ #  # ]:          0 :         ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::setDefaultButton: invalid dialog implementation!" );
     348                 :            : 
     349 [ #  # ][ #  # ]:          0 :         pWizardImpl->defaultButton( lcl_convertWizardButtonToWZB( i_WizardButton ) );
         [ #  # ][ #  # ]
                 [ #  # ]
     350                 :            :     }
     351                 :            : 
     352                 :            :     //------------------------------------------------------------------------------------------------------------------
     353                 :          0 :     sal_Bool SAL_CALL Wizard::travelNext(  ) throw (RuntimeException)
     354                 :            :     {
     355         [ #  # ]:          0 :         SolarMutexGuard aSolarGuard;
     356         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     357                 :            : 
     358         [ #  # ]:          0 :         WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog );
     359         [ #  # ]:          0 :         ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::travelNext: invalid dialog implementation!" );
     360                 :            : 
     361 [ #  # ][ #  # ]:          0 :         return pWizardImpl->travelNext();
                 [ #  # ]
     362                 :            :     }
     363                 :            : 
     364                 :            :     //------------------------------------------------------------------------------------------------------------------
     365                 :          0 :     sal_Bool SAL_CALL Wizard::travelPrevious(  ) throw (RuntimeException)
     366                 :            :     {
     367         [ #  # ]:          0 :         SolarMutexGuard aSolarGuard;
     368         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     369                 :            : 
     370         [ #  # ]:          0 :         WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog );
     371         [ #  # ]:          0 :         ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::travelPrevious: invalid dialog implementation!" );
     372                 :            : 
     373 [ #  # ][ #  # ]:          0 :         return pWizardImpl->travelPrevious();
                 [ #  # ]
     374                 :            :     }
     375                 :            : 
     376                 :            :     //------------------------------------------------------------------------------------------------------------------
     377                 :          0 :     void SAL_CALL Wizard::enablePage( ::sal_Int16 i_PageID, ::sal_Bool i_Enable ) throw (NoSuchElementException, InvalidStateException, RuntimeException)
     378                 :            :     {
     379         [ #  # ]:          0 :         SolarMutexGuard aSolarGuard;
     380         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     381                 :            : 
     382         [ #  # ]:          0 :         WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog );
     383         [ #  # ]:          0 :         ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::enablePage: invalid dialog implementation!" );
     384                 :            : 
     385 [ #  # ][ #  # ]:          0 :         if ( !pWizardImpl->knowsPage( i_PageID ) )
     386 [ #  # ][ #  # ]:          0 :             throw NoSuchElementException( ::rtl::OUString(), *this );
     387                 :            : 
     388 [ #  # ][ #  # ]:          0 :         if ( i_PageID == pWizardImpl->getCurrentPage() )
     389 [ #  # ][ #  # ]:          0 :             throw InvalidStateException( ::rtl::OUString(), *this );
     390                 :            : 
     391 [ #  # ][ #  # ]:          0 :         pWizardImpl->enablePage( i_PageID, i_Enable );
         [ #  # ][ #  # ]
                 [ #  # ]
     392                 :            :     }
     393                 :            : 
     394                 :            :     //------------------------------------------------------------------------------------------------------------------
     395                 :          0 :     void SAL_CALL Wizard::updateTravelUI(  ) throw (RuntimeException)
     396                 :            :     {
     397         [ #  # ]:          0 :         SolarMutexGuard aSolarGuard;
     398         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     399                 :            : 
     400         [ #  # ]:          0 :         WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog );
     401         [ #  # ]:          0 :         ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::updateTravelUI: invalid dialog implementation!" );
     402                 :            : 
     403 [ #  # ][ #  # ]:          0 :         pWizardImpl->updateTravelUI();
         [ #  # ][ #  # ]
                 [ #  # ]
     404                 :            :     }
     405                 :            : 
     406                 :            :     //------------------------------------------------------------------------------------------------------------------
     407                 :          0 :     ::sal_Bool SAL_CALL Wizard::advanceTo( ::sal_Int16 i_PageId ) throw (RuntimeException)
     408                 :            :     {
     409         [ #  # ]:          0 :         SolarMutexGuard aSolarGuard;
     410         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     411                 :            : 
     412         [ #  # ]:          0 :         WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog );
     413         [ #  # ]:          0 :         ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::advanceTo: invalid dialog implementation!" );
     414                 :            : 
     415 [ #  # ][ #  # ]:          0 :         return pWizardImpl->advanceTo( i_PageId );
                 [ #  # ]
     416                 :            :     }
     417                 :            : 
     418                 :            :     //------------------------------------------------------------------------------------------------------------------
     419                 :          0 :     ::sal_Bool SAL_CALL Wizard::goBackTo( ::sal_Int16 i_PageId ) throw (RuntimeException)
     420                 :            :     {
     421         [ #  # ]:          0 :         SolarMutexGuard aSolarGuard;
     422         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     423                 :            : 
     424         [ #  # ]:          0 :         WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog );
     425         [ #  # ]:          0 :         ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::goBackTo: invalid dialog implementation!" );
     426                 :            : 
     427 [ #  # ][ #  # ]:          0 :         return pWizardImpl->goBackTo( i_PageId );
                 [ #  # ]
     428                 :            :     }
     429                 :            : 
     430                 :            :     //------------------------------------------------------------------------------------------------------------------
     431                 :          0 :     Reference< XWizardPage > SAL_CALL Wizard::getCurrentPage(  ) throw (RuntimeException)
     432                 :            :     {
     433         [ #  # ]:          0 :         SolarMutexGuard aSolarGuard;
     434         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     435                 :            : 
     436         [ #  # ]:          0 :         WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog );
     437         [ #  # ]:          0 :         ENSURE_OR_RETURN( pWizardImpl, "Wizard::getCurrentPage: invalid dialog implementation!", Reference< XWizardPage >() );
     438                 :            : 
     439 [ #  # ][ #  # ]:          0 :         return pWizardImpl->getCurrentWizardPage();
                 [ #  # ]
     440                 :            :     }
     441                 :            : 
     442                 :            :     //------------------------------------------------------------------------------------------------------------------
     443                 :          0 :     void SAL_CALL Wizard::activatePath( ::sal_Int16 i_PathIndex, ::sal_Bool i_Final ) throw (NoSuchElementException, InvalidStateException, RuntimeException)
     444                 :            :     {
     445         [ #  # ]:          0 :         SolarMutexGuard aSolarGuard;
     446         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     447                 :            : 
     448 [ #  # ][ #  # ]:          0 :         if ( ( i_PathIndex < 0 ) || ( i_PathIndex >= m_aWizardSteps.getLength() ) )
                 [ #  # ]
     449 [ #  # ][ #  # ]:          0 :             throw NoSuchElementException( ::rtl::OUString(), *this );
     450                 :            : 
     451         [ #  # ]:          0 :         WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog );
     452         [ #  # ]:          0 :         ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::activatePath: invalid dialog implementation!" );
     453                 :            : 
     454 [ #  # ][ #  # ]:          0 :         pWizardImpl->activatePath( i_PathIndex, i_Final );
         [ #  # ][ #  # ]
                 [ #  # ]
     455                 :            :     }
     456                 :            : 
     457                 :            :     //------------------------------------------------------------------------------------------------------------------
     458                 :          0 :     void SAL_CALL Wizard::setTitle( const ::rtl::OUString& i_Title ) throw (RuntimeException)
     459                 :            :     {
     460                 :            :         // simply disambiguate
     461                 :          0 :         Wizard_Base::OGenericUnoDialog::setTitle( i_Title );
     462                 :          0 :     }
     463                 :            : 
     464                 :            :     //------------------------------------------------------------------------------------------------------------------
     465                 :          0 :     ::sal_Int16 SAL_CALL Wizard::execute(  ) throw (RuntimeException)
     466                 :            :     {
     467                 :          0 :         return Wizard_Base::OGenericUnoDialog::execute();
     468                 :            :     }
     469                 :            : 
     470                 :            : //......................................................................................................................
     471                 :            : } } // namespace svt::uno
     472                 :            : //......................................................................................................................
     473                 :            : 
     474                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10