LibreOffice Module oox (master) 1
progressbar.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_OOX_HELPER_PROGRESSBAR_HXX
21#define INCLUDED_OOX_HELPER_PROGRESSBAR_HXX
22
23#include <memory>
24
25#include <com/sun/star/uno/Reference.hxx>
26#include <oox/dllapi.h>
27#include <rtl/ustring.hxx>
28
29namespace com::sun::star {
30 namespace task { class XStatusIndicator; }
31}
32
33namespace oox {
34
35// Interfaces =================================================================
36
40{
41public:
42 virtual ~IProgressBar();
43
49 virtual double getPosition() const = 0;
50
57 virtual void setPosition( double fPosition ) = 0;
58};
59
60
62typedef std::shared_ptr< ISegmentProgressBar > ISegmentProgressBarRef;
63
68{
69public:
70 virtual ~ISegmentProgressBar() override;
71
73 virtual double getFreeLength() const = 0;
74
76 virtual ISegmentProgressBarRef createSegment( double fLength ) = 0;
77};
78
79
83{
84public:
85 explicit ProgressBar(
86 const css::uno::Reference< css::task::XStatusIndicator >& rxIndicator,
87 const OUString& rText );
88
89 virtual ~ProgressBar() override;
90
92 virtual double getPosition() const override;
94 virtual void setPosition( double fPosition ) override;
95
96private:
97 css::uno::Reference< css::task::XStatusIndicator >
99 double mfPosition;
100};
101
102
106{
107public:
108 explicit SegmentProgressBar(
109 const css::uno::Reference< css::task::XStatusIndicator >& rxIndicator,
110 const OUString& rText );
111
113 virtual double getPosition() const override;
115 virtual void setPosition( double fPosition ) override;
116
118 virtual double getFreeLength() const override;
120 virtual ISegmentProgressBarRef createSegment( double fLength ) override;
121
122private:
125};
126
127
128} // namespace oox
129
130#endif
131
132/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Interface for progress bar classes.
Definition: progressbar.hxx:40
virtual double getPosition() const =0
Returns the current position of the progress bar.
virtual void setPosition(double fPosition)=0
Sets the current position of the progress bar.
Interface for a segment in a progress bar, that is able to create sub segments from itself.
Definition: progressbar.hxx:68
virtual double getFreeLength() const =0
Returns the length that is still free for creating sub segments.
virtual ISegmentProgressBarRef createSegment(double fLength)=0
Adds a new segment with the specified length.
A simple progress bar.
Definition: progressbar.hxx:83
css::uno::Reference< css::task::XStatusIndicator > mxIndicator
Definition: progressbar.hxx:98
ProgressBar(const css::uno::Reference< css::task::XStatusIndicator > &rxIndicator, const OUString &rText)
A progress bar containing several independent segments.
#define OOX_DLLPUBLIC
Definition: dllapi.h:28
std::shared_ptr< ISegmentProgressBar > ISegmentProgressBarRef
Definition: progressbar.hxx:61