xref: /trunk/main/sfx2/inc/sfx2/progress.hxx (revision 353d8f4d)
1*353d8f4dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*353d8f4dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*353d8f4dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*353d8f4dSAndrew Rist  * distributed with this work for additional information
6*353d8f4dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*353d8f4dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*353d8f4dSAndrew Rist  * "License"); you may not use this file except in compliance
9*353d8f4dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*353d8f4dSAndrew Rist  *
11*353d8f4dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*353d8f4dSAndrew Rist  *
13*353d8f4dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*353d8f4dSAndrew Rist  * software distributed under the License is distributed on an
15*353d8f4dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*353d8f4dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*353d8f4dSAndrew Rist  * specific language governing permissions and limitations
18*353d8f4dSAndrew Rist  * under the License.
19*353d8f4dSAndrew Rist  *
20*353d8f4dSAndrew Rist  *************************************************************/
21*353d8f4dSAndrew Rist 
22*353d8f4dSAndrew Rist 
23cdf0e10cSrcweir #ifndef _SFX_PROGRESS_HXX
24cdf0e10cSrcweir #define _SFX_PROGRESS_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "sal/config.h"
27cdf0e10cSrcweir #include "sfx2/dllapi.h"
28cdf0e10cSrcweir #include "sal/types.h"
29cdf0e10cSrcweir #include <tools/solar.h>
30cdf0e10cSrcweir #include <tools/link.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir class String;
33cdf0e10cSrcweir class SfxObjectShell;
34cdf0e10cSrcweir class SfxStatusBarManager;
35cdf0e10cSrcweir class INetHint;
36cdf0e10cSrcweir class SvDispatch;
37cdf0e10cSrcweir struct SfxProgress_Impl;
38cdf0e10cSrcweir struct PlugInLoadStatus;
39cdf0e10cSrcweir struct SvProgressArg;
40cdf0e10cSrcweir 
41cdf0e10cSrcweir //=======================================================================
42cdf0e10cSrcweir 
43cdf0e10cSrcweir class SFX2_DLLPUBLIC SfxProgress
44cdf0e10cSrcweir {
45cdf0e10cSrcweir 	SfxProgress_Impl*		pImp;
46cdf0e10cSrcweir 	sal_uIntPtr					nVal;
47cdf0e10cSrcweir 	sal_Bool					bSuspended;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir public:
50cdf0e10cSrcweir 							SfxProgress( SfxObjectShell* pObjSh,
51cdf0e10cSrcweir 										 const String& rText,
52cdf0e10cSrcweir 										 sal_uIntPtr nRange, sal_Bool bAllDocs = sal_False,
53cdf0e10cSrcweir 										 sal_Bool bWait = sal_True );
54cdf0e10cSrcweir 	virtual 				~SfxProgress();
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 	virtual void			SetText( const String& rText );
57cdf0e10cSrcweir 	sal_Bool					SetStateText( sal_uIntPtr nVal, const String &rVal, sal_uIntPtr nNewRange = 0 );
58cdf0e10cSrcweir 	virtual sal_Bool			SetState( sal_uIntPtr nVal, sal_uIntPtr nNewRange = 0 );
GetState() const59cdf0e10cSrcweir 	sal_uIntPtr					GetState() const { return nVal; }
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 	void					Resume();
62cdf0e10cSrcweir 	void					Suspend();
IsSuspended() const63cdf0e10cSrcweir 	sal_Bool					IsSuspended() const { return bSuspended; }
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 	void					Lock();
66cdf0e10cSrcweir 	void					UnLock();
67cdf0e10cSrcweir 	void					Reschedule();
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 	void					Stop();
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 	void					SetWaitMode( sal_Bool bWait );
72cdf0e10cSrcweir 	sal_Bool					GetWaitMode() const;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 	static SfxProgress* 	GetActiveProgress( SfxObjectShell *pDocSh = 0 );
75cdf0e10cSrcweir 	static void				EnterLock();
76cdf0e10cSrcweir 	static void				LeaveLock();
77cdf0e10cSrcweir 
78cdf0e10cSrcweir //#if 0 // _SOLAR__PRIVATE
79cdf0e10cSrcweir 	DECL_DLLPRIVATE_STATIC_LINK( SfxProgress, SetStateHdl, PlugInLoadStatus* );
80cdf0e10cSrcweir 	DECL_DLLPRIVATE_STATIC_LINK( SfxProgress, DefaultBindingProgress, SvProgressArg* );
81cdf0e10cSrcweir 	SAL_DLLPRIVATE FASTBOOL StatusBarManagerGone_Impl(SfxStatusBarManager*pStb);
82cdf0e10cSrcweir 	SAL_DLLPRIVATE const String& GetStateText_Impl() const;
83cdf0e10cSrcweir //#endif
84cdf0e10cSrcweir };
85cdf0e10cSrcweir 
86cdf0e10cSrcweir #endif
87cdf0e10cSrcweir 
88