File indexing completed on 2024-05-05 04:49:22
0001 /**************************************************************************************** 0002 * Copyright (c) 2008 Nikolaj Hald Nielsen <nhn@kde.org> * 0003 * Copyright (c) 2005 Max Howell <max.howell@methylblue.com> * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify it under * 0006 * the terms of the GNU General Public License as published by the Free Software * 0007 * Foundation; either version 2 of the License, or (at your option) any later * 0008 * version. * 0009 * * 0010 * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 0011 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 0012 * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 0013 * * 0014 * You should have received a copy of the GNU General Public License along with * 0015 * this program. If not, see <http://www.gnu.org/licenses/>. * 0016 ****************************************************************************************/ 0017 0018 #ifndef LONGMESSAGEWIDGET_H 0019 #define LONGMESSAGEWIDGET_H 0020 0021 #include "PopupWidget.h" 0022 0023 0024 class CountdownFrame : public QFrame 0025 { 0026 public: 0027 explicit CountdownFrame( QWidget *parent = nullptr ); 0028 void setFilledRatio( float filled ); // 0 to 1 0029 0030 void paintEvent( QPaintEvent *e ) override; 0031 0032 protected: 0033 float m_filled; 0034 }; 0035 0036 /** A widget for displaying a long message as an overlay 0037 */ 0038 class LongMessageWidget : public PopupWidget 0039 { 0040 Q_OBJECT 0041 public: 0042 explicit LongMessageWidget( const QString &message ); 0043 0044 ~LongMessageWidget() override; 0045 0046 Q_SIGNALS: 0047 void closed(); 0048 0049 protected: 0050 void timerEvent( QTimerEvent * ) override; 0051 0052 private Q_SLOTS: 0053 void close(); 0054 0055 private: 0056 CountdownFrame *m_countdownFrame; 0057 int m_counter; 0058 int m_timeout; 0059 int m_timerId; 0060 0061 }; 0062 0063 #endif