1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: progressbarwrapper.hxx,v $
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 //_________________________________________________________________________________________________________________
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 //_________________________________________________________________________________________________________________
47 //_________________________________________________________________________________________________________________
48 #include <com/sun/star/task/XStatusIndicator.hpp>
49 #include <com/sun/star/awt/XWindow.hpp>
51 //_________________________________________________________________________________________________________________
53 //_________________________________________________________________________________________________________________
54 #include <cppuhelper/weak.hxx>
55 #include <cppuhelper/weakref.hxx>
57 //_________________________________________________________________________________________________________________
59 //_________________________________________________________________________________________________________________
63 class ProgressBarWrapper
: public UIElementWrapperBase
66 //---------------------------------------------------------------------------------------------------------
67 // constructor / destructor
68 //---------------------------------------------------------------------------------------------------------
70 virtual ~ProgressBarWrapper();
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
);
85 virtual void SAL_CALL
dispose() throw (::com::sun::star::uno::RuntimeException
);
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
);
91 virtual void SAL_CALL
update() throw (::com::sun::star::uno::RuntimeException
);
94 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
getRealInterface() throw (::com::sun::star::uno::RuntimeException
);
96 //-------------------------------------------------------------------------------------------------------------
98 // (should be private everyway!)
99 //-------------------------------------------------------------------------------------------------------------
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
106 rtl::OUString m_aText
;
107 }; // class ProgressBarWrapper
109 } // namespace framework
111 #endif // _FRAMEWORK_UIELEMENT_PROGRESSBARWRAPPER_HXX_