• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

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., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018 */
00019 #ifndef __tdeio_observer_h__
00020 #define __tdeio_observer_h__
00021 
00022 #include <tqobject.h>
00023 #include <dcopobject.h>
00024 #include <tqintdict.h>
00025 
00026 #include <tdeio/global.h>
00027 #include <tdeio/authinfo.h>
00028 #include "tdeio/job.h"
00029 #include "tdeio/skipdlg.h"
00030 #include "tdeio/renamedlg.h"
00031 
00032 class UIServer_stub;
00033 class KURL;
00034 
00035 namespace TDEIO {
00036   class Job;
00037 }
00038 
00055 class TDEIO_EXPORT Observer : public TQObject, 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( TDEIO::Job * job, bool showProgress );
00079 
00085   void jobFinished( int progressId );
00086 
00090   bool openPassDlg( const TQString& prompt, TQString& user, TQString& pass,
00091                     bool readOnly );
00092 
00098   bool openPassDlg( TDEIO::AuthInfo& info );
00099 
00111   static int messageBox( int progressId, int type, const TQString &text, const TQString &caption,
00112                          const TQString &buttonYes, const TQString &buttonNo );
00113 
00128   static int messageBox( int progressId, int type, const TQString &text, const TQString &caption,
00129                          const TQString &buttonYes, const TQString &buttonNo, const TQString &dontAskAgainName );
00130 
00135   TDEIO::RenameDlg_Result open_RenameDlg( TDEIO::Job * job,
00136                                         const TQString & caption,
00137                                         const TQString& src, const TQString & dest,
00138                                         TDEIO::RenameDlg_Mode mode,
00139                                         TQString& newDest,
00140                                         TDEIO::filesize_t sizeSrc = (TDEIO::filesize_t) -1,
00141                                         TDEIO::filesize_t sizeDest = (TDEIO::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   TDEIO::SkipDlg_Result open_SkipDlg( TDEIO::Job * job,
00153                                     bool multi,
00154                                     const TQString & error_text );
00155 
00156 k_dcop:
00161   void killJob( int progressId );
00162 
00167   TDEIO::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   TQIntDict< TDEIO::Job > m_dctJobs;
00178 
00179 public slots:
00180 
00181   void slotTotalSize( TDEIO::Job*, TDEIO::filesize_t size );
00182   void slotTotalFiles( TDEIO::Job*, unsigned long files );
00183   void slotTotalDirs( TDEIO::Job*, unsigned long dirs );
00184 
00185   void slotProcessedSize( TDEIO::Job*, TDEIO::filesize_t size );
00186   void slotProcessedFiles( TDEIO::Job*, unsigned long files );
00187   void slotProcessedDirs( TDEIO::Job*, unsigned long dirs );
00188 
00189   void slotSpeed( TDEIO::Job*, unsigned long speed );
00190   void slotPercent( TDEIO::Job*, unsigned long percent );
00191   void slotInfoMessage( TDEIO::Job*, const TQString & msg );
00192 
00193   void slotCopying( TDEIO::Job*, const KURL& from, const KURL& to );
00194   void slotMoving( TDEIO::Job*, const KURL& from, const KURL& to );
00195   void slotDeleting( TDEIO::Job*, const KURL& url );
00197   void slotTransferring( TDEIO::Job*, const KURL& url );
00198   void slotCreatingDir( TDEIO::Job*, const KURL& dir );
00199   // currently unused
00200   void slotCanResume( TDEIO::Job*, TDEIO::filesize_t offset );
00201 
00202 public:
00203   void stating( TDEIO::Job*, const KURL& url );
00204   void mounting( TDEIO::Job*, const TQString & dev, const TQString & point );
00205   void unmounting( TDEIO::Job*, const TQString & 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

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.7.1
This website is maintained by Timothy Pearson.