C# Class KIO.SlaveBase

Inheritance: Object, ISlaveBase
Afficher le fichier Open project: 0xd34df00d/Qross

Protected Properties

Свойство Type Description
interceptor Qyoto.SmokeInvocation

Méthodes publiques

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

Méthodes protégées

Méthode Description
CreateProxy ( ) : void
SlaveBase ( Type dummy ) : System

Private Methods

Méthode Description
Chmod ( Kimono.KUrl url, int permissions ) : void
Chown ( Kimono.KUrl url, string owner, string group ) : void
Close ( ) : void
CloseConnection ( ) : void
Copy ( Kimono.KUrl src, Kimono.KUrl dest, int permissions, uint flags ) : void
Del ( Kimono.KUrl url, bool isfile ) : void
Dispatch ( int command, Qyoto.QByteArray data ) : void
DispatchOpenCommand ( int command, Qyoto.QByteArray data ) : void
Get ( Kimono.KUrl url ) : void
ListDir ( Kimono.KUrl url ) : void
Mimetype ( Kimono.KUrl url ) : void
Mkdir ( Kimono.KUrl url, int permissions ) : void
MultiGet ( Qyoto.QByteArray data ) : void
Open ( Kimono.KUrl url, uint mode ) : void
OpenConnection ( ) : void
Put ( Kimono.KUrl url, int permissions, uint flags ) : void
Read ( long size ) : void
Rename ( Kimono.KUrl src, Kimono.KUrl dest, uint flags ) : void
ReparseConfiguration ( ) : void
Seek ( long offset ) : void
SetHost ( string host, ushort port, string user, string pass ) : void
SetLinkDest ( Kimono.KUrl url, string target ) : void
SetModificationTime ( Kimono.KUrl url, Qyoto.QDateTime mtime ) : void
SetSubUrl ( Kimono.KUrl url ) : void
Slave_status ( ) : void
Special ( Qyoto.QByteArray data ) : void
Stat ( Kimono.KUrl url ) : void
Symlink ( string target, Kimono.KUrl dest, uint flags ) : void
Write ( Qyoto.QByteArray data ) : void

Method Details

AllMetaData() public méthode

Contains all metadata (but no config) sent by the application to the slave.
public AllMetaData ( ) : KIO.MetaData
Résultat KIO.MetaData

CacheAuthentication() public méthode

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.
public CacheAuthentication ( KIO info ) : bool
info KIO
Résultat bool

CanResume() public méthode

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)
public CanResume ( long offset ) : bool
offset long
Résultat bool

CanResume() public méthode

Call this at the beginning of get(), if the "resume" metadata was set and resuming is implemented by this protocol.
public CanResume ( ) : void
Résultat void

CheckCachedAuthentication() public méthode

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.
public CheckCachedAuthentication ( KIO info ) : bool
info KIO
Résultat bool

Config() public méthode

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.
public Config ( ) : Kimono.KConfigGroup
Résultat Kimono.KConfigGroup

ConnectSlave() public méthode

internal function to connect a slave to/ disconnect from either the slave pool or the application
public ConnectSlave ( string path ) : void
path string
Résultat void

ConnectTimeout() public méthode

public ConnectTimeout ( ) : int
Résultat int

Connected() public méthode

Call in openConnection, if you reimplement it, when you're done.
public Connected ( ) : void
Résultat void

CreateProxy() protected méthode

protected CreateProxy ( ) : void
Résultat void

Data() public méthode

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
public Data ( Qyoto.QByteArray data ) : void
data Qyoto.QByteArray
Résultat void

DataReq() public méthode

Asks for data from the job.
public DataReq ( ) : void
Résultat void

DisconnectSlave() public méthode

public DisconnectSlave ( ) : void
Résultat void

DispatchLoop() public méthode

public DispatchLoop ( ) : void
Résultat void

DropNetwork() public méthode

public DropNetwork ( ) : void
Résultat void

DropNetwork() public méthode

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.
public DropNetwork ( string host ) : void
host string
Résultat void

ErrorPage() public méthode

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.
public ErrorPage ( ) : void
Résultat void

Exit() public méthode

Terminate the slave by calling the destructor and then .Exit()
public Exit ( ) : void
Résultat void

Finished() public méthode

Call to signal successful completion of any command besides openConnection and closeConnection. Do not call this after calling error().
public Finished ( ) : void
Résultat void

HasMetaData() public méthode

Queries for the existence of a certain config/meta-data entry send by the application to the slave.
public HasMetaData ( string key ) : bool
key string
Résultat bool

InfoMessage() public méthode

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.
public InfoMessage ( string msg ) : void
msg string
Résultat void

ListEntries() public méthode

Call this in listDir, each time you have a bunch of entries to report. name="_entry" The UDSEntry containing all of the object attributes.
public ListEntries ( List _entry ) : void
_entry List
Résultat void

ListEntry() public méthode

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
public ListEntry ( KIO _entry, bool ready ) : void
_entry KIO
ready bool
Résultat void

LookupHost() public méthode

Internally used
public LookupHost ( string host ) : void
host string
Résultat void

MessageBox() public méthode

public MessageBox ( KIO type, string text ) : int
type KIO
text string
Résultat int

MessageBox() public méthode

public MessageBox ( KIO type, string text, string caption ) : int
type KIO
text string
caption string
Résultat int

MessageBox() public méthode

public MessageBox ( KIO type, string text, string caption, string buttonYes ) : int
type KIO
text string
caption string
buttonYes string
Résultat int

MessageBox() public méthode

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.
public MessageBox ( KIO type, string text, string caption, string buttonYes, string buttonNo ) : int
type KIO
text string
caption string
buttonYes string
buttonNo string
Résultat int

MessageBox() public méthode

public MessageBox ( string text, KIO type ) : int
text string
type KIO
Résultat int

MessageBox() public méthode

public MessageBox ( string text, KIO type, string caption ) : int
text string
type KIO
caption string
Résultat int

MessageBox() public méthode

public MessageBox ( string text, KIO type, string caption, string buttonYes ) : int
text string
type KIO
caption string
buttonYes string
Résultat int

MessageBox() public méthode

public MessageBox ( string text, KIO type, string caption, string buttonYes, string buttonNo ) : int
text string
type KIO
caption string
buttonYes string
buttonNo string
Résultat int

MessageBox() public méthode

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.
public MessageBox ( string text, KIO type, string caption, string buttonYes, string buttonNo, string dontAskAgainName ) : int
text string
type KIO
caption string
buttonYes string
buttonNo string
dontAskAgainName string
Résultat int

MetaData() public méthode

Queries for config/meta-data send by the application to the slave.
public MetaData ( string key ) : string
key string
Résultat string

MimeType() public méthode

Call this in mimetype() and in get(), when you know the mimetype. See mimetype about other ways to implement it.
public MimeType ( string _type ) : void
_type string
Résultat void

NeedSubUrlData() public méthode

Call to signal that data from the sub-URL is needed
public NeedSubUrlData ( ) : void
Résultat void

OpenPasswordDialog() public méthode

public OpenPasswordDialog ( KIO info ) : bool
info KIO
Résultat bool

OpenPasswordDialog() public méthode

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
public OpenPasswordDialog ( KIO info, string errorMsg ) : bool
info KIO
errorMsg string
Résultat bool

Opened() public méthode

open succedes
public Opened ( ) : void
Résultat void

Position() public méthode

public Position ( long _pos ) : void
_pos long
Résultat void

ProcessedPercent() public méthode

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.
public ProcessedPercent ( float percent ) : void
percent float
Résultat void

ProcessedSize() public méthode

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.
public ProcessedSize ( long _bytes ) : void
_bytes long
Résultat void

ProxyConnectTimeout() public méthode

public ProxyConnectTimeout ( ) : int
Résultat int

ReadData() public méthode

Read data sent by the job, after a dataReq name="buffer" buffer where data is stored
public ReadData ( Qyoto.QByteArray buffer ) : int
buffer Qyoto.QByteArray
Résultat int

ReadTimeout() public méthode

public ReadTimeout ( ) : int
Résultat int

Redirection() public méthode

Call this to signal a redirection The job will take care of going to that url.
public Redirection ( Kimono.KUrl _url ) : void
_url Kimono.KUrl
Résultat void

RemoteEncoding() public méthode

Returns an object that can translate remote filenames into proper Unicode forms. This encoding can be set by the user.
public RemoteEncoding ( ) : Kimono.KRemoteEncoding
Résultat Kimono.KRemoteEncoding

RequestNetwork() public méthode

public RequestNetwork ( ) : bool
Résultat bool

RequestNetwork() public méthode

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)
public RequestNetwork ( string host ) : bool
host string
Résultat bool

ResponseTimeout() public méthode

public ResponseTimeout ( ) : int
Résultat int

SendAndKeepMetaData() public méthode

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.
public SendAndKeepMetaData ( ) : void
Résultat void

SendMetaData() public méthode

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.
public SendMetaData ( ) : void
Résultat void

SetKillFlag() public méthode

Internally used.
public SetKillFlag ( ) : void
Résultat void

SetMetaData() public méthode

Sets meta-data to be send to the application before the first data() or finished() signal.
public SetMetaData ( string key, string value ) : void
key string
value string
Résultat void

SetTimeoutSpecialCommand() public méthode

public SetTimeoutSpecialCommand ( int timeout ) : void
timeout int
Résultat void

SetTimeoutSpecialCommand() public méthode

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.
public SetTimeoutSpecialCommand ( int timeout, Qyoto.QByteArray data ) : void
timeout int
data Qyoto.QByteArray
Résultat void

SlaveBase() public méthode

public SlaveBase ( Qyoto.QByteArray protocol, Qyoto.QByteArray pool_socket, Qyoto.QByteArray app_socket ) : System
protocol Qyoto.QByteArray
pool_socket Qyoto.QByteArray
app_socket Qyoto.QByteArray
Résultat System

SlaveBase() protected méthode

protected SlaveBase ( Type dummy ) : System
dummy System.Type
Résultat System

SlaveStatus() public méthode

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.
public SlaveStatus ( string host, bool connected ) : void
host string
connected bool
Résultat void

Speed() public méthode

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)
public Speed ( ulong _bytes_per_second ) : void
_bytes_per_second ulong
Résultat void

StatEntry() public méthode

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.
public StatEntry ( KIO _entry ) : void
_entry KIO
Résultat void

TotalSize() public méthode

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.
public TotalSize ( long _bytes ) : void
_bytes long
Résultat void

WaitForAnswer() public méthode

public WaitForAnswer ( int expected1, int expected2, Qyoto.QByteArray data ) : int
expected1 int
expected2 int
data Qyoto.QByteArray
Résultat int

WaitForAnswer() public méthode

Wait for an answer to our request, until we get expected1 or expected2
public WaitForAnswer ( int expected1, int expected2, Qyoto.QByteArray data, int &pCmd ) : int
expected1 int
expected2 int
data Qyoto.QByteArray
pCmd int
Résultat int

WaitForHostInfo() public méthode

Internally used
public WaitForHostInfo ( Qyoto.QHostInfo info ) : int
info Qyoto.QHostInfo
Résultat int

Warning() public méthode

Call to signal a warning, to be displayed in a dialog box.
public Warning ( string msg ) : void
msg string
Résultat void

WasKilled() public méthode

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.
public WasKilled ( ) : bool
Résultat bool

Written() public méthode

public Written ( long _bytes ) : void
_bytes long
Résultat void

error() public méthode

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
public error ( int _errid, string _text ) : void
_errid int
_text string
Résultat void

Property Details

interceptor protected_oe property

protected SmokeInvocation,Qyoto interceptor
Résultat Qyoto.SmokeInvocation