KIO
slavebase.h
59 SlaveBase(const QByteArray &protocol, const QByteArray &pool_socket, const QByteArray &app_socket);
273 * @param type type of message box: QuestionTwoActions, WarningTwoActions, WarningContinueCancel...
294 * @param type type of message box: QuestionTwoActions, WarningTwoActions, WarningContinueCancel...
395 virtual void setHost(const QString &host, quint16 port, const QString &user, const QString &pass);
639 * This behavior is only invoked if the slave specifies deleteRecursive=true in its protocol file.
943 // Convenience function converting mProtocol to QString as unsupportedActionErrorString(), which
This class is intended to make it easier to prompt for, cache and retrieve authorization information.
MetaData is a simple map of key/value strings.
There are two classes that specifies the protocol between application (job) and kioslave.
void addTemporaryAuthorization(const QString &action)
Adds action to the list of PolicyKit actions which the slave is authorized to perform.
Definition slavebase.cpp:1580
virtual void mimetype(const QUrl &url)
Finds MIME type for one file or directory.
Definition slavebase.cpp:937
bool wasKilled() const
If your ioslave was killed by a signal, wasKilled() returns true.
Definition slavebase.cpp:1468
void mimeType(const QString &_type)
Call this in mimetype() and in get(), when you know the MIME type.
Definition slavebase.cpp:717
virtual void dispatch(int command, const QByteArray &data)
Definition slavebase.cpp:1126
QMap< QString, QVariant > mapConfig() const
Returns a map to query config/meta-data information from.
Definition slavebase.cpp:445
PrivilegeOperationStatus requestPrivilegeOperation(const QString &operationDetails)
Checks with job if privilege operation is allowed.
Definition slavebase.cpp:1552
QString metaData(const QString &key) const
Queries for config/meta-data send by the application to the slave.
Definition slavebase.cpp:420
int openPasswordDialogV2(KIO::AuthInfo &info, const QString &errorMsg=QString())
Prompt the user for Authorization info (login & password).
Definition slavebase.cpp:989
virtual void copy(const QUrl &src, const QUrl &dest, int permissions, JobFlags flags)
Copy src into dest.
Definition slavebase.cpp:949
void sendAndKeepMetaData()
Internal function to transmit meta data to the application.
Definition slavebase.cpp:487
void speed(unsigned long _bytes_per_second)
Call this in get and copy, to give the current transfer speed, but only if it can't be calculated out...
Definition slavebase.cpp:695
void infoMessage(const QString &msg)
Call to signal a message, to be displayed if the application wants to, for instance in a status bar.
Definition slavebase.cpp:779
void processedSize(KIO::filesize_t _bytes)
Call this during get and copy, once in a while, to give some info about the current state.
Definition slavebase.cpp:649
virtual void reparseConfiguration()
Called by the scheduler to tell the slave that the configuration changed (i.e. proxy settings).
Definition slavebase.cpp:983
void setTimeoutSpecialCommand(int timeout, const QByteArray &data=QByteArray())
This function sets a timeout of timeout seconds and calls special(data) when the timeout occurs as if...
Definition slavebase.cpp:1111
int messageBox(MessageBoxType type, const QString &text, const QString &title=QString(), const QString &primaryActionText=QString(), const QString &secondaryActionText=QString())
Call this to show a message box from the slave.
Definition slavebase.cpp:1020
void warning(const QString &msg)
Call to signal a warning, to be displayed in a dialog box.
Definition slavebase.cpp:773
void finished()
Call to signal successful completion of any command besides openConnection and closeConnection.
Definition slavebase.cpp:572
void slaveStatus(const QString &host, bool connected)
Used to report the status of the slave.
Definition slavebase.cpp:627
bool cacheAuthentication(const AuthInfo &info)
Caches info in a persistent storage like KWallet.
Definition slavebase.cpp:1415
virtual void rename(const QUrl &src, const QUrl &dest, JobFlags flags)
Rename oldname into newname.
Definition slavebase.cpp:941
virtual void setLinkDest(const QUrl &url, const QString &target)
Change the destination of a symlink.
Definition slavebase.cpp:957
void sendMetaData()
Internal function to transmit meta data to the application.
Definition slavebase.cpp:481
void listEntry(const UDSEntry &entry)
It collects entries and emits them via listEntries when enough of them are there or a certain time fr...
Definition slavebase.cpp:791
bool hasMetaData(const QString &key) const
Queries for the existence of a certain config/meta-data entry send by the application to the slave.
Definition slavebase.cpp:434
void statEntry(const UDSEntry &_entry)
Call this from stat() to express details about an object, the UDSEntry customarily contains the atoms...
Definition slavebase.cpp:785
virtual void setHost(const QString &host, quint16 port, const QString &user, const QString &pass)
Set the host.
Definition slavebase.cpp:840
virtual void chown(const QUrl &url, const QString &owner, const QString &group)
Change ownership of url.
Definition slavebase.cpp:973
void connected()
Call in openConnection, if you reimplement it, when you're done.
Definition slavebase.cpp:567
KRemoteEncoding * remoteEncoding()
Returns an object that can translate remote filenames into proper Unicode forms.
Definition slavebase.cpp:496
virtual void dispatchOpenCommand(int command, const QByteArray &data)
Definition slavebase.cpp:1375
virtual void symlink(const QString &target, const QUrl &dest, JobFlags flags)
Creates a symbolic link named dest, pointing to target, which may be a relative or an absolute path.
Definition slavebase.cpp:945
int readData(QByteArray &buffer)
Read data sent by the job, after a dataReq.
Definition slavebase.cpp:1104
void connectSlave(const QString &path)
internal function to connect a slave to/ disconnect from either the slave pool or the application
Definition slavebase.cpp:397
virtual void put(const QUrl &url, int permissions, JobFlags flags)
put, i.e. write data into a file.
Definition slavebase.cpp:901
void processedPercent(float percent)
Only use this if you can't know in advance the size of the copied data.
Definition slavebase.cpp:690
virtual void special(const QByteArray &data)
Used for any command that is specific to this slave (protocol).
Definition slavebase.cpp:905
virtual void del(const QUrl &url, bool isfile)
Delete a file or directory.
Definition slavebase.cpp:953
void data(const QByteArray &data)
Sends data in the slave to the job (i.e. in get).
Definition slavebase.cpp:506
virtual void chmod(const QUrl &url, int permissions)
Change permissions on url.
Definition slavebase.cpp:965
void listEntries(const UDSEntryList &_entry)
Call this in listDir, each time you have a bunch of entries to report.
Definition slavebase.cpp:817
virtual void setModificationTime(const QUrl &url, const QDateTime &mtime)
Sets the modification time for url.
Definition slavebase.cpp:969
void totalSize(KIO::filesize_t _bytes)
Call this in get and copy, to give the total size of the file.
Definition slavebase.cpp:640
virtual void stat(const QUrl &url)
Finds all details for one file or directory.
Definition slavebase.cpp:897
int waitForAnswer(int expected1, int expected2, QByteArray &data, int *pCmd=nullptr)
Wait for an answer to our request, until we get expected1 or expected2.
Definition slavebase.cpp:1077
void canResume()
Call this at the beginning of get(), if the "range-start" metadata was set and returning byte ranges ...
Definition slavebase.cpp:635
bool checkCachedAuthentication(AuthInfo &info)
Checks for cached authentication based on parameters given by info.
Definition slavebase.cpp:1365
void setMetaData(const QString &key, const QString &value)
Sets meta-data to be send to the application before the first data() or finished() signal.
Definition slavebase.cpp:415
KConfigGroup * config()
Returns a configuration object to query config/meta-data information from.
Definition slavebase.cpp:465
bool configValue(const QString &key, bool defaultValue) const
Returns a bool from the config/meta-data information.
Definition slavebase.cpp:450
Universal Directory Service.
Allows encoding and decoding properly remote filenames into Unicode.
Definition kremoteencoding.h:37
KIOCORE_EXPORT QString unsupportedActionErrorString(const QString &protocol, int cmd)
Returns an appropriate error message if the given command cmd is an unsupported action (ERR_UNSUPPORT...
Definition slavebase.cpp:849
OpenMode
QString fromLatin1(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:49:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:49:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.