Update ooo320-m1
[ooovba.git] / framework / inc / uielement / progressbarwrapper.hxx
blobb3942b56c2026f485ff1c4567ebfe6562c63b2c7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: progressbarwrapper.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _FRAMEWORK_UIELEMENT_PROGRESSBARWRAPPER_HXX_
32 #define _FRAMEWORK_UIELEMENT_PROGRESSBARWRAPPER_HXX_
34 //_________________________________________________________________________________________________________________
35 // my own includes
36 //_________________________________________________________________________________________________________________
38 #include <helper/uielementwrapperbase.hxx>
39 #include <threadhelp/threadhelpbase.hxx>
40 #include <macros/generic.hxx>
41 #include <macros/xinterface.hxx>
42 #include <macros/xtypeprovider.hxx>
43 #include <macros/debug.hxx>
45 //_________________________________________________________________________________________________________________
46 // interface includes
47 //_________________________________________________________________________________________________________________
48 #include <com/sun/star/task/XStatusIndicator.hpp>
49 #include <com/sun/star/awt/XWindow.hpp>
51 //_________________________________________________________________________________________________________________
52 // other includes
53 //_________________________________________________________________________________________________________________
54 #include <cppuhelper/weak.hxx>
55 #include <cppuhelper/weakref.hxx>
57 //_________________________________________________________________________________________________________________
58 // namespace
59 //_________________________________________________________________________________________________________________
61 namespace framework{
63 class ProgressBarWrapper : public UIElementWrapperBase
65 public:
66 //---------------------------------------------------------------------------------------------------------
67 // constructor / destructor
68 //---------------------------------------------------------------------------------------------------------
69 ProgressBarWrapper();
70 virtual ~ProgressBarWrapper();
72 // public interfaces
73 void setStatusBar( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& rStatusBar, sal_Bool bOwnsInstance = sal_False );
74 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > getStatusBar() const;
76 // wrapped methods of ::com::sun::star::task::XStatusIndicator
77 void start( const ::rtl::OUString& Text, ::sal_Int32 Range ) throw (::com::sun::star::uno::RuntimeException);
78 void end() throw (::com::sun::star::uno::RuntimeException);
79 void setText( const ::rtl::OUString& Text ) throw (::com::sun::star::uno::RuntimeException);
80 void setValue( ::sal_Int32 Value ) throw (::com::sun::star::uno::RuntimeException);
81 void reset() throw (::com::sun::star::uno::RuntimeException);
83 // UNO interfaces
84 // XComponent
85 virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
87 // XInitialization
88 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
90 // XUpdatable
91 virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
93 // XUIElement
94 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getRealInterface() throw (::com::sun::star::uno::RuntimeException);
96 //-------------------------------------------------------------------------------------------------------------
97 // variables
98 // (should be private everyway!)
99 //-------------------------------------------------------------------------------------------------------------
100 private:
101 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xStatusBar; // Reference to our status bar XWindow
102 ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface > m_xProgressBarIfacWrapper;
103 sal_Bool m_bOwnsInstance; // Indicator that we are owner of the XWindow
104 sal_Int32 m_nRange;
105 sal_Int32 m_nValue;
106 rtl::OUString m_aText;
107 }; // class ProgressBarWrapper
109 } // namespace framework
111 #endif // _FRAMEWORK_UIELEMENT_PROGRESSBARWRAPPER_HXX_