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