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