chalk

kis_label_progress.h
1/*
2 * Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
3 * 2004 Adrian Page <adrian@pagenet.plus.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19#ifndef KIS_LABEL_PROGRESS_H_
20#define KIS_LABEL_PROGRESS_H_
21
22#include <tqlabel.h>
23#include <tqevent.h>
24
25#include "kis_progress_display_interface.h"
26
27class TQToolButton;
28class KProgress;
29
30class KisLabelProgress : public TQLabel, public KisProgressDisplayInterface {
31 TQ_OBJECT
32
33 typedef TQLabel super;
34
35public:
36 KisLabelProgress(TQWidget *parent, const char *name = 0, WFlags f = 0);
37 virtual ~KisLabelProgress();
38
39public:
40 // Implements KisProgressDisplayInterface
41 void setSubject(KisProgressSubject *subject, bool modal, bool canCancel);
42
43 // Overrides TQLabel::event()
44 bool event(TQEvent * ev);
45
46private slots:
47 virtual void update(int percent);
48 virtual void updateStage(const TQString& stage, int percent);
49 virtual void done();
50 virtual void error();
51 virtual void subjectDestroyed();
52
53private slots:
54 void cancelPressed();
55
56private:
57 void reset();
58
59 KisProgressSubject *m_subject;
60 KProgress *m_bar;
61 TQToolButton *m_cancelButton;
62 bool m_modal;
63};
64
65#endif // KIS_LABEL_PROGRESS_H_
66