From 90825e2392b2d70e43c7a25b8a3752299a933894 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- python/pyqt/sip/qt/qnetworkprotocol.sip | 227 ++++++++++++++++++++++++++++++++ 1 file changed, 227 insertions(+) create mode 100644 python/pyqt/sip/qt/qnetworkprotocol.sip (limited to 'python/pyqt/sip/qt/qnetworkprotocol.sip') diff --git a/python/pyqt/sip/qt/qnetworkprotocol.sip b/python/pyqt/sip/qt/qnetworkprotocol.sip new file mode 100644 index 00000000..6af512b9 --- /dev/null +++ b/python/pyqt/sip/qt/qnetworkprotocol.sip @@ -0,0 +1,227 @@ +// This is the SIP interface definition for QNetworkOperation, QNetworkProtocol +// and QNetworkProtocolFactoryBase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// This file is part of PyQt. +// +// This copy of PyQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyQt is supplied 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 +// PyQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +QNetworkOperation (Qt v2.1+) + +QNetworkOperation is fully implemented. + + + +QNetworkProtocol (Qt v2.1+) + +QNetworkProtocol is fully implemented. + + + +QNetworkProtocolFactoryBase (Qt v2.1+) + +QNetworkProtocolFactoryBase is fully implemented. + + +%End + + +%If (Qt_NETWORKPROTOCOL) +%If (Qt_2_1_0 -) + +class QNetworkProtocolFactoryBase +{ +%TypeHeaderCode +#include +%End + +public: + virtual QNetworkProtocol *createObject() = 0 /Factory/; + +}; + + +class QNetworkProtocol : QObject +{ +%TypeHeaderCode +#include +%End + +public: + enum State { + StWaiting, + StInProgress, + StDone, + StFailed, + StStopped + }; + +%If (- Qt_3_0_0) + enum Operation { + OpListChildren, + OpMkdir, + OpRemove, + OpRename, + OpGet, + OpPut + }; +%End +%If (Qt_3_0_0 -) + enum Operation { + OpListChildren, + OpMkDir, + OpRemove, + OpRename, + OpGet, + OpPut + }; +%End + + enum ConnectionState { + ConHostFound, + ConConnected, + ConClosed + }; + +%If (- Qt_3_0_0) + enum Error { + NoError, + ErrValid, + ErrUnknownProtocol, + ErrUnsupported, + ErrParse, + ErrLoginIncorrect, + ErrHostNotFound, + ErrListChlidren, + ErrMkdir, + ErrRemove, + ErrRename, + ErrGet, + ErrPut, + ErrFileNotExisting, + ErrPermissionDenied + }; +%End +%If (Qt_3_0_0 -) + enum Error { + NoError, + ErrValid, + ErrUnknownProtocol, + ErrUnsupported, + ErrParse, + ErrLoginIncorrect, + ErrHostNotFound, + ErrListChildren, + ErrMkDir, + ErrRemove, + ErrRename, + ErrGet, + ErrPut, + ErrFileNotExisting, + ErrPermissionDenied + }; +%End + + QNetworkProtocol(); + + virtual void setUrl(QUrlOperator *); + + virtual void setAutoDelete(bool,int = 10000); + bool autoDelete() const; + + static void registerNetworkProtocol(const QString &, + QNetworkProtocolFactoryBase *); + static QNetworkProtocol *getNetworkProtocol(const QString &) /Factory/; + static bool hasOnlyLocalFileSystem(); + + virtual int supportedOperations() const; + virtual void addOperation(QNetworkOperation *); + + QUrlOperator *url() const; + QNetworkOperation *operationInProgress() const; + virtual void clearOperationQueue(); + virtual void stop(); + +signals: + void data(const QByteArray &,QNetworkOperation *); + void connectionStateChanged(int,const QString &); + void finished(QNetworkOperation *); + void start(QNetworkOperation *); + void newChildren(const QValueList &,QNetworkOperation *); + void newChild(const QUrlInfo &,QNetworkOperation *); + void createdDirectory(const QUrlInfo &,QNetworkOperation *); + void removed(QNetworkOperation *); + void itemChanged(QNetworkOperation *); + void dataTransferProgress(int,int,QNetworkOperation *); + +protected: + virtual void processOperation(QNetworkOperation *); + virtual void operationListChildren(QNetworkOperation *); + virtual void operationMkDir(QNetworkOperation *); + virtual void operationRemove(QNetworkOperation *); + virtual void operationRename(QNetworkOperation *); + virtual void operationGet(QNetworkOperation *); + virtual void operationPut(QNetworkOperation *); +%If (Qt_3_0_0 -) + virtual void operationPutChunk(QNetworkOperation *); +%End + virtual bool checkConnection(QNetworkOperation *); + +private: +%If (Qt_3_1_0 -) + QNetworkProtocol(const QNetworkProtocol &); +%End +}; + + +class QNetworkOperation : QObject +{ +%TypeHeaderCode +#include +%End + +public: + QNetworkOperation(QNetworkProtocol::Operation,const QString &, + const QString &,const QString &); + QNetworkOperation(QNetworkProtocol::Operation,const QByteArray &, + const QByteArray &,const QByteArray &); + + void setState(QNetworkProtocol::State); + void setProtocolDetail(const QString &); + void setErrorCode(int); + void setArg(int,const QString &); + void setRawArg(int,const QByteArray &); + + QNetworkProtocol::Operation operation() const; + QNetworkProtocol::State state() const; + QString arg(int) const; + QByteArray rawArg(int) const; + QString protocolDetail() const; + int errorCode() const; + + void free(); + +private: +%If (Qt_3_1_0 -) + QNetworkOperation(const QNetworkOperation &); +%End +}; + +%End +%End -- cgit v1.2.3