Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / ui / qt / progress_frame.h
blob368e519a38aaedaae5ccf04939dbae946c8a6a8f
1 /** @file
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
10 #ifndef PROGRESS_FRAME_H
11 #define PROGRESS_FRAME_H
13 #include <QFrame>
15 namespace Ui {
16 class ProgressFrame;
19 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && defined(Q_OS_WIN)
20 #include <QWinTaskbarButton>
21 #include <QWinTaskbarProgress>
22 #endif
24 class ProgressFrame;
25 class QDialogButtonBox;
26 class QElapsedTimer;
27 class QGraphicsOpacityEffect;
28 class QPropertyAnimation;
30 // Define the structure describing a progress dialog.
31 struct progdlg {
32 ProgressFrame *progress_frame; // This progress frame
33 QWidget *top_level_window; // Progress frame's main window
36 class ProgressFrame : public QFrame
38 Q_OBJECT
40 public:
41 explicit ProgressFrame(QWidget *parent = 0);
42 ~ProgressFrame();
44 #ifdef QWINTASKBARPROGRESS_H
45 void enableTaskbarUpdates(bool enable = true) { update_taskbar_ = enable; }
46 #endif
47 static void addToButtonBox(QDialogButtonBox *button_box, QObject *main_window);
48 void captureFileClosing();
50 public slots:
51 struct progdlg *showProgress(const QString &title, bool animate, bool terminate_is_stop, bool *stop_flag, int value = 0);
52 struct progdlg *showBusy(bool animate, bool terminate_is_stop, bool *stop_flag);
53 void setValue(int value);
54 void hide();
56 signals:
57 void showRequested(bool animate, bool terminate_is_stop, bool *stop_flag);
58 void valueChanged(int value);
59 void maximumValueChanged(int value);
60 void setHidden();
61 void stopLoading();
63 protected:
64 void timerEvent(QTimerEvent *event);
66 private:
67 Ui::ProgressFrame *ui;
69 struct progdlg progress_dialog_;
70 QString message_;
71 QString status_;
72 bool terminate_is_stop_;
73 bool *stop_flag_;
74 int show_timer_;
75 QGraphicsOpacityEffect *effect_;
76 QPropertyAnimation *animation_;
77 #ifdef QWINTASKBARPROGRESS_H
78 bool update_taskbar_;
79 QWinTaskbarProgress *taskbar_progress_;
80 #endif
82 private slots:
83 void on_stopButton_clicked();
85 void show(bool animate, bool terminate_is_stop, bool *stop_flag);
86 void setMaximumValue(int value);
89 #endif // PROGRESS_FRAME_H