xref: /AOO41X/main/sfx2/inc/progind.hxx (revision 353d8f4d17010cd2d0ea815067cad67e477f2bee)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SFX_PROGIND_HXX
24 #define _SFX_PROGIND_HXX
25 
26 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
27 #include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
28 #include <com/sun/star/task/XStatusIndicator.hpp>
29 #include <vcl/window.hxx>
30 #include <vcl/fixed.hxx>
31 #include <svtools/prgsbar.hxx>
32 #include <cppuhelper/weak.hxx>
33 #include <cppuhelper/implbase1.hxx>
34 
35 #include <sfx2/sfxuno.hxx>
36 
37 class SfxStatusInd_Impl : public cppu::WeakImplHelper1< ::com::sun::star::task::XStatusIndicator >
38 {
39     long                        nValue;
40     long                        nRange;
41     sal_uInt16                  nProgressCount;
42 
43 friend class SfxPopupStatusIndicator;
44     SfxPopupStatusIndicator*    pWindow;
45 
46 public:
47 
48     SfxStatusInd_Impl();
49 
50     // XStatusIndicator
51     virtual void SAL_CALL start(const ::rtl::OUString& aText, sal_Int32 nRange) throw ( ::com::sun::star::uno::RuntimeException );
52     virtual void SAL_CALL end(void) throw ( ::com::sun::star::uno::RuntimeException );
53     virtual void SAL_CALL setText(const ::rtl::OUString& aText) throw ( ::com::sun::star::uno::RuntimeException );
54     virtual void SAL_CALL setValue(sal_Int32 nValue) throw ( ::com::sun::star::uno::RuntimeException );
55     virtual void SAL_CALL reset() throw ( ::com::sun::star::uno::RuntimeException );
56 };
57 
58 class SfxPopupStatusIndicator : public Window
59 {
60 friend class SfxStatusInd_Impl;
61     FixedText                   aTextBar;
62     ProgressBar                 aProgressBar;
63     SfxStatusInd_Impl*          pInterface;
64 
65 public:
66                                 SfxPopupStatusIndicator( Window* pParent );
67                                 ~SfxPopupStatusIndicator();
68 
69     virtual void                MakeVisible( sal_Bool bVisible );
70     virtual void                Resize();
71     virtual void                Paint( const Rectangle& rRect );
72     Size                        CalcWindowSizePixel();
GetInterface()73     ::com::sun::star::task::XStatusIndicator*           GetInterface()
74                                 { return pInterface; }
75 };
76 
77 
78 #endif
79 
80