update emoji autocorrect entries from po-files
[LibreOffice.git] / include / oox / helper / progressbar.hxx
blobda998010f591462de4278c29c3c283f39b5f4d52
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_OOX_HELPER_PROGRESSBAR_HXX
21 #define INCLUDED_OOX_HELPER_PROGRESSBAR_HXX
23 #include <memory>
24 #include <com/sun/star/uno/Reference.hxx>
25 #include <oox/dllapi.h>
28 namespace com { namespace sun { namespace star {
29 namespace task { class XStatusIndicator; }
30 } } }
32 namespace oox {
34 // Interfaces =================================================================
36 /** Interface for progress bar classes.
38 class OOX_DLLPUBLIC IProgressBar
40 public:
41 virtual ~IProgressBar();
43 /** Returns the current position of the progress bar.
45 @return Position of the progress bar, in the range from 0.0 (beginning
46 of the progress bar) to 1.0 (end of the progress bar) inclusive.
48 virtual double getPosition() const = 0;
50 /** Sets the current position of the progress bar.
52 @param fPosition New position of the progress bar, in the range from
53 0.0 (beginning of the progress bar) to 1.0 (end of the progress bar)
54 inclusive.
56 virtual void setPosition( double fPosition ) = 0;
62 class ISegmentProgressBar;
63 typedef std::shared_ptr< ISegmentProgressBar > ISegmentProgressBarRef;
65 /** Interface for a segment in a progress bar, that is able to create sub
66 segments from itself.
68 class OOX_DLLPUBLIC ISegmentProgressBar : public IProgressBar
70 public:
71 virtual ~ISegmentProgressBar();
73 /** Returns the length that is still free for creating sub segments. */
74 virtual double getFreeLength() const = 0;
76 /** Adds a new segment with the specified length. */
77 virtual ISegmentProgressBarRef createSegment( double fLength ) = 0;
83 /** A simple progress bar.
85 class OOX_DLLPUBLIC ProgressBar : public IProgressBar
87 public:
88 explicit ProgressBar(
89 const ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator >& rxIndicator,
90 const OUString& rText );
92 virtual ~ProgressBar();
94 /** Returns the current position of the progress bar. */
95 virtual double getPosition() const SAL_OVERRIDE;
96 /** Sets the current position of the progress bar. */
97 virtual void setPosition( double fPosition ) SAL_OVERRIDE;
99 private:
100 ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator >
101 mxIndicator;
102 double mfPosition;
107 /** A progress bar containing several independent segments.
109 class OOX_DLLPUBLIC SegmentProgressBar : public ISegmentProgressBar
111 public:
112 explicit SegmentProgressBar(
113 const ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator >& rxIndicator,
114 const OUString& rText );
116 /** Returns the current position of the progress bar segment. */
117 virtual double getPosition() const SAL_OVERRIDE;
118 /** Sets the current position of the progress bar segment. */
119 virtual void setPosition( double fPosition ) SAL_OVERRIDE;
121 /** Returns the length that is still free for creating sub segments. */
122 virtual double getFreeLength() const SAL_OVERRIDE;
123 /** Adds a new segment with the specified length. */
124 virtual ISegmentProgressBarRef createSegment( double fLength ) SAL_OVERRIDE;
126 private:
127 ProgressBar maProgress;
128 double mfFreeStart;
133 } // namespace oox
135 #endif
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */