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