xref: /trunk/main/svtools/inc/svtools/prgsbar.hxx (revision 01aa44aa)
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 
24 #ifndef _PRGSBAR_HXX
25 #define _PRGSBAR_HXX
26 
27 #include "svtools/svtdllapi.h"
28 #include <vcl/window.hxx>
29 
30 /*************************************************************************
31 
32 Beschreibung
33 ============
34 
35 class ProgressBar
36 
37 Diese Klasse dient zur Anzeige einer Progress-Anzeige.
38 
39 --------------------------------------------------------------------------
40 
41 WinBits
42 
43 WB_BORDER			Border um das Fenster
44 WB_3DLOOK			3D-Darstellung
45 
46 --------------------------------------------------------------------------
47 
48 Methoden
49 
50 Mit SetValue() setzt man einen Prozent-Wert zwischen 0 und 100. Wenn Werte
51 groesser 100 gesetzt werden, faengt das letzte Rechteck an zu blinken.
52 
53 *************************************************************************/
54 
55 // -----------
56 // - WinBits -
57 // -----------
58 
59 #define WB_STDPROGRESSBAR		WB_BORDER
60 
61 // ---------------
62 // - ProgressBar -
63 // ---------------
64 
65 class SVT_DLLPUBLIC ProgressBar : public Window
66 {
67 private:
68 	Point				maPos;
69 	long				mnPrgsWidth;
70 	long				mnPrgsHeight;
71 	sal_uInt16				mnPercent;
72 	sal_uInt16				mnPercentCount;
73 	sal_Bool				mbCalcNew;
74 
75 #ifdef _SV_PRGSBAR_CXX
76     using Window::ImplInit;
77 	SVT_DLLPRIVATE void				ImplInit();
78 	SVT_DLLPRIVATE void				ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
79 	SVT_DLLPRIVATE void				ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc );
80 #endif
81 
82 public:
83 						ProgressBar( Window* pParent, WinBits nWinBits = WB_STDPROGRESSBAR );
84 						ProgressBar( Window* pParent, const ResId& rResId );
85 						~ProgressBar();
86 
87 	virtual void		Paint( const Rectangle& rRect );
88 	virtual void		Resize();
89 	virtual void		StateChanged( StateChangedType nStateChange );
90 	virtual void		DataChanged( const DataChangedEvent& rDCEvt );
91 
92 	void				SetValue( sal_uInt16 nNewPercent );
GetValue() const93 	sal_uInt16				GetValue() const { return mnPercent; }
94 };
95 
96 #endif	// _PRGSBAR_HXX
97