krita

kis_progress_display_interface.h

00001 /*
00002  *  Copyright (c) 2004 Adrian Page <adrian@pagenet.plus.com>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #ifndef KIS_PROGRESS_DISPLAY_INTERFACE_H_
00020 #define KIS_PROGRESS_DISPLAY_INTERFACE_H_
00021 
00022 class KisProgressSubject;
00023 
00024 
00025 namespace KisProgress {
00026 
00027     const int ProgressEventBase = QEvent::User + 42 + 42;
00028 
00029     class UpdateEvent : QCustomEvent {
00030     
00031     public:
00032     
00033         UpdateEvent(int percent) : QCustomEvent(ProgressEventBase + 1), m_percent(percent) {};
00034         int m_percent;
00035     };
00036     
00037     class UpdateStageEvent : QCustomEvent {
00038     
00039     public:
00040     
00041         UpdateStageEvent(const QString & stage, int percent) : QCustomEvent(ProgressEventBase + 2 ), m_stage(stage), m_percent(percent) {};
00042         QString m_stage;
00043         int m_percent;
00044     };
00045     
00046     class DoneEvent : QCustomEvent {
00047         DoneEvent() : QCustomEvent(ProgressEventBase + 3){};
00048     };
00049     
00050     class ErrorEvent : QCustomEvent {
00051         ErrorEvent() : QCustomEvent(ProgressEventBase + 4){};
00052     };
00053     
00054     class DestroyedEvent: QCustomEvent {
00055         DestroyedEvent() : QCustomEvent(ProgressEventBase + 5){};
00056     };
00057 
00058 
00059 }
00060 
00061 
00062 
00063 class KisProgressDisplayInterface {
00064 public:
00065     KisProgressDisplayInterface() {}
00066     virtual ~KisProgressDisplayInterface() {}
00067 
00068     virtual void setSubject(KisProgressSubject *subject, bool modal, bool canCancel) = 0;
00069 
00070 private:
00071     KisProgressDisplayInterface(const KisProgressDisplayInterface&);
00072     KisProgressDisplayInterface& operator=(const KisProgressDisplayInterface&);
00073 };
00074 
00075 #endif // KIS_PROGRESS_DISPLAY_INTERFACE_H_
00076 
KDE Home | KDE Accessibility Home | Description of Access Keys