//
//     Copyright 2008 Jim Bublitz <jbublitz@nwinternet.com>
//     Earlier copyrights 1998 - 2007 Jim Bublitz also apply

//                 Generated by twine

// This file is part of PyKDE4.

// PyKDE4 is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.

// PyKDE4 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

namespace KIO
{

class SlaveBase
{
%TypeHeaderCode
#include <slavebase.h>
%End


public:
                            SlaveBase (const QByteArray& protocol, const QByteArray& pool_socket, const QByteArray& app_socket);
    void                    exit ();
    void                    dispatchLoop ();
    void                    data (const QByteArray& data);
    void                    dataReq ();
    void                    opened ();
    void                    error (int _errid, const QString& _text);
    void                    connected ();
    void                    finished ();
    void                    needSubUrlData ();
    void                    slaveStatus (const QString& host, bool connected);
    void                    statEntry (const KIO::UDSEntry& _entry);
    void                    listEntries (const KIO::UDSEntryList& _entry);
    bool                    canResume (KIO::filesize_t offset);
    void                    canResume ();
    void                    totalSize (KIO::filesize_t _bytes);
    void                    processedSize (KIO::filesize_t _bytes);
    void                    position (KIO::filesize_t _pos);
    void                    written (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);

    enum MessageBoxType
    {
        QuestionYesNo,
        WarningYesNo,
        WarningContinueCancel,
        WarningYesNoCancel,
        Information,
        SSLMessageBox
    };

    int                     messageBox (KIO::SlaveBase::MessageBoxType type, const QString& text, const QString& caption = QString(), const QString& buttonYes = i18n("&Yes"), const QString& buttonNo = i18n("&No"));
    int                     messageBox (const QString& text, KIO::SlaveBase::MessageBoxType type, const QString& caption = QString(), const QString& buttonYes = i18n("&Yes"), const QString& buttonNo = i18n("&No"), const QString& dontAskAgainName = QString());
    void                    setMetaData (const QString& key, const QString& value);
    bool                    hasMetaData (const QString& key) const;
    QString                 metaData (const QString& key) const;
    KIO::MetaData           allMetaData () const;
    KConfigGroup*           config ();
    KRemoteEncoding*        remoteEncoding ();
    virtual void            setHost (const QString& host, quint16 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            open (const KUrl& url, QIODevice::OpenMode mode);
    virtual void            read (KIO::filesize_t size);
    virtual void            write (const QByteArray& data);
    virtual void            seek (KIO::filesize_t offset);
    virtual void            close ();
    virtual void            put (const KUrl& url, int permissions, KIO::JobFlags flags);
    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, KIO::JobFlags flags);
    virtual void            symlink (const QString& target, const KUrl& dest, KIO::JobFlags flags);
    virtual void            chmod (const KUrl& url, int permissions);
    virtual void            chown (const KUrl& url, const QString& owner, const QString& group);
    virtual void            setModificationTime (const KUrl& url, const QDateTime& mtime);
    virtual void            copy (const KUrl& src, const KUrl& dest, int permissions, KIO::JobFlags flags);
    virtual void            del (const KUrl& url, bool isfile) /PyName=del_/;
    virtual void            setLinkDest (const KUrl& url, const QString& target);
    virtual void            special (const QByteArray& data);
    virtual void            multiGet (const QByteArray& data);
    virtual void            slave_status ();
    virtual void            reparseConfiguration ();
    int                     connectTimeout ();
    int                     proxyConnectTimeout ();
    int                     responseTimeout ();
    int                     readTimeout ();
    void                    setTimeoutSpecialCommand (int timeout, const QByteArray& data = QByteArray());
    virtual void            dispatch (int command, const QByteArray& data);
    virtual void            dispatchOpenCommand (int command, const QByteArray& data);
    int                     readData (QByteArray& buffer);
    void                    listEntry (const KIO::UDSEntry& _entry, bool ready);
    void                    connectSlave (const QString& path);
    void                    disconnectSlave ();
    bool                    openPasswordDialog (KIO::AuthInfo& info, const QString& errorMsg = QString());
    bool                    checkCachedAuthentication (KIO::AuthInfo& info);
    bool                    cacheAuthentication (const KIO::AuthInfo& info);
    bool                    requestNetwork (const QString& host = QString());
    void                    dropNetwork (const QString& host = QString());
    int                     waitForAnswer (int expected1, int expected2, QByteArray& data, int* pCmd /Out/ = 0);
    void                    sendMetaData ();
    void                    sendAndKeepMetaData ();
    bool                    wasKilled () const;
    void                    setKillFlag ();
    void                    lookupHost (const QString& host);
    int                     waitForHostInfo (QHostInfo& info);

protected:
//ig     virtual void       virtual_hook (int id, void* data);

private:
                            SlaveBase (const KIO::SlaveBase& other);
};   // SlaveBase

};   // KIO


