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 <uielement/statusindicatorinterfacewrapper.hxx>
21 : #include <uielement/progressbarwrapper.hxx>
22 :
23 : #include <vcl/svapp.hxx>
24 : #include <osl/mutex.hxx>
25 :
26 : using namespace cppu;
27 : using namespace com::sun::star::uno;
28 : using namespace com::sun::star::lang;
29 : using namespace com::sun::star::beans;
30 :
31 : namespace framework
32 : {
33 :
34 5572 : StatusIndicatorInterfaceWrapper::StatusIndicatorInterfaceWrapper(
35 : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rStatusIndicatorImpl ) :
36 5572 : m_xStatusIndicatorImpl( rStatusIndicatorImpl )
37 : {
38 5572 : }
39 :
40 11132 : StatusIndicatorInterfaceWrapper::~StatusIndicatorInterfaceWrapper()
41 : {
42 11132 : }
43 :
44 4568 : void SAL_CALL StatusIndicatorInterfaceWrapper::start(
45 : const OUString& sText,
46 : sal_Int32 nRange )
47 : throw( ::com::sun::star::uno::RuntimeException, std::exception )
48 : {
49 4568 : Reference< XComponent > xComp( m_xStatusIndicatorImpl );
50 4568 : if ( xComp.is() )
51 : {
52 4568 : ProgressBarWrapper* pProgressBar = static_cast<ProgressBarWrapper*>(xComp.get());
53 4568 : if ( pProgressBar )
54 4568 : pProgressBar->start( sText, nRange );
55 4568 : }
56 4568 : }
57 :
58 4798 : void SAL_CALL StatusIndicatorInterfaceWrapper::end()
59 : throw( ::com::sun::star::uno::RuntimeException, std::exception )
60 : {
61 4798 : Reference< XComponent > xComp( m_xStatusIndicatorImpl );
62 4798 : if ( xComp.is() )
63 : {
64 4798 : ProgressBarWrapper* pProgressBar = static_cast<ProgressBarWrapper*>(xComp.get());
65 4798 : if ( pProgressBar )
66 4798 : pProgressBar->end();
67 4798 : }
68 4798 : }
69 :
70 1084 : void SAL_CALL StatusIndicatorInterfaceWrapper::reset()
71 : throw( ::com::sun::star::uno::RuntimeException, std::exception )
72 : {
73 1084 : Reference< XComponent > xComp( m_xStatusIndicatorImpl );
74 1084 : if ( xComp.is() )
75 : {
76 1084 : ProgressBarWrapper* pProgressBar = static_cast<ProgressBarWrapper*>(xComp.get());
77 1084 : if ( pProgressBar )
78 1084 : pProgressBar->reset();
79 1084 : }
80 1084 : }
81 :
82 0 : void SAL_CALL StatusIndicatorInterfaceWrapper::setText(
83 : const OUString& sText )
84 : throw( ::com::sun::star::uno::RuntimeException, std::exception )
85 : {
86 0 : Reference< XComponent > xComp( m_xStatusIndicatorImpl );
87 0 : if ( xComp.is() )
88 : {
89 0 : ProgressBarWrapper* pProgressBar = static_cast<ProgressBarWrapper*>(xComp.get());
90 0 : if ( pProgressBar )
91 0 : pProgressBar->setText( sText );
92 0 : }
93 0 : }
94 :
95 50805 : void SAL_CALL StatusIndicatorInterfaceWrapper::setValue(
96 : sal_Int32 nValue )
97 : throw( ::com::sun::star::uno::RuntimeException, std::exception )
98 : {
99 50805 : Reference< XComponent > xComp( m_xStatusIndicatorImpl );
100 50805 : if ( xComp.is() )
101 : {
102 50805 : ProgressBarWrapper* pProgressBar = static_cast<ProgressBarWrapper*>(xComp.get());
103 50805 : if ( pProgressBar )
104 50805 : pProgressBar->setValue( nValue );
105 50805 : }
106 50805 : }
107 :
108 951 : } // namespace framework
109 :
110 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|