| # kio Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KIO::SlaveInterface Class Reference

There are two classes that specifies the protocol between application (job) and kioslave. More...

`#include <slaveinterface.h>`

Inheritance diagram for KIO::SlaveInterface:

[legend]
Collaboration diagram for KIO::SlaveInterface:

[legend]
List of all members.

## Signals
void | data (const QByteArray &)
void | dataReq ()
void | error (int, const QString &)
void | connected ()
void | finished ()
void | slaveStatus (pid_t, const QCString &, const QString &, bool)
void | listEntries (const KIO::UDSEntryList &)
void | statEntry (const KIO::UDSEntry &)
void | needSubURLData ()
void | needProgressId ()
void | canResume (KIO::filesize_t)
void | metaData (const KIO::MetaData &)
void | totalSize (KIO::filesize_t)
void | processedSize (KIO::filesize_t)
void | redirection (const KURL &)
void | speed (unsigned long)
void | errorPage ()
void | mimeType (const QString &)
void | warning (const QString &)
void | infoMessage (const QString &)
void | connectFinished ()
void | authorizationKey (const QCString &, const QCString &, bool)
| Emitted whenever login (username/password) information needs to be cached.
void | delAuthorization (const QCString &grpkey)
| Emitted when an io-slave requests cached password to be deleted for the specified group.
## Public Member Functions
| SlaveInterface (Connection *connection)
void | setConnection (Connection *connection)
Connection * | connection () const
void | setProgressId (int id)
int | progressId () const
void | sendResumeAnswer (bool resume)
void | setOffset (KIO::filesize_t offset)
KIO::filesize_t | offset () const
## Protected Slots
void | calcSpeed ()
## Protected Member Functions
virtual bool | dispatch ()
virtual bool | dispatch (int _cmd, const QByteArray &data)
void | openPassDlg (KIO::AuthInfo &info)
| Prompt the user for authrization info (login & password).
void | openPassDlg (const QString &prompt, const QString &user, const QString &caption, const QString &comment, const QString &label, bool readOnly)
| Same as above except in the argument it accepts.
void | openPassDlg (const QString &prompt, const QString &user, bool readOnly)
| Same as above except in the argument it accepts.
void | messageBox (int type, const QString &text, const QString &caption, const QString &buttonYes, const QString &buttonNo)
void | requestNetwork (const QString &, const QString &)
void | dropNetwork (const QString &, const QString &)
virtual void | virtual_hook (int id, void *data)
## Static Protected Member Functions
void | sigpipe_handler (int)
## Protected Attributes
Connection * | m_pConnection

## Detailed Description

There are two classes that specifies the protocol between application (job) and kioslave.

SlaveInterface is the class to use on the application end, SlaveBase is the one to use on the slave end.

A call to foo() results in a call to slotFoo() on the other end.

Definition at line 127 of file slaveinterface.h.

## Member Function Documentation

void KIO::SlaveInterface::authorizationKey | ( | const QCString & | ,
|  | const QCString & | ,
|  | bool |
| ) | `[signal]`

  | Emitted whenever login (username/password) information needs to be cached. NOTE: this signal is also emitted whenever a Parameters:
  key | token under which authorization is stored.
  grpkey | group token under which authorization is stored.
  keep | if true, user requested password to be cached for entire KDE session.

void KIO::SlaveInterface::delAuthorization | ( | const QCString & | grpkey | ) | `[signal]`

  | Emitted when an io-slave requests cached password to be deleted for the specified group. Parameters:
  grpkey | group token under which authorization is stored.

void SlaveInterface::openPassDlg | ( | KIO::AuthInfo & | info | ) | `[protected]`

| Prompt the user for authrization info (login & password). Use this function to request authorization info from the the end user. For example to open an empty password dialog using default values:
     KIO::AuthInfo authInfo;
     bool result = openPassDlg( authInfo );
     if ( result )
     {
        printf( "Username: %s", result.username.latin1() );
        printf( "Username: %s", result.username.latin1() );
     }

You can also pre-set some values like the username before hand if it is known as well as the comment and caption to be displayed:

     authInfo.comment= "Enter username and password to access acmeone";
     authInfo.caption= "Acme Password Dialog";
     authInfo.username= "Wily E. kaiody";
     bool result = openPassDlg( authInfo );
     if ( result )
     {
        printf( "Username: %s", result.username.latin1() );
        printf( "Username: %s", result.username.latin1() );
     }

NOTE: A call to this function can also fail and result in a return value of `false`, if the UIServer could not be started for whatever reason.

Parameters:

  See | AuthInfo.

Returns:
  `TRUE` if user clicks on "OK", `FALSE` otherwsie.

Definition at line 481 of file slaveinterface.cpp.

References Observer::openPassDlg(), KIO::AuthInfo::prompt, Observer::self(), and KIO::AuthInfo::username.

Referenced by openPassDlg().

void SlaveInterface::openPassDlg | ( | const QString & | prompt,
|  | const QString & | user,
|  | const QString & | caption,
|  | const QString & | comment,
|  | const QString & | label,
|  | bool | readOnly
| ) | `[protected]`

| Same as above except in the argument it accepts. This class or method is obsolete, it is provided for compatibility only.. Use openPassDlg( AuthInfo& ) instead. Definition at line 467 of file slaveinterface.cpp. References KIO::AuthInfo::caption, KIO::AuthInfo::comment, KIO::AuthInfo::commentLabel, KStdAccel::label(), openPassDlg(), KIO::AuthInfo::prompt, KIO::AuthInfo::readOnly, and KIO::AuthInfo::username.

void SlaveInterface::openPassDlg | ( | const QString & | prompt,
|  | const QString & | user,
|  | bool | readOnly
| ) | `[protected]`

| Same as above except in the argument it accepts. This class or method is obsolete, it is provided for compatibility only.. Use openPassDlg( AuthInfo& ) instead. Definition at line 458 of file slaveinterface.cpp. References openPassDlg(), KIO::AuthInfo::prompt, KIO::AuthInfo::readOnly, and KIO::AuthInfo::username.

The documentation for this class was generated from the following files:

- slaveinterface.h
- slaveinterface.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:26:12 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001