bump product version to 4.2.0.1
[LibreOffice.git] / include / sfx2 / progress.hxx
blobaf24b5864efd9a67bd94f2683542e5514b139199
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SFX2_PROGRESS_HXX
20 #define INCLUDED_SFX2_PROGRESS_HXX
22 #include <sal/config.h>
23 #include <sfx2/dllapi.h>
24 #include <sal/types.h>
25 #include <tools/solar.h>
26 #include <tools/link.hxx>
27 #include <rtl/ustring.hxx>
29 namespace rtl {
30 class OUString;
32 class SfxObjectShell;
33 struct SfxProgress_Impl;
34 struct PlugInLoadStatus;
35 struct SvProgressArg;
37 //=======================================================================
39 class SFX2_DLLPUBLIC SfxProgress
41 SfxProgress_Impl* pImp;
42 sal_uIntPtr nVal;
43 sal_Bool bSuspended;
45 public:
46 SfxProgress( SfxObjectShell* pObjSh,
47 const rtl::OUString& rText,
48 sal_uIntPtr nRange, sal_Bool bAllDocs = sal_False,
49 sal_Bool bWait = sal_True );
50 virtual ~SfxProgress();
52 virtual void SetText( const OUString& rText );
53 sal_Bool SetStateText( sal_uIntPtr nVal, const rtl::OUString &rVal, sal_uIntPtr nNewRange = 0 );
54 virtual sal_Bool SetState( sal_uIntPtr nVal, sal_uIntPtr nNewRange = 0 );
55 sal_uIntPtr GetState() const { return nVal; }
57 void Resume();
58 void Suspend();
59 sal_Bool IsSuspended() const { return bSuspended; }
61 void UnLock();
62 void Reschedule();
64 void Stop();
66 static SfxProgress* GetActiveProgress( SfxObjectShell *pDocSh = 0 );
67 static void EnterLock();
68 static void LeaveLock();
70 DECL_DLLPRIVATE_STATIC_LINK( SfxProgress, SetStateHdl, PlugInLoadStatus* );
71 DECL_DLLPRIVATE_STATIC_LINK( SfxProgress, DefaultBindingProgress, SvProgressArg* );
74 #endif
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */