22#include <com/sun/star/task/XStatusIndicator.hpp>
34const sal_Int32 PROGRESS_RANGE = 1000000;
47 mxIndicator( rxIndicator ),
50 if( mxIndicator.is() )
51 mxIndicator->start( rText, PROGRESS_RANGE );
67 SAL_WARN_IF( (
mfPosition > fPosition) || (fPosition > 1.0),
"oox",
"ProgressBar::setPosition - invalid position" );
80 explicit SubSegment(
IProgressBar& rParentProgress,
double fStartPos,
double fLength );
82 virtual double getPosition()
const override;
83 virtual void setPosition(
double fPosition )
override;
85 virtual double getFreeLength()
const override;
98SubSegment::SubSegment( IProgressBar& rParentProgress,
double fStartPos,
double fLength ) :
107double SubSegment::getPosition()
const
112void SubSegment::setPosition(
double fPosition )
114 SAL_WARN_IF( (
mfPosition > fPosition) || (fPosition > 1.0),
"oox",
"SubSegment::setPosition - invalid position" );
119double SubSegment::getFreeLength()
const
126 SAL_WARN_IF( (0.0 >= fLength) || (fLength > getFreeLength()),
"oox",
"SubSegment::createSegment - invalid length" );
127 fLength = getLimitedValue< double >( fLength, 0.0, getFreeLength() );
135SegmentProgressBar::SegmentProgressBar(
const Reference< XStatusIndicator >& rxIndicator,
const OUString& rText ) :
158 SAL_WARN_IF( (0.0 >= fLength) || (fLength >
getFreeLength()),
"oox",
"SegmentProgressBar::createSegment - invalid length" );
159 fLength = getLimitedValue< double >( fLength, 0.0,
getFreeLength() );
Interface for progress bar classes.
Interface for a segment in a progress bar, that is able to create sub segments from itself.
virtual ~ISegmentProgressBar() override
css::uno::Reference< css::task::XStatusIndicator > mxIndicator
virtual ~ProgressBar() override
virtual void setPosition(double fPosition) override
Sets the current position of the progress bar.
ProgressBar(const css::uno::Reference< css::task::XStatusIndicator > &rxIndicator, const OUString &rText)
virtual double getPosition() const override
Returns the current position of the progress bar.
virtual ISegmentProgressBarRef createSegment(double fLength) override
Adds a new segment with the specified length.
virtual double getPosition() const override
Returns the current position of the progress bar segment.
virtual void setPosition(double fPosition) override
Sets the current position of the progress bar segment.
virtual double getFreeLength() const override
Returns the length that is still free for creating sub segments.
#define SAL_WARN_IF(condition, area, stream)
std::shared_ptr< ISegmentProgressBar > ISegmentProgressBarRef
IProgressBar & mrParentProgress