xref: /aoo41x/main/sfx2/inc/progind.hxx (revision cdf0e10c)
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 #ifndef _SFX_PROGIND_HXX
28 #define _SFX_PROGIND_HXX
29 
30 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
31 #include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
32 #include <com/sun/star/task/XStatusIndicator.hpp>
33 #include <vcl/window.hxx>
34 #include <vcl/fixed.hxx>
35 #include <svtools/prgsbar.hxx>
36 #include <cppuhelper/weak.hxx>
37 #include <cppuhelper/implbase1.hxx>
38 
39 #include <sfx2/sfxuno.hxx>
40 
41 class SfxStatusInd_Impl : public cppu::WeakImplHelper1< ::com::sun::star::task::XStatusIndicator >
42 {
43 	long						nValue;
44 	long 						nRange;
45 	sal_uInt16					nProgressCount;
46 
47 friend class SfxPopupStatusIndicator;
48 	SfxPopupStatusIndicator*	pWindow;
49 
50 public:
51 
52 	SfxStatusInd_Impl();
53 
54 	// XStatusIndicator
55 	virtual void SAL_CALL start(const ::rtl::OUString& aText, sal_Int32 nRange) throw ( ::com::sun::star::uno::RuntimeException );
56 	virtual void SAL_CALL end(void) throw ( ::com::sun::star::uno::RuntimeException );
57 	virtual void SAL_CALL setText(const ::rtl::OUString& aText) throw ( ::com::sun::star::uno::RuntimeException );
58 	virtual void SAL_CALL setValue(sal_Int32 nValue) throw ( ::com::sun::star::uno::RuntimeException );
59 	virtual void SAL_CALL reset() throw ( ::com::sun::star::uno::RuntimeException );
60 };
61 
62 class SfxPopupStatusIndicator : public Window
63 {
64 friend class SfxStatusInd_Impl;
65 	FixedText					aTextBar;
66 	ProgressBar					aProgressBar;
67 	SfxStatusInd_Impl*			pInterface;
68 
69 public:
70 								SfxPopupStatusIndicator( Window* pParent );
71 								~SfxPopupStatusIndicator();
72 
73 	virtual void				MakeVisible( sal_Bool bVisible );
74 	virtual void				Resize();
75 	virtual void				Paint( const Rectangle& rRect );
76 	Size						CalcWindowSizePixel();
77 	::com::sun::star::task::XStatusIndicator*			GetInterface()
78 								{ return pInterface; }
79 };
80 
81 
82 #endif
83 
84