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