#include <slavebase.h>
Inheritance diagram for KIO::SlaveBase:

Public Methods | |
| void | data (const QByteArray &data) |
| void | dataReq () |
| void | error (int _errid, const QString &_text) |
| void | connected () |
| void | finished () |
| void | needSubURLData () |
| void | slaveStatus (const QString &host, bool connected) |
| void | statEntry (const UDSEntry &_entry) |
| void | listEntries (const UDSEntryList &_entry) |
| bool | canResume (KIO::filesize_t offset) |
| void | totalSize (KIO::filesize_t _bytes) |
| void | processedSize (KIO::filesize_t _bytes) |
| void | processedPercent (float percent) |
| void | speed (unsigned long _bytes_per_second) |
| void | redirection (const KURL &_url) |
| void | errorPage () |
| void | mimeType (const QString &_type) |
| void | warning (const QString &msg) |
| void | infoMessage (const QString &msg) |
| int | messageBox (MessageBoxType type, const QString &text, const QString &caption=QString::null, const QString &buttonYes=QString::null, const QString &buttonNo=QString::null) |
| void | setMetaData (const QString &key, const QString &value) |
| bool | hasMetaData (const QString &key) |
| QString | metaData (const QString &key) |
| KConfigBase * | config () |
| virtual void | setHost (const QString &host, int port, const QString &user, const QString &pass) |
| virtual void | setSubURL (const KURL &url) |
| virtual void | openConnection () |
| virtual void | closeConnection () |
| virtual void | get (const KURL &url) |
| virtual void | put (const KURL &url, int permissions, bool overwrite, bool resume) |
| virtual void | stat (const KURL &url) |
| virtual void | mimetype (const KURL &url) |
| virtual void | listDir (const KURL &url) |
| virtual void | mkdir (const KURL &url, int permissions) |
| virtual void | rename (const KURL &src, const KURL &dest, bool overwrite) |
| virtual void | symlink (const QString &target, const KURL &dest, bool overwrite) |
| virtual void | chmod (const KURL &url, int permissions) |
| virtual void | copy (const KURL &src, const KURL &dest, int permissions, bool overwrite) |
| virtual void | del (const KURL &url, bool isfile) |
| virtual void | special (const QByteArray &) |
| virtual void | multiGet (const QByteArray &) |
| virtual void | slave_status () |
| virtual void | reparseConfiguration () |
| int | connectTimeout () |
| int | proxyConnectTimeout () |
| int | responseTimeout () |
| int | readTimeout () |
| void | setTimeoutSpecialCommand (int timeout, const QByteArray &data=QByteArray()) |
| int | readData (QByteArray &buffer) |
| void | listEntry (const UDSEntry &_entry, bool ready) |
| void | connectSlave (const QString &path) |
| bool | pingCacheDaemon () const |
| bool | openPassDlg (KIO::AuthInfo &info, const QString &errorMsg) |
| bool | checkCachedAuthentication (AuthInfo &info) |
| bool | cacheAuthentication (const AuthInfo &info) |
| QString | createAuthCacheKey (const KURL &url) |
| void | sendAuthenticationKey (const QCString &gKey, const QCString &key, bool keep) |
| void | delCachedAuthentication (const QString &key) |
| void | setMultipleAuthCaching (bool enable) |
| bool | multipleAuthCaching () const |
| bool | requestNetwork (const QString &host=QString::null) |
| void | dropNetwork (const QString &host=QString::null) |
| DCOPClient * | dcopClient () |
| int | waitForAnswer (int expected1, int expected2, QByteArray &data, int *pCmd=0) |
| void | sendMetaData () |
| bool | wasKilled () const |
| void | setKillFlag () |
Public Attributes | |
| QCString | mProtocol |
Slave implementations should simply inherit SlaveBase
A call to foo() results in a call to slotFoo() on the other end.
Definition at line 44 of file slavebase.h.
|
|
Explicitly store authentication information. openPassDlg already stores password information automatically, you only need to call this function if you want to store authentication information that is different from the information returned by openPassDlg. |
|
|
Call this at the beginning of put(), to give the size of the existing partial file, if there is one. The |
|
|
Checks for cached authentication based on parameters given by
Use this function to check if any cached password exists for the URL given by
AuthInfo info; info.url = KURL("http://www.foobar.org/foo/bar"); info.username = "somename"; info.verifyPath = true; if ( !checkCachedAuthentication( info ) ) { if ( !openPassDlg(info) ) .... }
If the protocol allows multiple resources within the same location to be protected by different passwords, then to determine the correct password and send pre-emtively, i.e. before the other end requires it, you can use one or both of the following methods: set the unique identifier using
info.url = KURL("http://www.foobar.org/foo/bar"); info.verifyPath = true; info.realmValue = "unique_identifier"; NOTE: A call to this function will fail and return false, whenever the "kdesud" could not be started for whatever reason or an invalid URL is supplied.
|
|
||||||||||||
|
Change permissions on |
|
|
Closes the connection (forced) Called when the application disconnects the slave to close any open network connections. When the slave was operating in connection-oriented mode, it should reset itself to connectionless (default) mode. |
|
|
Returns a configuration object to query config/meta-data information from. The application provides the slave with all configuration information relevant for the current protocol and host. |
|
|
Call in openConnection, if you reimplement it, when you're done. |
|
|
internal function to connect a slave to/ disconnect from either the slave pool or the application |
|
|
|
|
||||||||||||||||||||
|
Copy
|
|
|
Creates a basic key to be used to cache the password.
|
|
|
Sends data in the slave to the job (i.e. in get). To signal end of data, simply send an empty QByteArray().
Referenced by KIO::TCPSlaveBase::Read(), KIO::TCPSlaveBase::ReadLine(), and KIO::TCPSlaveBase::Write(). |
|
|
Asks for data from the job.
|
|
|
Return the dcop client used by this slave.
|
|
||||||||||||
|
Delete a file or directory.
|
|
|
@obsolete Cache authentication information is now stored automatically by openPassDlg. |
|
|
Used by the slave to withdraw a connection requested by requestNetwork. This function cancels the last call to requestNetwork. If a client uses more than one internet connection, it must use dropNetwork(host) to stop each request. If KNetMgr is not running, then this is a no-op.
|
|
||||||||||||
|
Call to signal an error. This also finishes the job, no need to call finished. If the Error code is KIO::ERR_SLAVE_DEFINED then the _text should contain the complete translated text of of the error message. This message will be displayed in an KTextBrowser which allows rich text complete with hyper links. Email links will call the default mailer, "exec:/command arg1 arg2" will be forked and all other links will call the default browser.
|
|
|
Tell that we will only get an error page here. This means: the data you'll get isn't the data you requested, but an error page (usually HTML) that describes an error. |
|
|
Call to signal successful completion of any command (besides openConnection and closeConnection) |
|
|
get, aka read. |
|
|
Queries for the existance of a certain config/meta-data entry send by the application to the slave. |
|
|
Call to signal a message, to be displayed if the application wants to, for instance in a status bar. Usual examples are "connecting to host xyz", etc. |
|
|
Lists the contents of |
|
|
Call this in listDir, each time you have a bunch of entries to report. |
|
||||||||||||
|
internal function to be called by the slave. It collects entries and emits them via listEntries when enough of them are there or a certain time frame exceeded (to make sure the app gets some items in time but not too many items one by one as this will cause a drastic performance penalty)
|
|
||||||||||||||||||||||||
|
Call this to show a message box from the slave (it will in fact be handled by kio_uiserver, so that the progress info dialog for the slave is hidden while this message box is shown)
|
|
|
Queries for config/meta-data send by the application to the slave. |
|
|
Finds mimetype for one file or directory. This method should either emit 'mimeType' or it should send a block of data big enough to be able to determine the mimetype. If the slave doesn't reimplement it, a get will be issued, i.e. the whole file will be downloaded before determining the mimetype on it - this is obviously not a good thing in most cases. |
|
|
Call this in mimetype, when you know the mimetype. See mimetype about other ways to implement it. |
|
||||||||||||
|
Create a directory
|
|
|
Used for multiple get. Currently only used foir HTTP pielining support.
|
|
|
|
|
|
Call to signal that data from the sub-URL is needed |
|
|
Opens the connection (forced) When this function gets called the slave is operating in connection-oriented mode. When a connection gets lost while the slave operates in connection oriented mode, the slave should report ERR_CONNECTION_BROKEN instead of reconnecting. |
|
||||||||||||
|
Prompt the user for Authorization info (login & password). Use this function to request authorization info from the the end user. You can also pass an errorMsg which explains why a previous authorisation attempt failed. For example to open an empty password dialog using default values:
KIO::AuthInfo authInfo; if ( openPassDlg( authInfo ) ) { printf( "Username: s", authInfo.username.latin1() ); printf( "Password: s", authInfo.password.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:
KIO::AuthInfo authInfo; authInfo.caption= "Acme Password Dialog"; authInfo.username= "Wile E. Coyote"; QString errorMsg = "You entered an incorrect password."; if ( openPassDlg( authInfo, errorMsg ) ) { printf( "Username: s", authInfo.username.latin1() ); printf( "Password: s", authInfo.password.latin1() ); }
NOTE: A call to this function can also fail and result in a return value of
|
|
|
Checks whether the password daemon kdesud is running or if it can be started if it is not.
|
|
|
Only use this if you can't know in advance the size of the copied data. For example, if you're doing variable bitrate compression of the source. STUB ! Currently unimplemented. Here now for binary compatibility. Call this during get and copy, once in a while, to give some info about the current state. Don't emit it in listDir, listEntries speaks for itself. |
|
|
Call this during get and copy, once in a while, to give some info about the current state. Don't emit it in listDir, listEntries speaks for itself. |
|
|
|
|
||||||||||||||||||||
|
put, aka write.
|
|
|
Read data send by the job, after a dataReq
|
|
|
|
|
|
Call this to signal a redirection The job will take care of going to that url. |
|
||||||||||||||||
|
Rename
|
|
|
Called by the scheduler to tell the slave that the configuration changed (i.e. proxy settings) . |
|
|
Used by the slave to check if it can connect to a given host. This should be called where the slave is ready to do a connect() on a socket. For each call to requestNetwork must exist a matching call to dropNetwork, or the system will stay online until KNetMgr gets closed (or the SlaveBase gets destructed)! If KNetMgr is not running, then this is a no-op and returns true
|
|
|
|
|
||||||||||||||||
|
@obsolete Cache authentication information is now stored automatically by openPassDlg. |
|
|
Internal function to transmit meta data to the application. |
|
||||||||||||||||||||
|
Set the host
|
|
|
Internally used. |
|
||||||||||||
|
Sets meta-data to be send to the application before the first data() or finished() signal. |
|
|
Setup support for multiple auth-info caching to a single server.
Calling this function with the argument set to
|
|
|
Prepare slave for streaming operation |
|
||||||||||||
|
This function sets a timeout of A timeout can only occur when the slave is waiting for a command from the application. Specifying a negative timeout cancels a pending timeout. Only one timeout at a time is supported, setting a timeout cancels any pending timeout.
|
|
|
Called to get the status of the slave. Slave should respond by calling slaveStatus(...) |
|
||||||||||||
|
Used to report the status of the slave.
|
|
|
Used for any command that is specific to this slave (protocol) Examples are : HTTP POST, mount and unmount (kio_file)
|
|
|
Call this in get and copy, to give the current transfer speed, but only if it can't be calculated out of the size you passed to processedSize (in most cases you don't want to call it) |
|
|
Finds all details for one file or directory. The information returned is the same as what listDir returns, but only for one file or directory. |
|
|
Call this from stat() to express details about an object, the UDSEntry customarily contains the atoms describing file name, size, mimetype, etc.
|
|
||||||||||||||||
|
Creates a symbolic link named
|
|
|
Call this in get and copy, to give the total size of the file Call in listDir too, when you know the total number of items. |
|
||||||||||||||||||||
|
Wait for an answer to our request, until we get
|
|
|
Call to signal a warning, to be displayed in a dialog box. |
|
|
If your ioslave was killed by a signal, wasKilled() returns true. Check it regularly in lengthy functions (e.g. in get();) and return as fast as possible from this function if wasKilled() returns true. This will ensure that your slave destructor will be called correctly.
|
|
|
Name of the protocol supported by this slave Definition at line 757 of file slavebase.h. |
1.2.18