update dev300-m57
[ooovba.git] / svtools / inc / prgsbar.hxx
blob777c6089d88ce7df32ec90b0daf308b9498c9acb
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: prgsbar.hxx,v $
10 * $Revision: 1.6 $
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 _PRGSBAR_HXX
32 #define _PRGSBAR_HXX
34 #include "svtools/svtdllapi.h"
35 #include <vcl/window.hxx>
37 /*************************************************************************
39 Beschreibung
40 ============
42 class ProgressBar
44 Diese Klasse dient zur Anzeige einer Progress-Anzeige.
46 --------------------------------------------------------------------------
48 WinBits
50 WB_BORDER Border um das Fenster
51 WB_3DLOOK 3D-Darstellung
53 --------------------------------------------------------------------------
55 Methoden
57 Mit SetValue() setzt man einen Prozent-Wert zwischen 0 und 100. Wenn Werte
58 groesser 100 gesetzt werden, faengt das letzte Rechteck an zu blinken.
60 *************************************************************************/
62 // -----------
63 // - WinBits -
64 // -----------
66 #define WB_STDPROGRESSBAR WB_BORDER
68 // ---------------
69 // - ProgressBar -
70 // ---------------
72 class SVT_DLLPUBLIC ProgressBar : public Window
74 private:
75 Point maPos;
76 long mnPrgsWidth;
77 long mnPrgsHeight;
78 USHORT mnPercent;
79 USHORT mnPercentCount;
80 BOOL mbCalcNew;
82 #ifdef _SV_PRGSBAR_CXX
83 using Window::ImplInit;
84 SVT_DLLPRIVATE void ImplInit();
85 SVT_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
86 SVT_DLLPRIVATE void ImplDrawProgress( USHORT nOldPerc, USHORT nNewPerc );
87 #endif
89 public:
90 ProgressBar( Window* pParent, WinBits nWinBits = WB_STDPROGRESSBAR );
91 ProgressBar( Window* pParent, const ResId& rResId );
92 ~ProgressBar();
94 virtual void Paint( const Rectangle& rRect );
95 virtual void Resize();
96 virtual void StateChanged( StateChangedType nStateChange );
97 virtual void DataChanged( const DataChangedEvent& rDCEvt );
99 void SetValue( USHORT nNewPercent );
100 USHORT GetValue() const { return mnPercent; }
103 #endif // _PRGSBAR_HXX