kio Library API Documentation

Observer Class Reference

Observer for KIO::Job progress information. Observer for KIO::Job progress information. More...

#include <observer.h>

Inheritance diagram for Observer:

QObject DCOPObject List of all members.

Public Slots

void slotTransferring (KIO::Job *, const KURL &url)

DCOP Methods

void killJob (int progressId)
KIO::MetaData metadata (int progressId)

Public Methods

int newJob (KIO::Job *job, bool showProgress)
void jobFinished (int progressId)
bool openPassDlg (const QString &prompt, QString &user, QString &pass, bool readOnly)
bool openPassDlg (KIO::AuthInfo &info)

Static Public Methods

Observer * self ()
int messageBox (int progressId, int type, const QString &text, const QString &caption, const QString &buttonYes, const QString &buttonNo)

Detailed Description

Observer for KIO::Job progress information. Observer for KIO::Job progress information.

This class, of which there is always only one instance, "observes" what jobs do and forwards this information to the progress-info server.

It is a DCOP object so that the UI server can call the kill method when the user presses Cancel.

Usually jobs are automatically registered by the KIO::Scheduler, so you do not have to care about that.

Author:
David Faure <faure@kde.org>

Definition at line 58 of file observer.h.


Member Function Documentation

Observer* Observer::self   [inline, static]
 

Returns the unique observer object.

Returns:
the observer object

Definition at line 69 of file observer.h.

Referenced by KIO::CopyJob::CopyJob(), KIO::DeleteJob::DeleteJob(), KIO::Job::emitResult(), KIO::FileCopyJob::FileCopyJob(), KIO::Job::kill(), KIO::mimetype(), KIO::mount(), KIO::SlaveInterface::openPassDlg(), KIO::FileCopyJob::slotCanResume(), KIO::CopyJob::slotResult(), KIO::stat(), KIO::TransferJob::TransferJob(), and KIO::unmount().

int Observer::newJob KIO::Job   job,
bool    showProgress
 

Called by the job constructor, to signal its presence to the UI Server.

Parameters:
job  the new job
showProgress  true to show progress, false otherwise
Returns:
the progress ID assigned by the UI Server to the Job.

Definition at line 81 of file observer.cpp.

References QIntDict< KIO::Job >::insert().

void Observer::jobFinished int    progressId
 

Called by the job destructor, to tell the UI Server that the job ended.

Parameters:
progressId  the progress ID of the job, as returned by newJob()

Definition at line 93 of file observer.cpp.

References QIntDict< KIO::Job >::remove().

Referenced by KIO::Job::emitResult(), and KIO::Job::kill().

bool Observer::openPassDlg const QString   prompt,
QString   user,
QString   pass,
bool    readOnly
 

Deprecated:
use KIO::AutoInfo

Definition at line 227 of file observer.cpp.

Referenced by KIO::SlaveInterface::openPassDlg().

bool Observer::openPassDlg KIO::AuthInfo   info
 

Opens a password dialog.

Parameters:
info  the authentication information
Returns:
true if successful ("ok" clicked), false otherwise

Definition at line 244 of file observer.cpp.

References KIO::AuthInfo::caption, KIO::AuthInfo::comment, KIO::AuthInfo::commentLabel, KIO::PasswordDialog::getNameAndPassword(), KIO::AuthInfo::keepPassword, KIO::AuthInfo::password, KIO::AuthInfo::prompt, KIO::AuthInfo::readOnly, KIO::AuthInfo::setModified(), and KIO::AuthInfo::username.

int Observer::messageBox int    progressId,
int    type,
const QString   text,
const QString   caption,
const QString   buttonYes,
const QString   buttonNo
[static]
 

Popup a message box.

See KIO::SlaveBase. This doesn't use DCOP anymore, it shows the dialog in the application's process. Otherwise, other apps would block when trying to communicate with UIServer.

Parameters:
progressId  the progress ID of the job, as returned by newJob()
type  the type of the message box
text  the text to show
caption  the window caption
buttonYes  the text of the "Yes" button
buttonNo  the text of the "No button

Definition at line 260 of file observer.cpp.

References QPtrList::append(), KSSLCertificate::chain(), QPtrList::count(), QDialog::exec(), KSSLCertificate::fromString(), KMessageBox::information(), KMessageBox::questionYesNo(), QPtrList::setAutoDelete(), KSSLCertChain::setChain(), KSSLInfoDlg::setup(), QStringList::split(), QString::utf8(), KMessageBox::warningContinueCancel(), KMessageBox::warningYesNo(), and KMessageBox::warningYesNoCancel().

void Observer::killJob int    progressId
 

Called by the UI Server (using DCOP) if the user presses cancel.

Parameters:
progressId  the progress ID of the job, as returned by newJob()

Definition at line 99 of file observer.cpp.

MetaData Observer::metadata int    progressId
 

Called by the UI Server (using DCOP) to get all the metadata of the job.

Parameters:
progressId  the progress IDof the job, as returned by newJob()

Definition at line 110 of file observer.cpp.

void Observer::slotTransferring KIO::Job  ,
const KURL   url
[slot]
 

Since:
3.1

Definition at line 194 of file observer.cpp.

References KIO::Job::progressId().

Referenced by KIO::TransferJob::TransferJob().


The documentation for this class was generated from the following files:
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 Thu Apr 22 14:24:18 2004 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2003