krita

kis_label_progress.h

00001 /*
00002  *  Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
00003  *                2004 Adrian Page <adrian@pagenet.plus.com>
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  */
00019 #ifndef KIS_LABEL_PROGRESS_H_
00020 #define KIS_LABEL_PROGRESS_H_
00021 
00022 #include <qlabel.h>
00023 #include <qevent.h>
00024 
00025 #include "kis_progress_display_interface.h"
00026 
00027 class QToolButton;
00028 class KProgress;
00029 
00030 class KisLabelProgress : public QLabel, public KisProgressDisplayInterface {
00031     Q_OBJECT
00032     typedef QLabel super;
00033 
00034 public:
00035     KisLabelProgress(QWidget *parent, const char *name = 0, WFlags f = 0);
00036     virtual ~KisLabelProgress();
00037 
00038 public:
00039     // Implements KisProgressDisplayInterface
00040     void setSubject(KisProgressSubject *subject, bool modal, bool canCancel);
00041 
00042     // Overrides QLabel::event()
00043     bool event(QEvent * ev);
00044 
00045 private slots:
00046     virtual void update(int percent);
00047     virtual void updateStage(const QString& stage, int percent);
00048     virtual void done();
00049     virtual void error();
00050     virtual void subjectDestroyed();
00051 
00052 private slots:
00053     void cancelPressed();
00054 
00055 private:
00056     void reset();
00057 
00058     KisProgressSubject *m_subject;
00059     KProgress *m_bar;
00060     QToolButton *m_cancelButton;
00061     bool m_modal;
00062 };
00063 
00064 #endif // KIS_LABEL_PROGRESS_H_
00065 
KDE Home | KDE Accessibility Home | Description of Access Keys