xref: /AOO41X/main/sfx2/inc/sfx2/progress.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_PROGRESS_HXX
24 #define _SFX_PROGRESS_HXX
25 
26 #include "sal/config.h"
27 #include "sfx2/dllapi.h"
28 #include "sal/types.h"
29 #include <tools/solar.h>
30 #include <tools/link.hxx>
31 
32 class String;
33 class SfxObjectShell;
34 class SfxStatusBarManager;
35 class INetHint;
36 class SvDispatch;
37 struct SfxProgress_Impl;
38 struct PlugInLoadStatus;
39 struct SvProgressArg;
40 
41 //=======================================================================
42 
43 class SFX2_DLLPUBLIC SfxProgress
44 {
45     SfxProgress_Impl*       pImp;
46     sal_uIntPtr                 nVal;
47     sal_Bool                    bSuspended;
48 
49 public:
50                             SfxProgress( SfxObjectShell* pObjSh,
51                                          const String& rText,
52                                          sal_uIntPtr nRange, sal_Bool bAllDocs = sal_False,
53                                          sal_Bool bWait = sal_True );
54     virtual                 ~SfxProgress();
55 
56     virtual void            SetText( const String& rText );
57     sal_Bool                    SetStateText( sal_uIntPtr nVal, const String &rVal, sal_uIntPtr nNewRange = 0 );
58     virtual sal_Bool            SetState( sal_uIntPtr nVal, sal_uIntPtr nNewRange = 0 );
GetState() const59     sal_uIntPtr                 GetState() const { return nVal; }
60 
61     void                    Resume();
62     void                    Suspend();
IsSuspended() const63     sal_Bool                    IsSuspended() const { return bSuspended; }
64 
65     void                    Lock();
66     void                    UnLock();
67     void                    Reschedule();
68 
69     void                    Stop();
70 
71     void                    SetWaitMode( sal_Bool bWait );
72     sal_Bool                    GetWaitMode() const;
73 
74     static SfxProgress*     GetActiveProgress( SfxObjectShell *pDocSh = 0 );
75     static void             EnterLock();
76     static void             LeaveLock();
77 
78 //#if 0 // _SOLAR__PRIVATE
79     DECL_DLLPRIVATE_STATIC_LINK( SfxProgress, SetStateHdl, PlugInLoadStatus* );
80     DECL_DLLPRIVATE_STATIC_LINK( SfxProgress, DefaultBindingProgress, SvProgressArg* );
81     SAL_DLLPRIVATE FASTBOOL StatusBarManagerGone_Impl(SfxStatusBarManager*pStb);
82     SAL_DLLPRIVATE const String& GetStateText_Impl() const;
83 //#endif
84 };
85 
86 #endif
87 
88