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 
00027 #include "progressbase.h"
00028 
00029 class KLineEdit;
00030 
00031 namespace KIO {
00032 
00033 /*
00034  * A default implementation of the progress dialog ProgressBase.
00035  * ProgressBase
00036  */
00037 class DefaultProgress : public ProgressBase {
00038 
00039   Q_OBJECT
00040 
00041 public:
00047   DefaultProgress( bool showNow = true );
00054   DefaultProgress( QWidget* parent, const char* name = 0 );
00055   ~DefaultProgress();
00056     bool keepOpen() const;
00057 
00058 public slots:
00059   virtual void slotTotalSize( KIO::Job*, KIO::filesize_t bytes );
00060   virtual void slotTotalFiles( KIO::Job*, unsigned long files );
00061   virtual void slotTotalDirs( KIO::Job*, unsigned long dirs );
00062 
00063   virtual void slotProcessedSize( KIO::Job*, KIO::filesize_t bytes );
00064   virtual void slotProcessedFiles( KIO::Job*, unsigned long files );
00065   virtual void slotProcessedDirs( KIO::Job*, unsigned long dirs );
00066 
00067   virtual void slotSpeed( KIO::Job*, unsigned long bytes_per_second );
00068   virtual void slotPercent( KIO::Job*, unsigned long percent );
00074   virtual void slotInfoMessage( KIO::Job *job, const QString & msg );
00075 
00076   virtual void slotCopying( KIO::Job*, const KURL& src, const KURL& dest );
00077   virtual void slotMoving( KIO::Job*, const KURL& src, const KURL& dest );
00078   virtual void slotDeleting( KIO::Job*, const KURL& url );
00085   void slotTransferring( KIO::Job*, const KURL& url );
00086   virtual void slotCreatingDir( KIO::Job*, const KURL& dir );
00093   virtual void slotStating( KIO::Job*, const KURL& dir );
00100   virtual void slotMounting( KIO::Job*, const QString & dev, const QString & point );
00106   virtual void slotUnmounting( KIO::Job*, const QString & point );
00107   virtual void slotCanResume( KIO::Job*, KIO::filesize_t );
00108 
00113   void slotClean();
00114 
00115 protected:
00117   void init();
00118   void showTotals();
00119   void setDestVisible( bool visible );
00121   void checkDestination( const KURL& dest);
00122 
00123   KLineEdit* sourceEdit;
00124   KLineEdit* destEdit;
00125   QLabel* progressLabel;
00126   QLabel* destInvite;
00127   QLabel* speedLabel;
00128   QLabel* sizeLabel;
00129   QLabel* resumeLabel;
00130 
00131   KProgress* m_pProgressBar;
00132 
00133   KIO::filesize_t m_iTotalSize;
00134   unsigned long m_iTotalFiles;
00135   unsigned long m_iTotalDirs;
00136 
00137   KIO::filesize_t m_iProcessedSize;
00138   unsigned long m_iProcessedDirs;
00139   unsigned long m_iProcessedFiles;
00140 
00141   enum ModeType { Copy, Move, Delete, Create };
00142   ModeType mode;
00143 
00144 protected:
00145   virtual void virtual_hook( int id, void* data );
00146 private:
00147   class DefaultProgressPrivate;
00148   DefaultProgressPrivate* d;
00149 private slots:
00150   void slotKeepOpenToggled(bool);
00151   void slotOpenFile();
00152   void slotOpenLocation();
00153 };
00154 
00155 } /* namespace */
00156 
00157 #endif // __defaultprogress_h__
00158 
KDE Logo
This file is part of the documentation for kio Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 14 09:17:06 2006 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003