23#include <progress.hxx>
24#include <osl/diagnose.h>
96 while( nSysTotalSize > std::numeric_limits<sal_uInt32>::max() )
120 std::size_t nParentPos =
static_cast< std::size_t
>(
135 OSL_FAIL(
"ScfProgressBar::IncreaseProgressBar - no progress bar found" );
143 OSL_ENSURE( !
mbInProgress,
"ScfProgressBar::AddSegment - already in progress mode" );
147 maSegments.push_back( std::make_unique<ScfProgressSegment>( nSize ) );
149 return static_cast< sal_Int32
>(
maSegments.size() - 1 );
155 OSL_ENSURE( !pSegment || (pSegment->
mnPos == 0),
"ScfProgressBar::GetSegmentProgressBar - segment already started" );
156 if( pSegment && (pSegment->
mnPos == 0) )
173 OSL_ENSURE(
mnTotalSize > 0,
"ScfProgressBar::ActivateSegment - progress range is zero" );
184 OSL_ENSURE( nPos <= mpCurrSegment->
mnSize,
"ScfProgressBar::ProgressAbs - segment overflow" );
Progress bar for complex progress representation.
sal_Int32 AddSegment(std::size_t nSize)
Adds a new segment to the progress bar.
std::size_t mnNextUnitPos
Size between two calls of system progress.
ScfProgressSegment * mpParentSegment
Parent progress bar, if this is a segment progress bar.
bool mbInProgress
Additionally scaling factor for system progress.
std::size_t mnUnitSize
Sum of positions of all segments.
void ProgressAbs(std::size_t nPos)
Set current segment to the specified absolute position.
ScfSegmentList maSegments
void ActivateSegment(sal_Int32 nSegment)
Starts the progress bar or activates another segment.
ScProgressPtr mxSysProgress
UI string for system progress.
bool IsFull() const
Returns true, if the current progress segment is already full.
SfxObjectShell * mpDocShell
System progress bar.
ScfProgressBar & GetSegmentProgressBar(sal_Int32 nSegment)
Returns a complete progress bar for the specified segment.
void Progress(std::size_t nDelta=1)
Increase current segment by the passed value.
std::size_t mnSysProgressScale
Limit for next system progress call.
ScfProgressSegment * mpCurrSegment
Parent segment, if this is a segment progress bar.
ScfProgressBar * mpParentProgress
The document shell for the progress bar.
void SetCurrSegment(ScfProgressSegment *pSegment)
Activates progress bar and sets current segment.
OUString maText
List of progress segments.
void Init(SfxObjectShell *pDocShell)
Initializes all members on construction.
std::size_t mnTotalSize
Current segment for progress.
void IncreaseProgressBar(std::size_t nDelta)
Increases mnTotalPos and calls the system progress bar.
ScfProgressBar(const ScfProgressBar &)=delete
ScfProgressSegment * GetSegment(sal_Int32 nSegment)
Returns the segment specified by list index.
std::size_t mnTotalPos
Total size of all segments.
A simplified progress bar with only one segment.
ScfSimpleProgressBar(std::size_t nSize, SfxObjectShell *pDocShell, const OUString &rText)
void Init(std::size_t nSize)
Initializes and starts the progress bar.
ScfProgressBar maProgress
void Progress()
Sets the progress bar to the current stream position.
SvStream & mrStrm
The used progress bar.
void Init(SfxObjectShell *pDocShell, const OUString &rText)
Initializes and starts the progress bar.
ScfSimpleProgressBarPtr mxProgress
ScfStreamProgressBar(SvStream &rStrm, SfxObjectShell *pDocShell)
virtual sal_uInt64 TellEnd()
const sal_Int32 SCF_INV_SEGMENT
OUString ScResId(TranslateId aId)
Contains all data of a segment of the progress bar.
ScfProgressBarPtr mxProgress
std::size_t mnSize
Pointer to sub progress bar for this segment.
std::size_t mnPos
Size of this segment.
ScfProgressSegment(std::size_t nSize)
Current position of this segment.