2010-10-12 08:53:47 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2004-09-09 11:12:01 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 03:19:45 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-09-09 11:12:01 -05:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2004-09-09 11:12:01 -05:00
|
|
|
*
|
2008-04-11 03:19:45 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-09-09 11:12:01 -05:00
|
|
|
*
|
2008-04-11 03:19:45 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-09-09 11:12:01 -05:00
|
|
|
*
|
2008-04-11 03:19:45 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2004-09-09 11:12:01 -05:00
|
|
|
*
|
2008-04-11 03:19:45 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2004-09-09 11:12:01 -05:00
|
|
|
*
|
2008-04-11 03:19:45 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2004-09-09 11:12:01 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 08:24:59 -05:00
|
|
|
|
2004-09-09 11:12:01 -05:00
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
// my own includes
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
#include <uielement/statusindicatorinterfacewrapper.hxx>
|
|
|
|
#include <uielement/progressbarwrapper.hxx>
|
|
|
|
#include <threadhelp/resetableguard.hxx>
|
|
|
|
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
// other includes
|
|
|
|
//_________________________________________________________________________________________________________________
|
|
|
|
|
|
|
|
#include <vcl/svapp.hxx>
|
2010-10-16 03:18:35 -05:00
|
|
|
#include <osl/mutex.hxx>
|
2004-09-09 11:12:01 -05:00
|
|
|
|
|
|
|
using namespace cppu;
|
|
|
|
using namespace com::sun::star::uno;
|
|
|
|
using namespace com::sun::star::lang;
|
|
|
|
using namespace com::sun::star::beans;
|
|
|
|
|
|
|
|
namespace framework
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
StatusIndicatorInterfaceWrapper::StatusIndicatorInterfaceWrapper(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rStatusIndicatorImpl ) :
|
2009-09-07 23:57:32 -05:00
|
|
|
m_xStatusIndicatorImpl( rStatusIndicatorImpl )
|
2004-09-09 11:12:01 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusIndicatorInterfaceWrapper::~StatusIndicatorInterfaceWrapper()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SAL_CALL StatusIndicatorInterfaceWrapper::start(
|
|
|
|
const ::rtl::OUString& sText,
|
|
|
|
sal_Int32 nRange )
|
|
|
|
throw( ::com::sun::star::uno::RuntimeException )
|
|
|
|
{
|
|
|
|
Reference< XComponent > xComp( m_xStatusIndicatorImpl );
|
|
|
|
if ( xComp.is() )
|
|
|
|
{
|
|
|
|
ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get();
|
|
|
|
if ( pProgressBar )
|
|
|
|
pProgressBar->start( sText, nRange );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL StatusIndicatorInterfaceWrapper::end()
|
|
|
|
throw( ::com::sun::star::uno::RuntimeException )
|
|
|
|
{
|
|
|
|
Reference< XComponent > xComp( m_xStatusIndicatorImpl );
|
|
|
|
if ( xComp.is() )
|
|
|
|
{
|
|
|
|
ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get();
|
|
|
|
if ( pProgressBar )
|
|
|
|
pProgressBar->end();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL StatusIndicatorInterfaceWrapper::reset()
|
|
|
|
throw( ::com::sun::star::uno::RuntimeException )
|
|
|
|
{
|
|
|
|
Reference< XComponent > xComp( m_xStatusIndicatorImpl );
|
|
|
|
if ( xComp.is() )
|
|
|
|
{
|
|
|
|
ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get();
|
|
|
|
if ( pProgressBar )
|
|
|
|
pProgressBar->reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL StatusIndicatorInterfaceWrapper::setText(
|
|
|
|
const ::rtl::OUString& sText )
|
|
|
|
throw( ::com::sun::star::uno::RuntimeException )
|
|
|
|
{
|
|
|
|
Reference< XComponent > xComp( m_xStatusIndicatorImpl );
|
|
|
|
if ( xComp.is() )
|
|
|
|
{
|
|
|
|
ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get();
|
|
|
|
if ( pProgressBar )
|
|
|
|
pProgressBar->setText( sText );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL StatusIndicatorInterfaceWrapper::setValue(
|
|
|
|
sal_Int32 nValue )
|
|
|
|
throw( ::com::sun::star::uno::RuntimeException )
|
|
|
|
{
|
|
|
|
Reference< XComponent > xComp( m_xStatusIndicatorImpl );
|
|
|
|
if ( xComp.is() )
|
|
|
|
{
|
|
|
|
ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get();
|
|
|
|
if ( pProgressBar )
|
|
|
|
pProgressBar->setValue( nValue );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace framework
|
2008-06-24 11:03:05 -05:00
|
|
|
|
2010-10-12 08:53:47 -05:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|