kio Library API Documentation

observer.h

00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2000 Matej Koss <koss@miesto.sk> 00003 David Faure <faure@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library 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 GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00017 Boston, MA 02111-1307, USA. 00018 */ 00019 #ifndef __kio_observer_h__ 00020 #define __kio_observer_h__ 00021 00022 #include <qobject.h> 00023 #include <dcopobject.h> 00024 #include <qintdict.h> 00025 00026 #include <kio/global.h> 00027 #include <kio/authinfo.h> 00028 #include "kio/job.h" 00029 #include "kio/skipdlg.h" 00030 #include "kio/renamedlg.h" 00031 00032 class UIServer_stub; 00033 class KURL; 00034 00035 namespace KIO { 00036 class Job; 00037 } 00038 00055 class KIO_EXPORT Observer : public QObject, public DCOPObject { 00056 00057 K_DCOP 00058 Q_OBJECT 00059 00060 public: 00061 00066 static Observer * self() { 00067 if (!s_pObserver) s_pObserver = new Observer; 00068 return s_pObserver; 00069 } 00070 00078 int newJob( KIO::Job * job, bool showProgress ); 00079 00085 void jobFinished( int progressId ); 00086 00090 bool openPassDlg( const QString& prompt, QString& user, QString& pass, 00091 bool readOnly ); 00092 00098 bool openPassDlg( KIO::AuthInfo& info ); 00099 00111 static int messageBox( int progressId, int type, const QString &text, const QString &caption, 00112 const QString &buttonYes, const QString &buttonNo ); 00113 00128 static int messageBox( int progressId, int type, const QString &text, const QString &caption, 00129 const QString &buttonYes, const QString &buttonNo, const QString &dontAskAgainName ); 00130 00135 KIO::RenameDlg_Result open_RenameDlg( KIO::Job * job, 00136 const QString & caption, 00137 const QString& src, const QString & dest, 00138 KIO::RenameDlg_Mode mode, 00139 QString& newDest, 00140 KIO::filesize_t sizeSrc = (KIO::filesize_t) -1, 00141 KIO::filesize_t sizeDest = (KIO::filesize_t) -1, 00142 time_t ctimeSrc = (time_t) -1, 00143 time_t ctimeDest = (time_t) -1, 00144 time_t mtimeSrc = (time_t) -1, 00145 time_t mtimeDest = (time_t) -1 00146 ); 00147 00152 KIO::SkipDlg_Result open_SkipDlg( KIO::Job * job, 00153 bool multi, 00154 const QString & error_text ); 00155 00156 k_dcop: 00161 void killJob( int progressId ); 00162 00167 KIO::MetaData metadata( int progressId ); 00168 00169 protected: 00170 00171 static Observer * s_pObserver; 00172 Observer(); 00173 ~Observer() {} 00174 00175 UIServer_stub * m_uiserver; 00176 00177 QIntDict< KIO::Job > m_dctJobs; 00178 00179 public slots: 00180 00181 void slotTotalSize( KIO::Job*, KIO::filesize_t size ); 00182 void slotTotalFiles( KIO::Job*, unsigned long files ); 00183 void slotTotalDirs( KIO::Job*, unsigned long dirs ); 00184 00185 void slotProcessedSize( KIO::Job*, KIO::filesize_t size ); 00186 void slotProcessedFiles( KIO::Job*, unsigned long files ); 00187 void slotProcessedDirs( KIO::Job*, unsigned long dirs ); 00188 00189 void slotSpeed( KIO::Job*, unsigned long bytes_per_second ); 00190 void slotPercent( KIO::Job*, unsigned long percent ); 00191 void slotInfoMessage( KIO::Job*, const QString & msg ); 00192 00193 void slotCopying( KIO::Job*, const KURL& from, const KURL& to ); 00194 void slotMoving( KIO::Job*, const KURL& from, const KURL& to ); 00195 void slotDeleting( KIO::Job*, const KURL& url ); 00197 void slotTransferring( KIO::Job*, const KURL& url ); 00198 void slotCreatingDir( KIO::Job*, const KURL& dir ); 00199 // currently unused 00200 void slotCanResume( KIO::Job*, KIO::filesize_t offset ); 00201 00202 public: 00203 void stating( KIO::Job*, const KURL& url ); 00204 void mounting( KIO::Job*, const QString & dev, const QString & point ); 00205 void unmounting( KIO::Job*, const QString & point ); 00206 protected: 00207 virtual void virtual_hook( int id, void* data ); 00208 private: 00209 class ObserverPrivate* d; 00210 }; 00211 00212 // -*- mode: c++; c-basic-offset: 2 -*- 00213 #endif
KDE Logo
This file is part of the documentation for kio Library Version 3.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Apr 12 23:09:31 2005 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003