Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
progress_frame.h
1 /* progress_frame.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef PROGRESS_FRAME_H
11 #define PROGRESS_FRAME_H
12 
13 #include <glib.h>
14 
15 #include <QFrame>
16 
17 namespace Ui {
18 class ProgressFrame;
19 }
20 
21 #if defined(Q_OS_WIN)
22 #include <QWinTaskbarButton>
23 #include <QWinTaskbarProgress>
24 #endif
25 
26 class ProgressFrame;
27 class QDialogButtonBox;
28 class QElapsedTimer;
29 class QGraphicsOpacityEffect;
30 class QPropertyAnimation;
31 
32 // Define the structure describing a progress dialog.
33 struct progdlg {
34  ProgressFrame *progress_frame; // This progress frame
35  QWidget *top_level_window; // Progress frame's main window
36 };
37 
38 class ProgressFrame : public QFrame
39 {
40  Q_OBJECT
41 
42 public:
43  explicit ProgressFrame(QWidget *parent = 0);
44  ~ProgressFrame();
45 
46 #ifdef QWINTASKBARPROGRESS_H
47  void enableTaskbarUpdates(bool enable = true) { update_taskbar_ = enable; }
48 #endif
49  static void addToButtonBox(QDialogButtonBox *button_box, QObject *main_window);
50  void captureFileClosing();
51 
52 public slots:
53  struct progdlg *showProgress(bool animate, bool terminate_is_stop, gboolean *stop_flag, int value = 0);
54  struct progdlg *showBusy(bool animate, bool terminate_is_stop, gboolean *stop_flag);
55  void setValue(int value);
56  void hide();
57 
58 signals:
59  void showRequested(bool animate, bool terminate_is_stop, gboolean *stop_flag);
60  void valueChanged(int value);
61  void maximumValueChanged(int value);
62  void setHidden();
63  void stopLoading();
64 
65 protected:
66  void timerEvent(QTimerEvent *event);
67 
68 private:
70 
71  struct progdlg progress_dialog_;
72  QString message_;
73  QString status_;
74  bool terminate_is_stop_;
75  gboolean *stop_flag_;
76  int show_timer_;
77  QGraphicsOpacityEffect *effect_;
78  QPropertyAnimation *animation_;
79 #ifdef QWINTASKBARPROGRESS_H
80  bool update_taskbar_;
81  QWinTaskbarProgress *taskbar_progress_;
82 #endif
83 
84 private slots:
85  void on_stopButton_clicked();
86 
87  void show(bool animate, bool terminate_is_stop, gboolean *stop_flag);
88  void setMaximumValue(int value);
89 };
90 
91 #endif // PROGRESS_FRAME_H
92 
93 /*
94  * Editor modelines
95  *
96  * Local Variables:
97  * c-basic-offset: 4
98  * tab-width: 8
99  * indent-tabs-mode: nil
100  * End:
101  *
102  * ex: set shiftwidth=4 tabstop=8 expandtab:
103  * :indentSize=4:tabSize=8:noTabs=true:
104  */
Definition: ui_about_dialog.h:291
Definition: progress_frame.h:33
Definition: progress_frame.h:38
Definition: ui_progress_frame.h:70