digiKam
statusprogressbar.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2007-01-24
7  * Description : a progress bar used to display action
8  * progress or a text in status bar.
9  * Progress events are dispatched to ProgressManager.
10  *
11  * Copyright (C) 2007-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_STATUS_PROGRESS_BAR_H
27 #define DIGIKAM_STATUS_PROGRESS_BAR_H
28 
29 // Qt includes
30 
31 #include <QStackedWidget>
32 #include <QString>
33 
34 // Local includes
35 
36 #include "digikam_export.h"
37 
38 namespace Digikam
39 {
40 class ProgressItem;
41 
42 class DIGIKAM_EXPORT StatusProgressBar : public QStackedWidget
43 {
44  Q_OBJECT
45 
46 public:
47 
49  {
50  TextMode = 0,
52  CancelProgressBarMode
53  };
54 
55 public:
56 
57  explicit StatusProgressBar(QWidget* const parent = nullptr);
58  ~StatusProgressBar() override;
59 
60  void setAlignment(Qt::Alignment a);
61 
62  void setProgressBarMode(int mode, const QString& text = QString());
63 
64  int progressValue() const;
65 
66  int progressTotalSteps() const;
67  void setProgressTotalSteps(int v);
68 
69  void setNotify(bool b);
70  void setNotificationTitle(const QString& title, const QIcon& icon);
71 
72 public Q_SLOTS:
73 
74  void setText(const QString& text);
75  void setProgressValue(int v);
76  void setProgressText(const QString& text);
77 
78 Q_SIGNALS:
79 
81 
82 private:
83 
84  ProgressItem* currentProgressItem() const;
85 
86 private:
87 
88  class Private;
89  Private* const d;
90 };
91 
92 } // namespace Digikam
93 
94 #endif // DIGIKAM_STATUS_PROGRESS_BAR_H
Definition: progressmanager.h:45
Definition: statusprogressbar.h:43
StatusProgressBarMode
Definition: statusprogressbar.h:49
@ ProgressBarMode
Definition: statusprogressbar.h:51
Definition: datefolderview.cpp:43