merge the formfield patch from ooo-build
[ooovba.git] / framework / inc / helper / vclstatusindicator.hxx
blob0eb6508bb6a0716bc5962b35ee230b34c52bb436
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: vclstatusindicator.hxx,v $
10 * $Revision: 1.5 $
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_HELPER_VCLSTATUSINDICATOR_HXX_
32 #define __FRAMEWORK_HELPER_VCLSTATUSINDICATOR_HXX_
34 //-----------------------------------------------
35 // includes of own modules
37 #include <threadhelp/threadhelpbase.hxx>
38 #include <macros/generic.hxx>
39 #include <macros/xinterface.hxx>
40 #include <general.h>
42 //-----------------------------------------------
43 // includes of interfaces
44 #include <com/sun/star/task/XStatusIndicator.hpp>
45 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
46 #include <com/sun/star/awt/XWindow.hpp>
48 //-----------------------------------------------
49 // includes of external modules
50 #include <cppuhelper/weak.hxx>
51 #include <vcl/status.hxx>
53 //-----------------------------------------------
54 // namespace
56 namespace framework {
58 //-----------------------------------------------
59 // declaration
61 class VCLStatusIndicator : public css::task::XStatusIndicator
62 , private ThreadHelpBase // must be the first real base class!
63 , public ::cppu::OWeakObject
65 //-------------------------------------------
66 // member
68 private:
70 /** can be used to create own needed uno resources. */
71 css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
73 /** points to the parent window of this progress and
74 hold it alive. */
75 css::uno::Reference< css::awt::XWindow > m_xParentWindow;
77 /** shows the progress.
79 @attention This member isnt synchronized using our own mutex!
80 Its guarded by the solarmutex only. Otherwhise
81 we have to lock two of them, which can force a deadlock ...
83 StatusBar* m_pStatusBar;
85 /** knows the current info text of the progress. */
86 ::rtl::OUString m_sText;
88 /** knows the current range of the progress. */
89 sal_Int32 m_nRange;
91 /** knows the current value of the progress. */
92 sal_Int32 m_nValue;
94 //-------------------------------------------
95 // interface
97 public:
99 FWK_DECLARE_XINTERFACE
101 /// ctor
102 VCLStatusIndicator(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
103 const css::uno::Reference< css::awt::XWindow >& xParentWindow);
105 /// dtor
106 virtual ~VCLStatusIndicator();
108 /// XStatusIndicator
109 virtual void SAL_CALL start(const ::rtl::OUString& sText ,
110 sal_Int32 nRange)
111 throw(css::uno::RuntimeException);
113 virtual void SAL_CALL reset()
114 throw(css::uno::RuntimeException);
116 virtual void SAL_CALL end()
117 throw(css::uno::RuntimeException);
119 virtual void SAL_CALL setText(const ::rtl::OUString& sText)
120 throw(css::uno::RuntimeException);
122 virtual void SAL_CALL setValue(sal_Int32 nValue)
123 throw(css::uno::RuntimeException);
125 //-------------------------------------------
126 // helper
128 private:
130 static void impl_recalcLayout(Window* pStatusBar ,
131 Window* pParentWindow);
134 } // namespace framework
136 #endif // __FRAMEWORK_HELPER_VCLSTATUSINDICATOR_HXX_