Méthode |
Description |
|
AllMetaData ( ) : KIO.MetaData |
Contains all metadata (but no config) sent by the application to the slave. |
|
CacheAuthentication ( KIO info ) : bool |
Explicitly store authentication information. openPasswordDialog 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 openPasswordDialog. |
|
CanResume ( long offset ) : bool |
Call this at the beginning of put(), to give the size of the existing partial file, if there is one. The offset argument notifies the other job (the one that gets the data) about the offset to use. In this case, the boolean returns whether we can indeed resume or not (we can't if the protocol doing the get() doesn't support setting an offset) |
|
CanResume ( ) : void |
Call this at the beginning of get(), if the "resume" metadata was set and resuming is implemented by this protocol. |
|
CheckCachedAuthentication ( KIO info ) : bool |
Checks for cached authentication based on parameters given by info. Use this function to check if any cached password exists for the URL given by info. If AuthInfo .RealmValue and/or AuthInfo .VerifyPath flag is specified, then they will also be factored in determining the presence of a cached password. Note that Auth .Url is a required parameter when attempting to check for cached authorization info. Here is a simple example: AuthInfo info; info.url = KUrl("http://www.foobar.org/foo/bar"); info.username = "somename"; info.verifyPath = true; if ( !checkCachedAuthentication( info ) ) { if ( !openPasswordDialog(info) ) .... } name="info" See AuthInfo. |
|
Config ( ) : Kimono.KConfigGroup |
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. |
|
ConnectSlave ( string path ) : void |
internal function to connect a slave to/ disconnect from either the slave pool or the application |
|
ConnectTimeout ( ) : int |
|
|
Connected ( ) : void |
Call in openConnection, if you reimplement it, when you're done. |
|
Data ( Qyoto.QByteArray data ) : void |
Sends data in the slave to the job (i.e. in get). To signal end of data, simply send an empty QByteArray(). name="data" the data read by the slave |
|
DataReq ( ) : void |
Asks for data from the job. |
|
DisconnectSlave ( ) : void |
|
|
DispatchLoop ( ) : void |
|
|
DropNetwork ( ) : void |
|
|
DropNetwork ( string host ) : void |
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. name="host" the host passed to requestNetwork A slave should call this function every time it disconnect from a host. |
|
ErrorPage ( ) : void |
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. |
|
Exit ( ) : void |
Terminate the slave by calling the destructor and then .Exit() |
|
Finished ( ) : void |
Call to signal successful completion of any command besides openConnection and closeConnection. Do not call this after calling error(). |
|
HasMetaData ( string key ) : bool |
Queries for the existence of a certain config/meta-data entry send by the application to the slave. |
|
InfoMessage ( string msg ) : void |
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. |
|
ListEntries ( List _entry ) : void |
Call this in listDir, each time you have a bunch of entries to report. name="_entry" The UDSEntry containing all of the object attributes. |
|
ListEntry ( KIO _entry, bool ready ) : void |
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) name="_entry" The UDSEntry containing all of the object attributes. name="ready" set to true after emitting all items. _entry is not used in this case |
|
LookupHost ( string host ) : void |
Internally used |
|
MessageBox ( KIO type, string text ) : int |
|
|
MessageBox ( KIO type, string text, string caption ) : int |
|
|
MessageBox ( KIO type, string text, string caption, string buttonYes ) : int |
|
|
MessageBox ( KIO type, string text, string caption, string buttonYes, string buttonNo ) : int |
Call this to show a message box from the slave name="type" type of message box: QuestionYesNo, WarningYesNo, WarningContinueCancel... name="text" Message string. May contain newlines. name="caption" Message box title. name="buttonYes" The text for the first button. The default is i18n("&Yes"). name="buttonNo" The text for the second button. The default is i18n("&No"). Note: for ContinueCancel, buttonYes is the continue button and buttonNo is unused. and for Information, none is used. |
|
MessageBox ( string text, KIO type ) : int |
|
|
MessageBox ( string text, KIO type, string caption ) : int |
|
|
MessageBox ( string text, KIO type, string caption, string buttonYes ) : int |
|
|
MessageBox ( string text, KIO type, string caption, string buttonYes, string buttonNo ) : int |
|
|
MessageBox ( string text, KIO type, string caption, string buttonYes, string buttonNo, string dontAskAgainName ) : int |
Call this to show a message box from the slave name="text" Message string. May contain newlines. name="type" type of message box: QuestionYesNo, WarningYesNo, WarningContinueCancel... name="caption" Message box title. name="buttonYes" The text for the first button. The default is i18n("&Yes"). name="buttonNo" The text for the second button. The default is i18n("&No"). Note: for ContinueCancel, buttonYes is the continue button and buttonNo is unused. and for Information, none is used. name="dontAskAgain" A checkbox is added with which further confirmation can be turned off. If the checkbox was ticked @pdontAskAgain will be set to true, otherwise false. |
|
MetaData ( string key ) : string |
Queries for config/meta-data send by the application to the slave. |
|
MimeType ( string _type ) : void |
Call this in mimetype() and in get(), when you know the mimetype. See mimetype about other ways to implement it. |
|
NeedSubUrlData ( ) : void |
Call to signal that data from the sub-URL is needed |
|
OpenPasswordDialog ( KIO info ) : bool |
|
|
OpenPasswordDialog ( KIO info, string errorMsg ) : bool |
Prompt the user for Authorization info (login & password). Use this function to request authorization information from the end user. You can also pass an error message which explains why a previous authorization attempt failed. Here is a very simple example: KIO.AuthInfo authInfo; if ( openPasswordDialog( authInfo ) ) { kDebug() << QLatin1String("User: ") << authInfo.username << endl; kDebug() << QLatin1String("Password: ") << QLatin1String("Not displayed here!") << endl; } You can also preset some values like the username, caption or comment as follows: KIO.AuthInfo authInfo; authInfo.caption= "Acme Password Dialog"; authInfo.username= "Wile E. Coyote"; string errorMsg = "You entered an incorrect password."; if ( openPasswordDialog( authInfo, errorMsg ) ) { kDebug() << QLatin1String("User: ") << authInfo.username << endl; kDebug() << QLatin1String("Password: ") << QLatin1String("Not displayed here!") << endl; } Note:<> You should consider using checkCachedAuthentication() to see if the password is available in kpasswdserver before calling this function. Note:<> A call to this function can fail and return false , if the UIServer could not be started for whatever reason. name="info" See AuthInfo. name="errorMsg" Error message to show |
|
Opened ( ) : void |
open succedes |
|
Position ( long _pos ) : void |
|
|
ProcessedPercent ( float percent ) : void |
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. |
|
ProcessedSize ( long _bytes ) : void |
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. |
|
ProxyConnectTimeout ( ) : int |
|
|
ReadData ( Qyoto.QByteArray buffer ) : int |
Read data sent by the job, after a dataReq name="buffer" buffer where data is stored |
|
ReadTimeout ( ) : int |
|
|
Redirection ( Kimono.KUrl _url ) : void |
Call this to signal a redirection The job will take care of going to that url. |
|
RemoteEncoding ( ) : Kimono.KRemoteEncoding |
Returns an object that can translate remote filenames into proper Unicode forms. This encoding can be set by the user. |
|
RequestNetwork ( ) : bool |
|
|
RequestNetwork ( string host ) : bool |
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 name="host" tells the netmgr the host the slave wants to connect to. As this could also be a proxy, we can't just take the host currenctly connected to (but that's the default value) |
|
ResponseTimeout ( ) : int |
|
|
SendAndKeepMetaData ( ) : void |
Internal function to transmit meta data to the application. Like sendMetaData() but m_outgoingMetaData will not be cleared. This method is mainly useful in code that runs before the slave is connected to its final job. |
|
SendMetaData ( ) : void |
Internal function to transmit meta data to the application. m_outgoingMetaData will be cleared; this means that if the slave is for example put on hold and picked up by a different KIO.Job later the new job will not see the metadata sent before. See kio/DESIGN.krun for an overview of the state progression of a job/slave. @warning calling this method may seriously interfere with the operation of KIO which relies on the presence of some metadata at some points in time. You should not use it if you are not familiar with KIO and not before the slave is connected to the last job before returning to idle state. |
|
SetKillFlag ( ) : void |
Internally used. |
|
SetMetaData ( string key, string value ) : void |
Sets meta-data to be send to the application before the first data() or finished() signal. |
|
SetTimeoutSpecialCommand ( int timeout ) : void |
|
|
SetTimeoutSpecialCommand ( int timeout, Qyoto.QByteArray data ) : void |
This function sets a timeout of timeout seconds and calls special(data) when the timeout occurs as if it was called by the application. 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. |
|
SlaveBase ( Qyoto.QByteArray protocol, Qyoto.QByteArray pool_socket, Qyoto.QByteArray app_socket ) : System |
|
|
SlaveStatus ( string host, bool connected ) : void |
Used to report the status of the slave. name="host" the slave is currently connected to. (Should be empty if not connected) name="connected" Whether an actual network connection exists. |
|
Speed ( ulong _bytes_per_second ) : void |
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) |
|
StatEntry ( KIO _entry ) : void |
Call this from stat() to express details about an object, the UDSEntry customarily contains the atoms describing file name, size, mimetype, etc. name="_entry" The UDSEntry containing all of the object attributes. |
|
TotalSize ( long _bytes ) : void |
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. |
|
WaitForAnswer ( int expected1, int expected2, Qyoto.QByteArray data ) : int |
|
|
WaitForAnswer ( int expected1, int expected2, Qyoto.QByteArray data, int &pCmd ) : int |
Wait for an answer to our request, until we get expected1 or expected2 |
|
WaitForHostInfo ( Qyoto.QHostInfo info ) : int |
Internally used |
|
Warning ( string msg ) : void |
Call to signal a warning, to be displayed in a dialog box. |
|
WasKilled ( ) : bool |
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. |
|
Written ( long _bytes ) : void |
|
|
error ( int _errid, string _text ) : void |
Call to signal an error. This also finishes the job, so you must not call finished() after calling this. If the error code is KIO.ERR_SLAVE_DEFINED then the _text should contain the complete translated text of of the error message. For all other error codes, _text should match the corresponding error code. Usually,, _text is a file or host name, or the error which was passed from the server. For example, for KIO.ERR_DOES_NOT_EXIST, _text may only be the file or folder which does not exist, nothing else. Otherwise, this would break error strings generated by KIO.BuildErrorString(). If you have to add more details than what the standard error codes provide, you'll need to use KIO.ERR_SLAVE_DEFINED. For a complete list of what _text should contain for each error code, look at the source of KIO.BuildErrorString(). You can add rich text markup to the message, the places where the error message will be displayed are rich text aware. name="_errid" the error code from KIO.Error name="_text" the rich text error message |
|