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

kio/kio

  • kio
  • kio
observer.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 Matej Koss <koss@miesto.sk>
3  David Faure <faure@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 #ifndef __kio_observer_h__
20 #define __kio_observer_h__
21 
22 #include <tqobject.h>
23 #include <dcopobject.h>
24 #include <tqintdict.h>
25 
26 #include <kio/global.h>
27 #include <kio/authinfo.h>
28 #include "kio/job.h"
29 #include "kio/skipdlg.h"
30 #include "kio/renamedlg.h"
31 
32 class UIServer_stub;
33 class KURL;
34 
35 namespace KIO {
36  class Job;
37 }
38 
55 class KIO_EXPORT Observer : public TQObject, public DCOPObject {
56 
57  K_DCOP
58  Q_OBJECT
59 
60 public:
61 
66  static Observer * self() {
67  if (!s_pObserver) s_pObserver = new Observer;
68  return s_pObserver;
69  }
70 
78  int newJob( KIO::Job * job, bool showProgress );
79 
85  void jobFinished( int progressId );
86 
90  bool openPassDlg( const TQString& prompt, TQString& user, TQString& pass,
91  bool readOnly );
92 
98  bool openPassDlg( KIO::AuthInfo& info );
99 
111  static int messageBox( int progressId, int type, const TQString &text, const TQString &caption,
112  const TQString &buttonYes, const TQString &buttonNo );
113 
128  static int messageBox( int progressId, int type, const TQString &text, const TQString &caption,
129  const TQString &buttonYes, const TQString &buttonNo, const TQString &dontAskAgainName );
130 
135  KIO::RenameDlg_Result open_RenameDlg( KIO::Job * job,
136  const TQString & caption,
137  const TQString& src, const TQString & dest,
138  KIO::RenameDlg_Mode mode,
139  TQString& newDest,
140  KIO::filesize_t sizeSrc = (KIO::filesize_t) -1,
141  KIO::filesize_t sizeDest = (KIO::filesize_t) -1,
142  time_t ctimeSrc = (time_t) -1,
143  time_t ctimeDest = (time_t) -1,
144  time_t mtimeSrc = (time_t) -1,
145  time_t mtimeDest = (time_t) -1
146  );
147 
152  KIO::SkipDlg_Result open_SkipDlg( KIO::Job * job,
153  bool multi,
154  const TQString & error_text );
155 
156 k_dcop:
161  void killJob( int progressId );
162 
167  KIO::MetaData metadata( int progressId );
168 
169 protected:
170 
171  static Observer * s_pObserver;
172  Observer();
173  ~Observer() {}
174 
175  UIServer_stub * m_uiserver;
176 
177  TQIntDict< KIO::Job > m_dctJobs;
178 
179 public slots:
180 
181  void slotTotalSize( KIO::Job*, KIO::filesize_t size );
182  void slotTotalFiles( KIO::Job*, unsigned long files );
183  void slotTotalDirs( KIO::Job*, unsigned long dirs );
184 
185  void slotProcessedSize( KIO::Job*, KIO::filesize_t size );
186  void slotProcessedFiles( KIO::Job*, unsigned long files );
187  void slotProcessedDirs( KIO::Job*, unsigned long dirs );
188 
189  void slotSpeed( KIO::Job*, unsigned long speed );
190  void slotPercent( KIO::Job*, unsigned long percent );
191  void slotInfoMessage( KIO::Job*, const TQString & msg );
192 
193  void slotCopying( KIO::Job*, const KURL& from, const KURL& to );
194  void slotMoving( KIO::Job*, const KURL& from, const KURL& to );
195  void slotDeleting( KIO::Job*, const KURL& url );
197  void slotTransferring( KIO::Job*, const KURL& url );
198  void slotCreatingDir( KIO::Job*, const KURL& dir );
199  // currently unused
200  void slotCanResume( KIO::Job*, KIO::filesize_t offset );
201 
202 public:
203  void stating( KIO::Job*, const KURL& url );
204  void mounting( KIO::Job*, const TQString & dev, const TQString & point );
205  void unmounting( KIO::Job*, const TQString & point );
206 protected:
207  virtual void virtual_hook( int id, void* data );
208 private:
209  class ObserverPrivate* d;
210 };
211 
212 // -*- mode: c++; c-basic-offset: 2 -*-
213 #endif
KIO
A namespace for KIO globals.
Definition: authinfo.h:29
KIO::AuthInfo
This class is intended to make it easier to prompt for, cache and retrieve authorization information...
Definition: authinfo.h:51
KIO::MetaData
MetaData is a simple map of key/value strings.
Definition: global.h:514
KIO::filesize_t
TQ_ULLONG filesize_t
64-bit file size
Definition: global.h:39
Observer
Observer for KIO::Job progress information.
Definition: observer.h:55
KIO::RenameDlg_Result
RenameDlg_Result
The result of open_RenameDlg().
Definition: renamedlg.h:40
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:68

kio/kio

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

kio/kio

Skip menu "kio/kio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/kio by doxygen 1.8.8
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |