Dominik Wenger | 917e0ac | 2007-07-29 18:07:31 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * |
| 9 | * Copyright (C) 2007 by Dominik Wenger |
Dominik Riebeling | 1dc307a | 2007-08-23 22:11:50 +0000 | [diff] [blame] | 10 | * $Id$ |
Dominik Wenger | 917e0ac | 2007-07-29 18:07:31 +0000 | [diff] [blame] | 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
Dominik Wenger | 917e0ac | 2007-07-29 18:07:31 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
Antoine Cellerier | 78d7ece | 2007-09-15 22:13:41 +0000 | [diff] [blame] | 21 | |
Dominik Wenger | 917e0ac | 2007-07-29 18:07:31 +0000 | [diff] [blame] | 22 | #ifndef PROGRESSLOGGERINTERFACE_H |
| 23 | #define PROGRESSLOGGERINTERFACE_H |
Antoine Cellerier | 78d7ece | 2007-09-15 22:13:41 +0000 | [diff] [blame] | 24 | |
Dominik Riebeling | ee09cb7 | 2008-02-10 18:25:49 +0000 | [diff] [blame] | 25 | #include <QtCore> |
Dominik Wenger | 5df9fc5 | 2007-07-31 19:11:44 +0000 | [diff] [blame] | 26 | |
Antoine Cellerier | 78d7ece | 2007-09-15 22:13:41 +0000 | [diff] [blame] | 27 | enum { |
| 28 | LOGNOICON, LOGOK, LOGINFO, LOGWARNING, LOGERROR |
| 29 | }; |
| 30 | |
| 31 | |
| 32 | |
Dominik Wenger | 917e0ac | 2007-07-29 18:07:31 +0000 | [diff] [blame] | 33 | class ProgressloggerInterface : public QObject |
| 34 | { |
| 35 | Q_OBJECT |
Antoine Cellerier | 78d7ece | 2007-09-15 22:13:41 +0000 | [diff] [blame] | 36 | |
| 37 | public: |
Dominik Wenger | 917e0ac | 2007-07-29 18:07:31 +0000 | [diff] [blame] | 38 | ProgressloggerInterface(QObject* parent) : QObject(parent) {} |
Antoine Cellerier | 78d7ece | 2007-09-15 22:13:41 +0000 | [diff] [blame] | 39 | |
Dominik Wenger | 917e0ac | 2007-07-29 18:07:31 +0000 | [diff] [blame] | 40 | virtual void setProgressValue(int value)=0; |
| 41 | virtual void setProgressMax(int max)=0; |
| 42 | virtual int getProgressMax()=0; |
Antoine Cellerier | 78d7ece | 2007-09-15 22:13:41 +0000 | [diff] [blame] | 43 | |
Dominik Wenger | 917e0ac | 2007-07-29 18:07:31 +0000 | [diff] [blame] | 44 | signals: |
| 45 | virtual void aborted()=0; |
Antoine Cellerier | 78d7ece | 2007-09-15 22:13:41 +0000 | [diff] [blame] | 46 | |
Dominik Wenger | 917e0ac | 2007-07-29 18:07:31 +0000 | [diff] [blame] | 47 | |
| 48 | public slots: |
Dominik Riebeling | 2da6868 | 2008-05-21 20:57:19 +0000 | [diff] [blame] | 49 | virtual void addItem(const QString &text)=0; //! add a string to the progress |
| 50 | virtual void addItem(const QString &text, int flag)=0; //! add a string to the list, with icon |
| 51 | |
Dominik Wenger | 917e0ac | 2007-07-29 18:07:31 +0000 | [diff] [blame] | 52 | virtual void abort()=0; |
Antoine Cellerier | 78d7ece | 2007-09-15 22:13:41 +0000 | [diff] [blame] | 53 | virtual void undoAbort()=0; |
Dominik Wenger | 917e0ac | 2007-07-29 18:07:31 +0000 | [diff] [blame] | 54 | virtual void close()=0; |
| 55 | virtual void show()=0; |
Antoine Cellerier | 78d7ece | 2007-09-15 22:13:41 +0000 | [diff] [blame] | 56 | |
Dominik Wenger | 917e0ac | 2007-07-29 18:07:31 +0000 | [diff] [blame] | 57 | private: |
Antoine Cellerier | 78d7ece | 2007-09-15 22:13:41 +0000 | [diff] [blame] | 58 | |
Dominik Wenger | 917e0ac | 2007-07-29 18:07:31 +0000 | [diff] [blame] | 59 | }; |
| 60 | |
| 61 | #endif |
| 62 | |