You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
187 lines
4.5 KiB
187 lines
4.5 KiB
13 years ago
|
// This is the SIP interface definition for TQNetworkOperation, TQNetworkProtocol
|
||
|
// and TQNetworkProtocolFactoryBase.
|
||
13 years ago
|
//
|
||
|
// Copyright (c) 2007
|
||
|
// Riverbank Computing Limited <info@riverbankcomputing.co.uk>
|
||
|
//
|
||
13 years ago
|
// This file is part of PyTQt.
|
||
13 years ago
|
//
|
||
13 years ago
|
// This copy of PyTQt is free software; you can redistribute it and/or modify it
|
||
13 years ago
|
// 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.
|
||
|
//
|
||
13 years ago
|
// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY
|
||
13 years ago
|
// 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
|
||
13 years ago
|
// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation,
|
||
13 years ago
|
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||
|
|
||
|
|
||
|
%ExportedDoc
|
||
13 years ago
|
<Sect2><Title>TQNetworkOperation (TQt v2.1+)</Title>
|
||
13 years ago
|
<Para>
|
||
13 years ago
|
<Literal>TQNetworkOperation</Literal> is fully implemented.
|
||
13 years ago
|
</Para>
|
||
|
</Sect2>
|
||
|
|
||
13 years ago
|
<Sect2><Title>TQNetworkProtocol (TQt v2.1+)</Title>
|
||
13 years ago
|
<Para>
|
||
13 years ago
|
<Literal>TQNetworkProtocol</Literal> is fully implemented.
|
||
13 years ago
|
</Para>
|
||
|
</Sect2>
|
||
|
|
||
13 years ago
|
<Sect2><Title>TQNetworkProtocolFactoryBase (TQt v2.1+)</Title>
|
||
13 years ago
|
<Para>
|
||
13 years ago
|
<Literal>TQNetworkProtocolFactoryBase</Literal> is fully implemented.
|
||
13 years ago
|
</Para>
|
||
|
</Sect2>
|
||
|
%End
|
||
|
|
||
|
|
||
13 years ago
|
%If (TQt_NETWORKPROTOCOL)
|
||
13 years ago
|
|
||
13 years ago
|
class TQNetworkProtocolFactoryBase
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqnetworkprotocol.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
public:
|
||
13 years ago
|
virtual TQNetworkProtocol *createObject() = 0 /Factory/;
|
||
13 years ago
|
|
||
|
};
|
||
|
|
||
|
|
||
13 years ago
|
class TQNetworkProtocol : TQObject
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqnetworkprotocol.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
public:
|
||
|
enum State {
|
||
|
StWaiting,
|
||
|
StInProgress,
|
||
|
StDone,
|
||
|
StFailed,
|
||
|
StStopped
|
||
|
};
|
||
|
|
||
|
enum Operation {
|
||
|
OpListChildren,
|
||
|
OpMkDir,
|
||
|
OpRemove,
|
||
|
OpRename,
|
||
|
OpGet,
|
||
|
OpPut
|
||
|
};
|
||
|
|
||
|
enum ConnectionState {
|
||
|
ConHostFound,
|
||
|
ConConnected,
|
||
|
ConClosed
|
||
|
};
|
||
|
|
||
|
enum Error {
|
||
|
NoError,
|
||
|
ErrValid,
|
||
|
ErrUnknownProtocol,
|
||
|
ErrUnsupported,
|
||
|
ErrParse,
|
||
|
ErrLoginIncorrect,
|
||
|
ErrHostNotFound,
|
||
|
ErrListChildren,
|
||
|
ErrMkDir,
|
||
|
ErrRemove,
|
||
|
ErrRename,
|
||
|
ErrGet,
|
||
|
ErrPut,
|
||
|
ErrFileNotExisting,
|
||
|
ErrPermissionDenied
|
||
|
};
|
||
|
|
||
13 years ago
|
TQNetworkProtocol();
|
||
13 years ago
|
|
||
13 years ago
|
virtual void setUrl(TQUrlOperator *);
|
||
13 years ago
|
|
||
|
virtual void setAutoDelete(bool,int = 10000);
|
||
|
bool autoDelete() const;
|
||
|
|
||
13 years ago
|
static void registerNetworkProtocol(const TQString &,
|
||
|
TQNetworkProtocolFactoryBase *);
|
||
|
static TQNetworkProtocol *getNetworkProtocol(const TQString &) /Factory/;
|
||
13 years ago
|
static bool hasOnlyLocalFileSystem();
|
||
|
|
||
|
virtual int supportedOperations() const;
|
||
13 years ago
|
virtual void addOperation(TQNetworkOperation *);
|
||
13 years ago
|
|
||
13 years ago
|
TQUrlOperator *url() const;
|
||
|
TQNetworkOperation *operationInProgress() const;
|
||
13 years ago
|
virtual void clearOperationQueue();
|
||
|
virtual void stop();
|
||
|
|
||
|
signals:
|
||
13 years ago
|
void data(const TQByteArray &,TQNetworkOperation *);
|
||
|
void connectionStateChanged(int,const TQString &);
|
||
|
void finished(TQNetworkOperation *);
|
||
|
void start(TQNetworkOperation *);
|
||
|
void newChildren(const TQValueList<TQUrlInfo> &,TQNetworkOperation *);
|
||
|
void newChild(const TQUrlInfo &,TQNetworkOperation *);
|
||
|
void createdDirectory(const TQUrlInfo &,TQNetworkOperation *);
|
||
|
void removed(TQNetworkOperation *);
|
||
|
void itemChanged(TQNetworkOperation *);
|
||
|
void dataTransferProgress(int,int,TQNetworkOperation *);
|
||
13 years ago
|
|
||
|
protected:
|
||
13 years ago
|
virtual void processOperation(TQNetworkOperation *);
|
||
|
virtual void operationListChildren(TQNetworkOperation *);
|
||
|
virtual void operationMkDir(TQNetworkOperation *);
|
||
|
virtual void operationRemove(TQNetworkOperation *);
|
||
|
virtual void operationRename(TQNetworkOperation *);
|
||
|
virtual void operationGet(TQNetworkOperation *);
|
||
|
virtual void operationPut(TQNetworkOperation *);
|
||
|
virtual void operationPutChunk(TQNetworkOperation *);
|
||
|
virtual bool checkConnection(TQNetworkOperation *);
|
||
13 years ago
|
|
||
|
private:
|
||
13 years ago
|
TQNetworkProtocol(const TQNetworkProtocol &);
|
||
13 years ago
|
};
|
||
|
|
||
|
|
||
13 years ago
|
class TQNetworkOperation : TQObject
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqnetworkprotocol.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
public:
|
||
13 years ago
|
TQNetworkOperation(TQNetworkProtocol::Operation,const TQString &,
|
||
|
const TQString &,const TQString &);
|
||
|
TQNetworkOperation(TQNetworkProtocol::Operation,const TQByteArray &,
|
||
|
const TQByteArray &,const TQByteArray &);
|
||
13 years ago
|
|
||
13 years ago
|
void setState(TQNetworkProtocol::State);
|
||
|
void setProtocolDetail(const TQString &);
|
||
13 years ago
|
void setErrorCode(int);
|
||
13 years ago
|
void setArg(int,const TQString &);
|
||
|
void setRawArg(int,const TQByteArray &);
|
||
|
|
||
|
TQNetworkProtocol::Operation operation() const;
|
||
|
TQNetworkProtocol::State state() const;
|
||
|
TQString arg(int) const;
|
||
|
TQByteArray rawArg(int) const;
|
||
|
TQString protocolDetail() const;
|
||
13 years ago
|
int errorCode() const;
|
||
|
|
||
|
void free();
|
||
|
|
||
|
private:
|
||
13 years ago
|
TQNetworkOperation(const TQNetworkOperation &);
|
||
13 years ago
|
};
|
||
|
|
||
|
%End
|