kio Library API Documentation

defaultprogress.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 __defaultprogress_h__
00019 #define __defaultprogress_h__
00020 
00021 #include <qlabel.h>
00022 
00023 #include <kio/global.h>
00024 
00025 #include <kprogress.h>
00026 #include <ksqueezedtextlabel.h>
00027 
00028 #include "progressbase.h"
00029 
00030 namespace KIO {
00031 
00032 /*
00033  * @ref ProgressBase
00034  */
00035 class DefaultProgress : public ProgressBase {
00036 
00037   Q_OBJECT
00038 
00039 public:
00040 
00041   DefaultProgress( bool showNow = true );
00045   DefaultProgress( QWidget* parent, const char* name = 0 );
00046   ~DefaultProgress();
00047 
00048 public slots:
00049   virtual void slotTotalSize( KIO::Job*, KIO::filesize_t bytes );
00050   virtual void slotTotalFiles( KIO::Job*, unsigned long files );
00051   virtual void slotTotalDirs( KIO::Job*, unsigned long dirs );
00052 
00053   virtual void slotProcessedSize( KIO::Job*, KIO::filesize_t bytes );
00054   virtual void slotProcessedFiles( KIO::Job*, unsigned long files );
00055   virtual void slotProcessedDirs( KIO::Job*, unsigned long dirs );
00056 
00057   virtual void slotSpeed( KIO::Job*, unsigned long bytes_per_second );
00058   virtual void slotPercent( KIO::Job*, unsigned long percent );
00059   virtual void slotInfoMessage( KIO::Job*, const QString & msg );
00060 
00061   virtual void slotCopying( KIO::Job*, const KURL& src, const KURL& dest );
00062   virtual void slotMoving( KIO::Job*, const KURL& src, const KURL& dest );
00063   virtual void slotDeleting( KIO::Job*, const KURL& url );
00065   void slotTransferring( KIO::Job*, const KURL& url );
00066   virtual void slotCreatingDir( KIO::Job*, const KURL& dir );
00067   virtual void slotStating( KIO::Job*, const KURL& dir );
00068   virtual void slotMounting( KIO::Job*, const QString & dev, const QString & point );
00069   virtual void slotUnmounting( KIO::Job*, const QString & point );
00070   virtual void slotCanResume( KIO::Job*, KIO::filesize_t );
00071 
00073   void slotClean();
00074 
00075 protected:
00077   void init();
00078   void showTotals();
00079   void setDestVisible( bool visible );
00081   void checkDestination( const KURL& dest);
00082 
00083   KSqueezedTextLabel* sourceLabel;
00084   KSqueezedTextLabel* destLabel;
00085   QLabel* progressLabel;
00086   QLabel* destInvite;
00087   QLabel* speedLabel;
00088   QLabel* sizeLabel;
00089   QLabel* resumeLabel;
00090 
00091   KProgress* m_pProgressBar;
00092 
00093   KIO::filesize_t m_iTotalSize;
00094   unsigned long m_iTotalFiles;
00095   unsigned long m_iTotalDirs;
00096 
00097   KIO::filesize_t m_iProcessedSize;
00098   unsigned long m_iProcessedDirs;
00099   unsigned long m_iProcessedFiles;
00100 
00101   enum ModeType { Copy, Move, Delete, Create };
00102   ModeType mode;
00103 
00104 protected:
00105   virtual void virtual_hook( int id, void* data );
00106 private:
00107   class DefaultProgressPrivate;
00108   DefaultProgressPrivate* d;
00109 private slots:
00110   void slotKeepOpenToggled(bool);
00111   void slotOpenFile();
00112   void slotOpenLocation();
00113 };
00114 
00115 } /* namespace */
00116 
00117 #endif // __defaultprogress_h__
00118 
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 27 22:15:28 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001