1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <uielement/statusindicatorinterfacewrapper.hxx>
21 #include <uielement/progressbarwrapper.hxx>
23 #include <vcl/svapp.hxx>
24 #include <osl/mutex.hxx>
27 using namespace com::sun::star::uno
;
28 using namespace com::sun::star::lang
;
29 using namespace com::sun::star::beans
;
34 StatusIndicatorInterfaceWrapper::StatusIndicatorInterfaceWrapper(
35 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>& rStatusIndicatorImpl
) :
36 m_xStatusIndicatorImpl( rStatusIndicatorImpl
)
40 StatusIndicatorInterfaceWrapper::~StatusIndicatorInterfaceWrapper()
44 void SAL_CALL
StatusIndicatorInterfaceWrapper::start(
45 const OUString
& sText
,
47 throw( ::com::sun::star::uno::RuntimeException
, std::exception
)
49 Reference
< XComponent
> xComp( m_xStatusIndicatorImpl
);
52 ProgressBarWrapper
* pProgressBar
= static_cast<ProgressBarWrapper
*>(xComp
.get());
54 pProgressBar
->start( sText
, nRange
);
58 void SAL_CALL
StatusIndicatorInterfaceWrapper::end()
59 throw( ::com::sun::star::uno::RuntimeException
, std::exception
)
61 Reference
< XComponent
> xComp( m_xStatusIndicatorImpl
);
64 ProgressBarWrapper
* pProgressBar
= static_cast<ProgressBarWrapper
*>(xComp
.get());
70 void SAL_CALL
StatusIndicatorInterfaceWrapper::reset()
71 throw( ::com::sun::star::uno::RuntimeException
, std::exception
)
73 Reference
< XComponent
> xComp( m_xStatusIndicatorImpl
);
76 ProgressBarWrapper
* pProgressBar
= static_cast<ProgressBarWrapper
*>(xComp
.get());
78 pProgressBar
->reset();
82 void SAL_CALL
StatusIndicatorInterfaceWrapper::setText(
83 const OUString
& sText
)
84 throw( ::com::sun::star::uno::RuntimeException
, std::exception
)
86 Reference
< XComponent
> xComp( m_xStatusIndicatorImpl
);
89 ProgressBarWrapper
* pProgressBar
= static_cast<ProgressBarWrapper
*>(xComp
.get());
91 pProgressBar
->setText( sText
);
95 void SAL_CALL
StatusIndicatorInterfaceWrapper::setValue(
97 throw( ::com::sun::star::uno::RuntimeException
, std::exception
)
99 Reference
< XComponent
> xComp( m_xStatusIndicatorImpl
);
102 ProgressBarWrapper
* pProgressBar
= static_cast<ProgressBarWrapper
*>(xComp
.get());
104 pProgressBar
->setValue( nValue
);
108 } // namespace framework
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */