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 516 : StatusIndicatorInterfaceWrapper::StatusIndicatorInterfaceWrapper(
37 : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rStatusIndicatorImpl ) :
38 516 : m_xStatusIndicatorImpl( rStatusIndicatorImpl )
39 : {
40 516 : }
41 :
42 196 : StatusIndicatorInterfaceWrapper::~StatusIndicatorInterfaceWrapper()
43 : {
44 196 : }
45 :
46 :
47 355 : void SAL_CALL StatusIndicatorInterfaceWrapper::start(
48 : const ::rtl::OUString& sText,
49 : sal_Int32 nRange )
50 : throw( ::com::sun::star::uno::RuntimeException )
51 : {
52 355 : Reference< XComponent > xComp( m_xStatusIndicatorImpl );
53 355 : if ( xComp.is() )
54 : {
55 355 : ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get();
56 355 : if ( pProgressBar )
57 355 : pProgressBar->start( sText, nRange );
58 355 : }
59 355 : }
60 :
61 361 : void SAL_CALL StatusIndicatorInterfaceWrapper::end()
62 : throw( ::com::sun::star::uno::RuntimeException )
63 : {
64 361 : Reference< XComponent > xComp( m_xStatusIndicatorImpl );
65 361 : if ( xComp.is() )
66 : {
67 361 : ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get();
68 361 : if ( pProgressBar )
69 361 : pProgressBar->end();
70 361 : }
71 361 : }
72 :
73 75 : void SAL_CALL StatusIndicatorInterfaceWrapper::reset()
74 : throw( ::com::sun::star::uno::RuntimeException )
75 : {
76 75 : Reference< XComponent > xComp( m_xStatusIndicatorImpl );
77 75 : if ( xComp.is() )
78 : {
79 75 : ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get();
80 75 : if ( pProgressBar )
81 75 : pProgressBar->reset();
82 75 : }
83 75 : }
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 10843 : void SAL_CALL StatusIndicatorInterfaceWrapper::setValue(
99 : sal_Int32 nValue )
100 : throw( ::com::sun::star::uno::RuntimeException )
101 : {
102 10843 : Reference< XComponent > xComp( m_xStatusIndicatorImpl );
103 10843 : if ( xComp.is() )
104 : {
105 10843 : ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get();
106 10843 : if ( pProgressBar )
107 10843 : pProgressBar->setValue( nValue );
108 10843 : }
109 10843 : }
110 :
111 : } // namespace framework
112 :
113 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|