Libksieve

sievetreewidgetitem.h
1 /*
2  SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-only
5 */
6 
7 #pragma once
8 
9 #include "ksieveui_export.h"
10 #include <KPixmapSequence>
11 #include <QTreeWidgetItem>
12 #include <memory>
13 
14 class QTimer;
15 class QTreeWidget;
16 
17 namespace KSieveUi
18 {
19 class SieveTreeWidgetProgress;
20 class SieveTreeWidgetItemPrivate;
21 /**
22  * @brief The SieveTreeWidgetItem class
23  * @author Laurent Montel <[email protected]>
24  */
25 class KSIEVEUI_EXPORT SieveTreeWidgetItem : public QTreeWidgetItem
26 {
27 public:
29  ~SieveTreeWidgetItem() override;
30 
31  void startAnimation();
32  void stopAnimation();
33  void setDefaultIcon();
34  void setProgressAnimation(const QPixmap &pix);
35 
36 private:
37  std::unique_ptr<SieveTreeWidgetItemPrivate> const d;
38 };
39 
40 class SieveTreeWidgetProgress : public QObject
41 {
42  Q_OBJECT
43 public:
44  explicit SieveTreeWidgetProgress(SieveTreeWidgetItem *item, QObject *parent = nullptr);
45  ~SieveTreeWidgetProgress() override;
46 
47  void startAnimation();
48  void stopAnimation();
49 
50 private:
51  Q_DISABLE_COPY(SieveTreeWidgetProgress)
52  void slotTimerDone();
53  int mProgressCount = 0;
54  KPixmapSequence mProgressPix;
55  QTimer *mProgressTimer = nullptr;
56  SieveTreeWidgetItem *const mItem;
57 };
58 }
59 
The SieveTreeWidgetItem class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Apr 11 2021 23:09:37 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.