progressbase.h Source File (kio Library)

| # kio Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# progressbase.h

    00001 /* This file is part of the KDE libraries
    00002    Copyright (C) 2000 Matej Koss <koss@miesto.sk>
    00003
    00004    This library is free software; you can redistribute it and/or
    00005    modify it under the terms of the GNU Library General Public
    00006    License version 2 as published by the Free Software Foundation.
    00007
    00008    This library is distributed in the hope that it will be useful,
    00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
    00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00011    Library General Public License for more details.
    00012
    00013    You should have received a copy of the GNU Library General Public License
    00014    along with this library; see the file COPYING.LIB.  If not, write to
    00015    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00016    Boston, MA 02111-1307, USA.
    00017 */
    00018 #ifndef __progressbase_h__
    00019 #define __progressbase_h__
    00020
    00021
    00022 #include <qwidget.h>
    00023
    00024 #include <kio/global.h>
    00025
    00026 class KURL;
    00027 namespace KIO {
    00028   class Job;
    00029   class CopyJob;
    00030   class DeleteJob;
    00031 }
    00032
    00033 namespace KIO
    00034 {
    00035   enum Progress {
    00036     DEFAULT = 1,
    00037     STATUSBAR = 2,
    00038     LIST = 3
    00039   };
    00040
    00070 class ProgressBase : public QWidget {
    00071
    00072   Q_OBJECT
    00073
    00074 public:
    00075
    00076   ProgressBase( QWidget *parent );
    00077   ~ProgressBase() {}
    00078
    00079   // assign job to this progress dialog
    00080   void setJob( KIO::Job *job );
    00081   void setJob( KIO::CopyJob *job );
    00082   void setJob( KIO::DeleteJob *job );
    00083
    00084   // should we stop the job when the dialog is closed ?
    00085   void setStopOnClose( bool stopOnClose ) { m_bStopOnClose = stopOnClose; }
    00086   bool stopOnClose() const { return m_bStopOnClose; }
    00087
    00098   // should we delete the dialog or just clean it when the job is finished ?
    00099   void setOnlyClean( bool onlyClean ) { m_bOnlyClean = onlyClean; }
    00100   bool onlyClean() const { return m_bOnlyClean; }
    00101
    00103   void finished();
    00104
    00105 public slots:
    00110   void slotStop();
    00115   virtual void slotClean();
    00116
    00117   // progress slots
    00118   virtual void slotTotalSize( KIO::Job*, KIO::filesize_t ) {}
    00119   virtual void slotTotalFiles( KIO::Job*, unsigned long ) {}
    00120   virtual void slotTotalDirs( KIO::Job*, unsigned long ) {}
    00121
    00122   virtual void slotProcessedSize( KIO::Job*, KIO::filesize_t ) {}
    00123   virtual void slotProcessedFiles( KIO::Job*, unsigned long ) {}
    00124   virtual void slotProcessedDirs( KIO::Job*, unsigned long ) {}
    00125
    00126   virtual void slotSpeed( KIO::Job*, unsigned long ) {}
    00127   virtual void slotPercent( KIO::Job*, unsigned long ) {}
    00128
    00129   virtual void slotCopying( KIO::Job*, const KURL&, const KURL& ) {}
    00130   virtual void slotMoving( KIO::Job*, const KURL&, const KURL& ) {}
    00131   virtual void slotDeleting( KIO::Job*, const KURL& ) {}
    00132   virtual void slotCreatingDir( KIO::Job*, const KURL& ) {}
    00133
    00134   virtual void slotCanResume( KIO::Job*, KIO::filesize_t ) {}
    00135
    00136 signals:
    00137   void stopped();
    00138
    00139 protected slots:
    00140   void slotFinished( KIO::Job* );
    00141
    00142 protected:
    00143
    00144   virtual void closeEvent( QCloseEvent * );
    00145
    00146   KIO::Job* m_pJob;
    00147
    00148 private:
    00149   bool m_bOnlyClean;
    00150   bool m_bStopOnClose;
    00151
    00152
    00153 protected:
    00154     virtual void virtual_hook( int id, void* data );
    00155 private:
    00156     class ProgressBasePrivate* d;
    00157 };
    00158
    00159 } /* namespace */
    00160
    00161 #endif // __progressbase_h__

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:14:36 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001