22#include <com/sun/star/uno/Reference.hxx>
23#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
37#include <sfx2/sfxsids.hrc>
67 , pActiveProgress(nullptr)
81 const OUString& rText,
102 pImpl->bRunning =
true;
104 pImpl->xObjSh = pObjSh;
105 pImpl->aText = rText;
106 pImpl->nMax = nRange;
107 pImpl->bWaitMode = bWait;
111 "SfxProgress: created for '" << rText <<
"' at " <<
pImpl->nCreate
113 pImpl->pWorkWin =
nullptr;
114 pImpl->pView =
nullptr;
119 else if( !
pImpl->pActiveProgress )
135 if (
pImpl->xStatusInd.is() )
136 pImpl->xStatusInd->end();
148 if(
pImpl->pActiveProgress )
150 if (
pImpl->xObjSh.is() &&
pImpl->xObjSh->GetProgress() ==
this )
151 pImpl->xObjSh->SetProgress_Impl(
nullptr);
155 if ( !
pImpl->bRunning )
157 pImpl->bRunning =
false;
159 "sfx.bastyp",
"SfxProgress: destroyed at " <<
Get10ThSec() <<
"ds");
162 if (
pImpl->xObjSh.is() )
163 pImpl->xObjSh->SetProgress_Impl(
nullptr);
180 if(
pImpl->pActiveProgress )
return;
185 if ( nNewRange && nNewRange !=
pImpl->nMax )
189 "SfxProgress: range changed from " <<
pImpl->nMax <<
" to "
191 pImpl->nMax = nNewRange;
194 if ( !
pImpl->xStatusInd.is() )
201 if ( pObjSh && ( !
pImpl->pView || pObjSh !=
pImpl->pView->GetObjectShell() ) )
206 pImpl->pView = pDocView;
212 if ( !pHiddenItem || !pHiddenItem->
GetValue() )
215 Reference< XStatusIndicator > xInd;
216 if ( pIndicatorItem && (pIndicatorItem->
GetValue()>>=xInd) )
217 pImpl->xStatusInd = xInd;
221 else if (
pImpl->pView )
224 if (
pImpl->pWorkWin )
225 pImpl->xStatusInd =
pImpl->pWorkWin->GetStatusIndicator();
228 if (
pImpl->xStatusInd.is() )
231 pImpl->pView =
nullptr;
235 if (
pImpl->xStatusInd.is() )
237 pImpl->xStatusInd->setValue( nNewVal );
254 if(
pImpl->pActiveProgress )
return;
258 SAL_INFO(
"sfx.bastyp",
"SfxProgress: resumed");
259 if (
pImpl->xStatusInd.is() )
265 if (
pImpl->bWaitMode )
267 if (
pImpl->xObjSh.is() )
272 pFrame->GetWindow().EnterWait();
276 if (
pImpl->xObjSh.is() )
299 if(
pImpl->pActiveProgress )
return;
303 SAL_INFO(
"sfx.bastyp",
"SfxProgress: suspended");
306 if (
pImpl->xStatusInd.is() )
308 pImpl->xStatusInd->reset();
311 if (
pImpl->xObjSh.is() )
317 pFrame->GetWindow().LeaveWait();
319 if (
pImpl->xObjSh.is() )
SfxApplication * SfxGetpApp()
sal_uInt16 nRescheduleLocks
SAL_DLLPRIVATE void SetProgress_Impl(SfxProgress *)
SAL_DLLPRIVATE SfxAppData_Impl * Get_Impl() const
static SfxApplication * Get()
SfxProgress * GetProgress() const
Returns the running SfxProgress for the entire application or 0 if none is running for the entire app...
SAL_DLLPRIVATE SfxWorkWindow * GetWorkWindow_Impl(const SfxViewFrame *pFrame) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
SfxItemSet & GetItemSet() const
SfxProgress * GetProgress() const
SfxMedium * GetMedium() const
SAL_DLLPRIVATE void SetProgress_Impl(SfxProgress *pProgress)
std::unique_ptr< SfxProgress_Impl > pImpl
static SfxProgress * GetActiveProgress(SfxObjectShell const *pDocSh=nullptr)
SfxProgress(SfxObjectShell *pObjSh, const OUString &rText, sal_uInt32 nRange, bool bWait=true)
void SetState(sal_uInt32 nVal, sal_uInt32 nNewRange=0)
const css::uno::Any & GetValue() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxBindings & GetBindings()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
#define DBG_ASSERT(sCon, aError)
#define SAL_INFO(area, stream)
Reference< XStatusIndicator > xStatusInd
SfxProgress * pActiveProgress