1*6d739b60SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*6d739b60SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*6d739b60SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*6d739b60SAndrew Rist * distributed with this work for additional information 6*6d739b60SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*6d739b60SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*6d739b60SAndrew Rist * "License"); you may not use this file except in compliance 9*6d739b60SAndrew Rist * with the License. You may obtain a copy of the License at 10*6d739b60SAndrew Rist * 11*6d739b60SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*6d739b60SAndrew Rist * 13*6d739b60SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*6d739b60SAndrew Rist * software distributed under the License is distributed on an 15*6d739b60SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*6d739b60SAndrew Rist * KIND, either express or implied. See the License for the 17*6d739b60SAndrew Rist * specific language governing permissions and limitations 18*6d739b60SAndrew Rist * under the License. 19*6d739b60SAndrew Rist * 20*6d739b60SAndrew Rist *************************************************************/ 21*6d739b60SAndrew Rist 22*6d739b60SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_framework.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 28cdf0e10cSrcweir // my own includes 29cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 30cdf0e10cSrcweir #include <uielement/statusindicatorinterfacewrapper.hxx> 31cdf0e10cSrcweir #include <uielement/progressbarwrapper.hxx> 32cdf0e10cSrcweir #include <threadhelp/resetableguard.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 35cdf0e10cSrcweir // other includes 36cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 37cdf0e10cSrcweir 38cdf0e10cSrcweir #include <vcl/svapp.hxx> 39cdf0e10cSrcweir #include <vos/mutex.hxx> 40cdf0e10cSrcweir 41cdf0e10cSrcweir using namespace cppu; 42cdf0e10cSrcweir using namespace com::sun::star::uno; 43cdf0e10cSrcweir using namespace com::sun::star::lang; 44cdf0e10cSrcweir using namespace com::sun::star::beans; 45cdf0e10cSrcweir 46cdf0e10cSrcweir namespace framework 47cdf0e10cSrcweir { 48cdf0e10cSrcweir 49cdf0e10cSrcweir StatusIndicatorInterfaceWrapper(const::com::sun::star::uno::Reference<::com::sun::star::lang::XComponent> & rStatusIndicatorImpl)50cdf0e10cSrcweirStatusIndicatorInterfaceWrapper::StatusIndicatorInterfaceWrapper( 51cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rStatusIndicatorImpl ) : 52cdf0e10cSrcweir m_xStatusIndicatorImpl( rStatusIndicatorImpl ) 53cdf0e10cSrcweir { 54cdf0e10cSrcweir } 55cdf0e10cSrcweir ~StatusIndicatorInterfaceWrapper()56cdf0e10cSrcweirStatusIndicatorInterfaceWrapper::~StatusIndicatorInterfaceWrapper() 57cdf0e10cSrcweir { 58cdf0e10cSrcweir } 59cdf0e10cSrcweir 60cdf0e10cSrcweir start(const::rtl::OUString & sText,sal_Int32 nRange)61cdf0e10cSrcweirvoid SAL_CALL StatusIndicatorInterfaceWrapper::start( 62cdf0e10cSrcweir const ::rtl::OUString& sText, 63cdf0e10cSrcweir sal_Int32 nRange ) 64cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException ) 65cdf0e10cSrcweir { 66cdf0e10cSrcweir Reference< XComponent > xComp( m_xStatusIndicatorImpl ); 67cdf0e10cSrcweir if ( xComp.is() ) 68cdf0e10cSrcweir { 69cdf0e10cSrcweir ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get(); 70cdf0e10cSrcweir if ( pProgressBar ) 71cdf0e10cSrcweir pProgressBar->start( sText, nRange ); 72cdf0e10cSrcweir } 73cdf0e10cSrcweir } 74cdf0e10cSrcweir end()75cdf0e10cSrcweirvoid SAL_CALL StatusIndicatorInterfaceWrapper::end() 76cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException ) 77cdf0e10cSrcweir { 78cdf0e10cSrcweir Reference< XComponent > xComp( m_xStatusIndicatorImpl ); 79cdf0e10cSrcweir if ( xComp.is() ) 80cdf0e10cSrcweir { 81cdf0e10cSrcweir ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get(); 82cdf0e10cSrcweir if ( pProgressBar ) 83cdf0e10cSrcweir pProgressBar->end(); 84cdf0e10cSrcweir } 85cdf0e10cSrcweir } 86cdf0e10cSrcweir reset()87cdf0e10cSrcweirvoid SAL_CALL StatusIndicatorInterfaceWrapper::reset() 88cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException ) 89cdf0e10cSrcweir { 90cdf0e10cSrcweir Reference< XComponent > xComp( m_xStatusIndicatorImpl ); 91cdf0e10cSrcweir if ( xComp.is() ) 92cdf0e10cSrcweir { 93cdf0e10cSrcweir ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get(); 94cdf0e10cSrcweir if ( pProgressBar ) 95cdf0e10cSrcweir pProgressBar->reset(); 96cdf0e10cSrcweir } 97cdf0e10cSrcweir } 98cdf0e10cSrcweir setText(const::rtl::OUString & sText)99cdf0e10cSrcweirvoid SAL_CALL StatusIndicatorInterfaceWrapper::setText( 100cdf0e10cSrcweir const ::rtl::OUString& sText ) 101cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException ) 102cdf0e10cSrcweir { 103cdf0e10cSrcweir Reference< XComponent > xComp( m_xStatusIndicatorImpl ); 104cdf0e10cSrcweir if ( xComp.is() ) 105cdf0e10cSrcweir { 106cdf0e10cSrcweir ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get(); 107cdf0e10cSrcweir if ( pProgressBar ) 108cdf0e10cSrcweir pProgressBar->setText( sText ); 109cdf0e10cSrcweir } 110cdf0e10cSrcweir } 111cdf0e10cSrcweir setValue(sal_Int32 nValue)112cdf0e10cSrcweirvoid SAL_CALL StatusIndicatorInterfaceWrapper::setValue( 113cdf0e10cSrcweir sal_Int32 nValue ) 114cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException ) 115cdf0e10cSrcweir { 116cdf0e10cSrcweir Reference< XComponent > xComp( m_xStatusIndicatorImpl ); 117cdf0e10cSrcweir if ( xComp.is() ) 118cdf0e10cSrcweir { 119cdf0e10cSrcweir ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get(); 120cdf0e10cSrcweir if ( pProgressBar ) 121cdf0e10cSrcweir pProgressBar->setValue( nValue ); 122cdf0e10cSrcweir } 123cdf0e10cSrcweir } 124cdf0e10cSrcweir 125cdf0e10cSrcweir } // namespace framework 126cdf0e10cSrcweir 127