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 
00057 public slots:
00058   virtual void slotTotalSize( KIO::Job*, KIO::filesize_t bytes );
00059   virtual void slotTotalFiles( KIO::Job*, unsigned long files );
00060   virtual void slotTotalDirs( KIO::Job*, unsigned long dirs );
00061 
00062   virtual void slotProcessedSize( KIO::Job*, KIO::filesize_t bytes );
00063   virtual void slotProcessedFiles( KIO::Job*, unsigned long files );
00064   virtual void slotProcessedDirs( KIO::Job*, unsigned long dirs );
00065 
00066   virtual void slotSpeed( KIO::Job*, unsigned long bytes_per_second );
00067   virtual void slotPercent( KIO::Job*, unsigned long percent );
00073   virtual void slotInfoMessage( KIO::Job *job, const QString & msg );
00074 
00075   virtual void slotCopying( KIO::Job*, const KURL& src, const KURL& dest );
00076   virtual void slotMoving( KIO::Job*, const KURL& src, const KURL& dest );
00077   virtual void slotDeleting( KIO::Job*, const KURL& url );
00084   void slotTransferring( KIO::Job*, const KURL& url );
00085   virtual void slotCreatingDir( KIO::Job*, const KURL& dir );
00092   virtual void slotStating( KIO::Job*, const KURL& dir );
00099   virtual void slotMounting( KIO::Job*, const QString & dev, const QString & point );
00105   virtual void slotUnmounting( KIO::Job*, const QString & point );
00106   virtual void slotCanResume( KIO::Job*, KIO::filesize_t );
00107 
00112   void slotClean();
00113 
00114 protected:
00116   void init();
00117   void showTotals();
00118   void setDestVisible( bool visible );
00120   void checkDestination( const KURL& dest);
00121 
00122   KLineEdit* sourceEdit;
00123   KLineEdit* destEdit;
00124   QLabel* progressLabel;
00125   QLabel* destInvite;
00126   QLabel* speedLabel;
00127   QLabel* sizeLabel;
00128   QLabel* resumeLabel;
00129 
00130   KProgress* m_pProgressBar;
00131 
00132   KIO::filesize_t m_iTotalSize;
00133   unsigned long m_iTotalFiles;
00134   unsigned long m_iTotalDirs;
00135 
00136   KIO::filesize_t m_iProcessedSize;
00137   unsigned long m_iProcessedDirs;
00138   unsigned long m_iProcessedFiles;
00139 
00140   enum ModeType { Copy, Move, Delete, Create };
00141   ModeType mode;
00142 
00143 protected:
00144   virtual void virtual_hook( int id, void* data );
00145 private:
00146   class DefaultProgressPrivate;
00147   DefaultProgressPrivate* d;
00148 private slots:
00149   void slotKeepOpenToggled(bool);
00150   void slotOpenFile();
00151   void slotOpenLocation();
00152 };
00153 
00154 } /* namespace */
00155 
00156 #endif // __defaultprogress_h__
00157 
KDE Logo
This file is part of the documentation for kio Library Version 3.2.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 4 12:35:00 2004 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2003