diff --git a/harbour/contrib/hbqt/qtnetwork/Makefile b/harbour/contrib/hbqt/qtnetwork/Makefile new file mode 100644 index 0000000000..3d78433c16 --- /dev/null +++ b/harbour/contrib/hbqt/qtnetwork/Makefile @@ -0,0 +1,64 @@ +# +# $Id$ +# + +ROOT := ../../../ + +include $(TOP)$(ROOT)config/global.mk + +LIBNAME := hbqtnetwork + +PRG_HEADERS := \ + ../hbqt.ch \ + +# force redetect. needed for _QT_DARWIN trick +HB_HAS_QT := + +_DET_DSP_NAME := qt +_DET_VAR_INC_ := HB_INC_QT +_DET_VAR_HAS_ := HB_HAS_QT +_DET_FLT_PLAT := !dos !os2 +_DET_FLT_COMP := !mingw64 !watcom !bcc !pocc !pocc64 !poccarm !msvcia64 +_DET_INC_DEFP := /usr/include/qt4 /usr/lib/qt4/include /usr/include /Developer/qt/include +_DET_INC_HEAD := /Qt/qglobal.h +include $(TOP)$(ROOT)config/detfun.mk + +_QT_DARWIN := +ifeq ($(HB_PLATFORM),darwin) + ifeq ($(HB_HAS_QT),) + _DET_DSP_NAME := qt + _DET_VAR_INC_ := HB_INC_QT + _DET_VAR_HAS_ := HB_HAS_QT + _DET_INC_DEFP := /Library/Frameworks/QtCore.framework/Versions/4/Headers + _DET_INC_HEAD := /QtCore + include $(TOP)$(ROOT)config/detfun.mk + _QT_DARWIN := yes + endif +endif + +ifneq ($(HB_HAS_QT),) + + ifeq ($(_QT_DARWIN),yes) + HB_CFLAGS += -I/Library/Frameworks/QtCore.framework/Headers + HB_CFLAGS += -I/Library/Frameworks/QtGui.framework/Headers + HB_CFLAGS += -I/Library/Frameworks/QtNetwork.framework/Headers + HB_CFLAGS += -I/Library/Frameworks/QtWebKit.framework/Headers + else + HB_CFLAGS += $(foreach d,$(HB_HAS_QT),-I$(d) -I$(d)/Qt -I$(d)/QtCore -I$(d)/QtGui -I$(d)/QtNetwork -I$(d)/QtWebKit) + endif + + include $(TOP)$(ROOT)contrib/hbqt/qtnetwork/filelist.mk + + include $(TOP)$(ROOT)config/header.mk + include $(TOP)$(ROOT)config/lib.mk + + ifneq ($(filter $(HB_PLATFORM),win wce),) + ifneq ($(HB_QT_STATIC),) + DIRS += hbqts + include $(TOP)$(ROOT)config/dir.mk + endif + endif +else + HB_SKIP_REASON := $(_DET_RES_TEXT) + include $(TOP)$(ROOT)config/none.mk +endif diff --git a/harbour/contrib/hbqt/qtnetwork/QFtp.cpp b/harbour/contrib/hbqt/qtnetwork/QFtp.cpp new file mode 100644 index 0000000000..c88437ca1f --- /dev/null +++ b/harbour/contrib/hbqt/qtnetwork/QFtp.cpp @@ -0,0 +1,348 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://www.harbour-project.org + * + * This program 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. + * + * This program 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + +#include "hbapi.h" +#include "../hbqt.h" + +/*----------------------------------------------------------------------*/ +#if QT_VERSION >= 0x040500 +/*----------------------------------------------------------------------*/ + +/* + * enum Command { None, SetTransferMode, SetProxy, ConnectToHost, ..., RawCommand } + * enum Error { NoError, HostNotFound, ConnectionRefused, NotConnected, UnknownError } + * enum State { Unconnected, HostLookup, Connecting, Connected, LoggedIn, Closing } + * enum TransferMode { Passive, Active } + * enum TransferType { Binary, Ascii } + */ + +#include + +#include + + +/* + * QFtp ( QObject * parent = 0 ) + * virtual ~QFtp () + */ + +/* + * qint64 read ( char * data, qint64 maxlen ) + */ +HB_FUNC( QT_QFTP_READ ) +{ + char * iData = ( char * ) hb_xgrab( hb_parnint( 3 ) + 1 ); + qint64 iRead; + + iRead = hbqt_par_QFtp( 1 )->read( iData, hb_parnint( 3 ) ); + + hb_retnint( iRead ); + if( ! hb_storclen_buffer( iData, iRead, 2 ) ) + hb_xfree( iData ); +} + +QT_G_FUNC( release_QFtp ) +{ +#if defined(__debug__) + hb_snprintf( str, sizeof(str), "release_QFtp" ); OutputDebugString( str ); +#endif + void * ph = ( void * ) Cargo; + if( ph ) + { + const QMetaObject * m = ( ( QObject * ) ph )->metaObject(); + if( ( QString ) m->className() != ( QString ) "QObject" ) + { + delete ( ( QFtp * ) ph ); + ph = NULL; + } + else + { +#if defined(__debug__) + hb_snprintf( str, sizeof(str), " Object Name Missing: QFtp" ); OutputDebugString( str ); +#endif + } + } +} + +HB_FUNC( QT_QFTP ) +{ + QGC_POINTER * p = ( QGC_POINTER * ) hb_gcAlloc( sizeof( QGC_POINTER ), Q_release ); + QPointer< QFtp > pObj = NULL; + + pObj = new QFtp( hbqt_par_QObject( 1 ) ) ; + + p->ph = pObj; + p->func = release_QFtp; + + hb_retptrGC( p ); +} +/* + * qint64 bytesAvailable () const + */ +HB_FUNC( QT_QFTP_BYTESAVAILABLE ) +{ + hb_retnint( hbqt_par_QFtp( 1 )->bytesAvailable() ); +} + +/* + * int cd ( const QString & dir ) + */ +HB_FUNC( QT_QFTP_CD ) +{ + hb_retni( hbqt_par_QFtp( 1 )->cd( hbqt_par_QString( 2 ) ) ); +} + +/* + * void clearPendingCommands () + */ +HB_FUNC( QT_QFTP_CLEARPENDINGCOMMANDS ) +{ + hbqt_par_QFtp( 1 )->clearPendingCommands(); +} + +/* + * int close () + */ +HB_FUNC( QT_QFTP_CLOSE ) +{ + hb_retni( hbqt_par_QFtp( 1 )->close() ); +} + +/* + * int connectToHost ( const QString & host, quint16 port = 21 ) + */ +HB_FUNC( QT_QFTP_CONNECTTOHOST ) +{ + hb_retni( hbqt_par_QFtp( 1 )->connectToHost( hbqt_par_QString( 2 ), ( HB_ISNUM( 3 ) ? hb_parni( 3 ) : 21 ) ) ); +} + +/* + * Command currentCommand () const + */ +HB_FUNC( QT_QFTP_CURRENTCOMMAND ) +{ + hb_retni( ( QFtp::Command ) hbqt_par_QFtp( 1 )->currentCommand() ); +} + +/* + * QIODevice * currentDevice () const + */ +HB_FUNC( QT_QFTP_CURRENTDEVICE ) +{ + hb_retptr( ( QIODevice* ) hbqt_par_QFtp( 1 )->currentDevice() ); +} + +/* + * int currentId () const + */ +HB_FUNC( QT_QFTP_CURRENTID ) +{ + hb_retni( hbqt_par_QFtp( 1 )->currentId() ); +} + +/* + * Error error () const + */ +HB_FUNC( QT_QFTP_ERROR ) +{ + hb_retni( ( QFtp::Error ) hbqt_par_QFtp( 1 )->error() ); +} + +/* + * QString errorString () const + */ +HB_FUNC( QT_QFTP_ERRORSTRING ) +{ + hb_retc( hbqt_par_QFtp( 1 )->errorString().toAscii().data() ); +} + +/* + * int get ( const QString & file, QIODevice * dev = 0, TransferType type = Binary ) + */ +HB_FUNC( QT_QFTP_GET ) +{ + hb_retni( hbqt_par_QFtp( 1 )->get( hbqt_par_QString( 2 ), hbqt_par_QIODevice( 3 ), ( HB_ISNUM( 4 ) ? ( QFtp::TransferType ) hb_parni( 4 ) : ( QFtp::TransferType ) QFtp::Binary ) ) ); +} + +/* + * bool hasPendingCommands () const + */ +HB_FUNC( QT_QFTP_HASPENDINGCOMMANDS ) +{ + hb_retl( hbqt_par_QFtp( 1 )->hasPendingCommands() ); +} + +/* + * int list ( const QString & dir = QString() ) + */ +HB_FUNC( QT_QFTP_LIST ) +{ + hb_retni( hbqt_par_QFtp( 1 )->list( hbqt_par_QString( 2 ) ) ); +} + +/* + * int login ( const QString & user = QString(), const QString & password = QString() ) + */ +HB_FUNC( QT_QFTP_LOGIN ) +{ + hb_retni( hbqt_par_QFtp( 1 )->login( hbqt_par_QString( 2 ), hbqt_par_QString( 3 ) ) ); +} + +/* + * int mkdir ( const QString & dir ) + */ +HB_FUNC( QT_QFTP_MKDIR ) +{ + hb_retni( hbqt_par_QFtp( 1 )->mkdir( hbqt_par_QString( 2 ) ) ); +} + +/* + * int put ( QIODevice * dev, const QString & file, TransferType type = Binary ) + */ +HB_FUNC( QT_QFTP_PUT ) +{ + hb_retni( hbqt_par_QFtp( 1 )->put( hbqt_par_QIODevice( 2 ), hbqt_par_QString( 3 ), ( HB_ISNUM( 4 ) ? ( QFtp::TransferType ) hb_parni( 4 ) : ( QFtp::TransferType ) QFtp::Binary ) ) ); +} + +/* + * int put ( const QByteArray & data, const QString & file, TransferType type = Binary ) + */ +HB_FUNC( QT_QFTP_PUT_1 ) +{ + hb_retni( hbqt_par_QFtp( 1 )->put( *hbqt_par_QByteArray( 2 ), hbqt_par_QString( 3 ), ( HB_ISNUM( 4 ) ? ( QFtp::TransferType ) hb_parni( 4 ) : ( QFtp::TransferType ) QFtp::Binary ) ) ); +} + +/* + * int rawCommand ( const QString & command ) + */ +HB_FUNC( QT_QFTP_RAWCOMMAND ) +{ + hb_retni( hbqt_par_QFtp( 1 )->rawCommand( hbqt_par_QString( 2 ) ) ); +} + +/* + * QByteArray readAll () + */ +HB_FUNC( QT_QFTP_READALL ) +{ + hb_retptrGC( hbqt_ptrTOgcpointer( new QByteArray( hbqt_par_QFtp( 1 )->readAll() ), release_QByteArray ) ); +} + +/* + * int remove ( const QString & file ) + */ +HB_FUNC( QT_QFTP_REMOVE ) +{ + hb_retni( hbqt_par_QFtp( 1 )->remove( hbqt_par_QString( 2 ) ) ); +} + +/* + * int rename ( const QString & oldname, const QString & newname ) + */ +HB_FUNC( QT_QFTP_RENAME ) +{ + hb_retni( hbqt_par_QFtp( 1 )->rename( hbqt_par_QString( 2 ), hbqt_par_QString( 3 ) ) ); +} + +/* + * int rmdir ( const QString & dir ) + */ +HB_FUNC( QT_QFTP_RMDIR ) +{ + hb_retni( hbqt_par_QFtp( 1 )->rmdir( hbqt_par_QString( 2 ) ) ); +} + +/* + * int setProxy ( const QString & host, quint16 port ) + */ +HB_FUNC( QT_QFTP_SETPROXY ) +{ + hb_retni( hbqt_par_QFtp( 1 )->setProxy( hbqt_par_QString( 2 ), hb_parni( 3 ) ) ); +} + +/* + * int setTransferMode ( TransferMode mode ) + */ +HB_FUNC( QT_QFTP_SETTRANSFERMODE ) +{ + hb_retni( hbqt_par_QFtp( 1 )->setTransferMode( ( QFtp::TransferMode ) hb_parni( 2 ) ) ); +} + +/* + * State state () const + */ +HB_FUNC( QT_QFTP_STATE ) +{ + hb_retni( ( QFtp::State ) hbqt_par_QFtp( 1 )->state() ); +} + +/* + * void abort () + */ +HB_FUNC( QT_QFTP_ABORT ) +{ + hbqt_par_QFtp( 1 )->abort(); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/qtnetwork/QHttp.cpp b/harbour/contrib/hbqt/qtnetwork/QHttp.cpp new file mode 100644 index 0000000000..9fbc4ebaf3 --- /dev/null +++ b/harbour/contrib/hbqt/qtnetwork/QHttp.cpp @@ -0,0 +1,332 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://www.harbour-project.org + * + * This program 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. + * + * This program 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + +#include "hbapi.h" +#include "../hbqt.h" + +/*----------------------------------------------------------------------*/ +#if QT_VERSION >= 0x040500 +/*----------------------------------------------------------------------*/ + +/* + * enum ConnectionMode { ConnectionModeHttp, ConnectionModeHttps } + * enum Error { NoError, HostNotFound, ConnectionRefused, UnexpectedClose, ..., UnknownError } + * enum State { Unconnected, HostLookup, Connecting, Sending, ..., Closing } + */ + +#include + +#include + + +/* + * QHttp ( QObject * parent = 0 ) + * QHttp ( const QString & hostName, quint16 port = 80, QObject * parent = 0 ) + * QHttp ( const QString & hostName, ConnectionMode mode, quint16 port = 0, QObject * parent = 0 ) + * virtual ~QHttp () + */ + +/* + * qint64 read ( char * data, qint64 maxlen ) + */ +HB_FUNC( QT_QHTTP_READ ) +{ + char * iData = ( char * ) hb_xgrab( hb_parnint( 3 ) + 1 ); + qint64 iRead; + + iRead = hbqt_par_QHttp( 1 )->read( iData, hb_parnint( 3 ) ); + + hb_retnint( iRead ); + if( ! hb_storclen_buffer( iData, iRead, 2 ) ) + hb_xfree( iData ); +} + +QT_G_FUNC( release_QHttp ) +{ +#if defined(__debug__) + hb_snprintf( str, sizeof(str), "release_QHttp" ); OutputDebugString( str ); +#endif + void * ph = ( void * ) Cargo; + if( ph ) + { + const QMetaObject * m = ( ( QObject * ) ph )->metaObject(); + if( ( QString ) m->className() != ( QString ) "QObject" ) + { + delete ( ( QHttp * ) ph ); + ph = NULL; + } + else + { +#if defined(__debug__) + hb_snprintf( str, sizeof(str), " Object Name Missing: QHttp" ); OutputDebugString( str ); +#endif + } + } +} + +HB_FUNC( QT_QHTTP ) +{ + QGC_POINTER * p = ( QGC_POINTER * ) hb_gcAlloc( sizeof( QGC_POINTER ), Q_release ); + QPointer< QHttp > pObj = NULL; + + pObj = new QHttp( hbqt_par_QObject( 1 ) ) ; + + p->ph = pObj; + p->func = release_QHttp; + + hb_retptrGC( p ); +} +/* + * qint64 bytesAvailable () const + */ +HB_FUNC( QT_QHTTP_BYTESAVAILABLE ) +{ + hb_retnint( hbqt_par_QHttp( 1 )->bytesAvailable() ); +} + +/* + * void clearPendingRequests () + */ +HB_FUNC( QT_QHTTP_CLEARPENDINGREQUESTS ) +{ + hbqt_par_QHttp( 1 )->clearPendingRequests(); +} + +/* + * int close () + */ +HB_FUNC( QT_QHTTP_CLOSE ) +{ + hb_retni( hbqt_par_QHttp( 1 )->close() ); +} + +/* + * QIODevice * currentDestinationDevice () const + */ +HB_FUNC( QT_QHTTP_CURRENTDESTINATIONDEVICE ) +{ + hb_retptr( ( QIODevice* ) hbqt_par_QHttp( 1 )->currentDestinationDevice() ); +} + +/* + * int currentId () const + */ +HB_FUNC( QT_QHTTP_CURRENTID ) +{ + hb_retni( hbqt_par_QHttp( 1 )->currentId() ); +} + +/* + * QHttpRequestHeader currentRequest () const + */ +HB_FUNC( QT_QHTTP_CURRENTREQUEST ) +{ + hb_retptrGC( hbqt_ptrTOgcpointer( new QHttpRequestHeader( hbqt_par_QHttp( 1 )->currentRequest() ), release_QHttpRequestHeader ) ); +} + +/* + * QIODevice * currentSourceDevice () const + */ +HB_FUNC( QT_QHTTP_CURRENTSOURCEDEVICE ) +{ + hb_retptr( ( QIODevice* ) hbqt_par_QHttp( 1 )->currentSourceDevice() ); +} + +/* + * Error error () const + */ +HB_FUNC( QT_QHTTP_ERROR ) +{ + hb_retni( ( QHttp::Error ) hbqt_par_QHttp( 1 )->error() ); +} + +/* + * QString errorString () const + */ +HB_FUNC( QT_QHTTP_ERRORSTRING ) +{ + hb_retc( hbqt_par_QHttp( 1 )->errorString().toAscii().data() ); +} + +/* + * int get ( const QString & path, QIODevice * to = 0 ) + */ +HB_FUNC( QT_QHTTP_GET ) +{ + hb_retni( hbqt_par_QHttp( 1 )->get( hbqt_par_QString( 2 ), hbqt_par_QIODevice( 3 ) ) ); +} + +/* + * bool hasPendingRequests () const + */ +HB_FUNC( QT_QHTTP_HASPENDINGREQUESTS ) +{ + hb_retl( hbqt_par_QHttp( 1 )->hasPendingRequests() ); +} + +/* + * int head ( const QString & path ) + */ +HB_FUNC( QT_QHTTP_HEAD ) +{ + hb_retni( hbqt_par_QHttp( 1 )->head( hbqt_par_QString( 2 ) ) ); +} + +/* + * QHttpResponseHeader lastResponse () const + */ +HB_FUNC( QT_QHTTP_LASTRESPONSE ) +{ + hb_retptrGC( hbqt_ptrTOgcpointer( new QHttpResponseHeader( hbqt_par_QHttp( 1 )->lastResponse() ), release_QHttpResponseHeader ) ); +} + +/* + * int post ( const QString & path, QIODevice * data, QIODevice * to = 0 ) + */ +HB_FUNC( QT_QHTTP_POST ) +{ + hb_retni( hbqt_par_QHttp( 1 )->post( hbqt_par_QString( 2 ), hbqt_par_QIODevice( 3 ), hbqt_par_QIODevice( 4 ) ) ); +} + +/* + * int post ( const QString & path, const QByteArray & data, QIODevice * to = 0 ) + */ +HB_FUNC( QT_QHTTP_POST_1 ) +{ + hb_retni( hbqt_par_QHttp( 1 )->post( hbqt_par_QString( 2 ), *hbqt_par_QByteArray( 3 ), hbqt_par_QIODevice( 4 ) ) ); +} + +/* + * QByteArray readAll () + */ +HB_FUNC( QT_QHTTP_READALL ) +{ + hb_retptrGC( hbqt_ptrTOgcpointer( new QByteArray( hbqt_par_QHttp( 1 )->readAll() ), release_QByteArray ) ); +} + +/* + * int request ( const QHttpRequestHeader & header, QIODevice * data = 0, QIODevice * to = 0 ) + */ +HB_FUNC( QT_QHTTP_REQUEST ) +{ + hb_retni( hbqt_par_QHttp( 1 )->request( *hbqt_par_QHttpRequestHeader( 2 ), hbqt_par_QIODevice( 3 ), hbqt_par_QIODevice( 4 ) ) ); +} + +/* + * int request ( const QHttpRequestHeader & header, const QByteArray & data, QIODevice * to = 0 ) + */ +HB_FUNC( QT_QHTTP_REQUEST_1 ) +{ + hb_retni( hbqt_par_QHttp( 1 )->request( *hbqt_par_QHttpRequestHeader( 2 ), *hbqt_par_QByteArray( 3 ), hbqt_par_QIODevice( 4 ) ) ); +} + +/* + * int setHost ( const QString & hostName, quint16 port = 80 ) + */ +HB_FUNC( QT_QHTTP_SETHOST ) +{ + hb_retni( hbqt_par_QHttp( 1 )->setHost( hbqt_par_QString( 2 ), ( HB_ISNUM( 3 ) ? hb_parni( 3 ) : 80 ) ) ); +} + +/* + * int setHost ( const QString & hostName, ConnectionMode mode, quint16 port = 0 ) + */ +HB_FUNC( QT_QHTTP_SETHOST_1 ) +{ + hb_retni( hbqt_par_QHttp( 1 )->setHost( hbqt_par_QString( 2 ), ( QHttp::ConnectionMode ) hb_parni( 3 ), hb_parni( 4 ) ) ); +} + +/* + * int setProxy ( const QString & host, int port, const QString & username = QString(), const QString & password = QString() ) + */ +HB_FUNC( QT_QHTTP_SETPROXY ) +{ + hb_retni( hbqt_par_QHttp( 1 )->setProxy( hbqt_par_QString( 2 ), hb_parni( 3 ), hbqt_par_QString( 4 ), hbqt_par_QString( 5 ) ) ); +} + +/* + * int setUser ( const QString & userName, const QString & password = QString() ) + */ +HB_FUNC( QT_QHTTP_SETUSER ) +{ + hb_retni( hbqt_par_QHttp( 1 )->setUser( hbqt_par_QString( 2 ), hbqt_par_QString( 3 ) ) ); +} + +/* + * State state () const + */ +HB_FUNC( QT_QHTTP_STATE ) +{ + hb_retni( ( QHttp::State ) hbqt_par_QHttp( 1 )->state() ); +} + +/* + * void abort () + */ +HB_FUNC( QT_QHTTP_ABORT ) +{ + hbqt_par_QHttp( 1 )->abort(); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/qtnetwork/QHttpRequestHeader.cpp b/harbour/contrib/hbqt/qtnetwork/QHttpRequestHeader.cpp new file mode 100644 index 0000000000..41690e5b31 --- /dev/null +++ b/harbour/contrib/hbqt/qtnetwork/QHttpRequestHeader.cpp @@ -0,0 +1,148 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://www.harbour-project.org + * + * This program 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. + * + * This program 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + +#include "hbapi.h" +#include "../hbqt.h" + +/*----------------------------------------------------------------------*/ +#if QT_VERSION >= 0x040500 +/*----------------------------------------------------------------------*/ + +#include + +#include + + +/* QHttpRequestHeader () + * QHttpRequestHeader ( const QString & method, const QString & path, int majorVer = 1, int minorVer = 1 ) + * QHttpRequestHeader ( const QHttpRequestHeader & header ) + * QHttpRequestHeader ( const QString & str ) + */ + +QT_G_FUNC( release_QHttpRequestHeader ) +{ +#if defined(__debug__) + hb_snprintf( str, sizeof(str), "release_QHttpRequestHeader" ); OutputDebugString( str ); +#endif + void * ph = ( void * ) Cargo; + if( ph ) + { + delete ( ( QHttpRequestHeader * ) ph ); + ph = NULL; + } +} + +HB_FUNC( QT_QHTTPREQUESTHEADER ) +{ + QGC_POINTER * p = ( QGC_POINTER * ) hb_gcAlloc( sizeof( QGC_POINTER ), Q_release ); + void * pObj = NULL; + + pObj = new QHttpRequestHeader() ; + + p->ph = pObj; + p->func = release_QHttpRequestHeader; + + hb_retptrGC( p ); +} +/* + * virtual int majorVersion () const + */ +HB_FUNC( QT_QHTTPREQUESTHEADER_MAJORVERSION ) +{ + hb_retni( hbqt_par_QHttpRequestHeader( 1 )->majorVersion() ); +} + +/* + * QString method () const + */ +HB_FUNC( QT_QHTTPREQUESTHEADER_METHOD ) +{ + hb_retc( hbqt_par_QHttpRequestHeader( 1 )->method().toAscii().data() ); +} + +/* + * virtual int minorVersion () const + */ +HB_FUNC( QT_QHTTPREQUESTHEADER_MINORVERSION ) +{ + hb_retni( hbqt_par_QHttpRequestHeader( 1 )->minorVersion() ); +} + +/* + * QString path () const + */ +HB_FUNC( QT_QHTTPREQUESTHEADER_PATH ) +{ + hb_retc( hbqt_par_QHttpRequestHeader( 1 )->path().toAscii().data() ); +} + +/* + * void setRequest ( const QString & method, const QString & path, int majorVer = 1, int minorVer = 1 ) + */ +HB_FUNC( QT_QHTTPREQUESTHEADER_SETREQUEST ) +{ + hbqt_par_QHttpRequestHeader( 1 )->setRequest( hbqt_par_QString( 2 ), hbqt_par_QString( 3 ), ( HB_ISNUM( 4 ) ? hb_parni( 4 ) : 1 ), ( HB_ISNUM( 5 ) ? hb_parni( 5 ) : 1 ) ); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/qtnetwork/QHttpResponseHeader.cpp b/harbour/contrib/hbqt/qtnetwork/QHttpResponseHeader.cpp new file mode 100644 index 0000000000..5eaa14442c --- /dev/null +++ b/harbour/contrib/hbqt/qtnetwork/QHttpResponseHeader.cpp @@ -0,0 +1,148 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://www.harbour-project.org + * + * This program 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. + * + * This program 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + +#include "hbapi.h" +#include "../hbqt.h" + +/*----------------------------------------------------------------------*/ +#if QT_VERSION >= 0x040500 +/*----------------------------------------------------------------------*/ + +#include + +#include + + +/* QHttpResponseHeader () + * QHttpResponseHeader ( const QHttpResponseHeader & header ) + * QHttpResponseHeader ( const QString & str ) + * QHttpResponseHeader ( int code, const QString & text = QString(), int majorVer = 1, int minorVer = 1 ) + */ + +QT_G_FUNC( release_QHttpResponseHeader ) +{ +#if defined(__debug__) + hb_snprintf( str, sizeof(str), "release_QHttpResponseHeader" ); OutputDebugString( str ); +#endif + void * ph = ( void * ) Cargo; + if( ph ) + { + delete ( ( QHttpResponseHeader * ) ph ); + ph = NULL; + } +} + +HB_FUNC( QT_QHTTPRESPONSEHEADER ) +{ + QGC_POINTER * p = ( QGC_POINTER * ) hb_gcAlloc( sizeof( QGC_POINTER ), Q_release ); + void * pObj = NULL; + + pObj = new QHttpResponseHeader() ; + + p->ph = pObj; + p->func = release_QHttpResponseHeader; + + hb_retptrGC( p ); +} +/* + * virtual int majorVersion () const + */ +HB_FUNC( QT_QHTTPRESPONSEHEADER_MAJORVERSION ) +{ + hb_retni( hbqt_par_QHttpResponseHeader( 1 )->majorVersion() ); +} + +/* + * virtual int minorVersion () const + */ +HB_FUNC( QT_QHTTPRESPONSEHEADER_MINORVERSION ) +{ + hb_retni( hbqt_par_QHttpResponseHeader( 1 )->minorVersion() ); +} + +/* + * QString reasonPhrase () const + */ +HB_FUNC( QT_QHTTPRESPONSEHEADER_REASONPHRASE ) +{ + hb_retc( hbqt_par_QHttpResponseHeader( 1 )->reasonPhrase().toAscii().data() ); +} + +/* + * void setStatusLine ( int code, const QString & text = QString(), int majorVer = 1, int minorVer = 1 ) + */ +HB_FUNC( QT_QHTTPRESPONSEHEADER_SETSTATUSLINE ) +{ + hbqt_par_QHttpResponseHeader( 1 )->setStatusLine( hb_parni( 2 ), hbqt_par_QString( 3 ), ( HB_ISNUM( 4 ) ? hb_parni( 4 ) : 1 ), ( HB_ISNUM( 5 ) ? hb_parni( 5 ) : 1 ) ); +} + +/* + * int statusCode () const + */ +HB_FUNC( QT_QHTTPRESPONSEHEADER_STATUSCODE ) +{ + hb_retni( hbqt_par_QHttpResponseHeader( 1 )->statusCode() ); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/qtnetwork/QNetworkRequest.cpp b/harbour/contrib/hbqt/qtnetwork/QNetworkRequest.cpp new file mode 100644 index 0000000000..adf4e2c822 --- /dev/null +++ b/harbour/contrib/hbqt/qtnetwork/QNetworkRequest.cpp @@ -0,0 +1,195 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://www.harbour-project.org + * + * This program 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. + * + * This program 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + +#include "hbapi.h" +#include "../hbqt.h" + +/*----------------------------------------------------------------------*/ +#if QT_VERSION >= 0x040500 +/*----------------------------------------------------------------------*/ + +/* + * enum Attribute { HttpStatusCodeAttribute, HttpReasonPhraseAttribute, RedirectionTargetAttribute, ConnectionEncryptedAttribute, ..., UserMax } + * enum CacheLoadControl { AlwaysNetwork, PreferNetwork, PreferCache, AlwaysCache } + * enum KnownHeaders { ContentTypeHeader, ContentLengthHeader, LocationHeader, LastModifiedHeader, CookieHeader, SetCookieHeader } + */ + +/* + * Constructed[ 9/12 [ 75.00% ] ] + * + * *** Unconvered Prototypes *** + * ----------------------------- + * + * QList rawHeaderList () const + * + * *** Commented out protos which construct fine but do not compile *** + * + * // void setSslConfiguration ( const QSslConfiguration & config ) + * // QSslConfiguration sslConfiguration () const + */ + +#include + +#include + + +/* QNetworkRequest ( const QUrl & url = QUrl() ) + * QNetworkRequest ( const QNetworkRequest & other ) + * ~QNetworkRequest () + */ + +QT_G_FUNC( release_QNetworkRequest ) +{ +#if defined(__debug__) + hb_snprintf( str, sizeof(str), "release_QNetworkRequest" ); OutputDebugString( str ); +#endif + void * ph = ( void * ) Cargo; + if( ph ) + { + delete ( ( QNetworkRequest * ) ph ); + ph = NULL; + } +} + +HB_FUNC( QT_QNETWORKREQUEST ) +{ + void * pObj = NULL; + + pObj = new QNetworkRequest() ; + + hb_retptr( pObj ); +} +/* + * QVariant attribute ( Attribute code, const QVariant & defaultValue = QVariant() ) const + */ +HB_FUNC( QT_QNETWORKREQUEST_ATTRIBUTE ) +{ + hb_retptrGC( hbqt_ptrTOgcpointer( new QVariant( hbqt_par_QNetworkRequest( 1 )->attribute( ( QNetworkRequest::Attribute ) hb_parni( 2 ), ( HB_ISPOINTER( 3 ) ? *hbqt_par_QVariant( 3 ) : QVariant() ) ) ), release_QVariant ) ); +} + +/* + * bool hasRawHeader ( const QByteArray & headerName ) const + */ +HB_FUNC( QT_QNETWORKREQUEST_HASRAWHEADER ) +{ + hb_retl( hbqt_par_QNetworkRequest( 1 )->hasRawHeader( *hbqt_par_QByteArray( 2 ) ) ); +} + +/* + * QVariant header ( KnownHeaders header ) const + */ +HB_FUNC( QT_QNETWORKREQUEST_HEADER ) +{ + hb_retptrGC( hbqt_ptrTOgcpointer( new QVariant( hbqt_par_QNetworkRequest( 1 )->header( ( QNetworkRequest::KnownHeaders ) hb_parni( 2 ) ) ), release_QVariant ) ); +} + +/* + * QByteArray rawHeader ( const QByteArray & headerName ) const + */ +HB_FUNC( QT_QNETWORKREQUEST_RAWHEADER ) +{ + hb_retptrGC( hbqt_ptrTOgcpointer( new QByteArray( hbqt_par_QNetworkRequest( 1 )->rawHeader( *hbqt_par_QByteArray( 2 ) ) ), release_QByteArray ) ); +} + +/* + * void setAttribute ( Attribute code, const QVariant & value ) + */ +HB_FUNC( QT_QNETWORKREQUEST_SETATTRIBUTE ) +{ + hbqt_par_QNetworkRequest( 1 )->setAttribute( ( QNetworkRequest::Attribute ) hb_parni( 2 ), *hbqt_par_QVariant( 3 ) ); +} + +/* + * void setHeader ( KnownHeaders header, const QVariant & value ) + */ +HB_FUNC( QT_QNETWORKREQUEST_SETHEADER ) +{ + hbqt_par_QNetworkRequest( 1 )->setHeader( ( QNetworkRequest::KnownHeaders ) hb_parni( 2 ), *hbqt_par_QVariant( 3 ) ); +} + +/* + * void setRawHeader ( const QByteArray & headerName, const QByteArray & headerValue ) + */ +HB_FUNC( QT_QNETWORKREQUEST_SETRAWHEADER ) +{ + hbqt_par_QNetworkRequest( 1 )->setRawHeader( *hbqt_par_QByteArray( 2 ), *hbqt_par_QByteArray( 3 ) ); +} + +/* + * void setUrl ( const QUrl & url ) + */ +HB_FUNC( QT_QNETWORKREQUEST_SETURL ) +{ + hbqt_par_QNetworkRequest( 1 )->setUrl( *hbqt_par_QUrl( 2 ) ); +} + +/* + * QUrl url () const + */ +HB_FUNC( QT_QNETWORKREQUEST_URL ) +{ + hb_retptrGC( hbqt_ptrTOgcpointer( new QUrl( hbqt_par_QNetworkRequest( 1 )->url() ), release_QUrl ) ); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/qtnetwork/TQFtp.prg b/harbour/contrib/hbqt/qtnetwork/TQFtp.prg new file mode 100644 index 0000000000..cd4a2f5bdb --- /dev/null +++ b/harbour/contrib/hbqt/qtnetwork/TQFtp.prg @@ -0,0 +1,125 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://www.harbour-project.org + * + * This program 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. + * + * This program 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + + +#include "hbclass.ch" + + +CREATE CLASS QFtp INHERIT QObject + + VAR pParent + VAR pPtr + + METHOD New() + METHOD Configure( xObject ) + + METHOD bytesAvailable() INLINE Qt_QFtp_bytesAvailable( ::pPtr ) + METHOD cd( cDir ) INLINE Qt_QFtp_cd( ::pPtr, cDir ) + METHOD clearPendingCommands() INLINE Qt_QFtp_clearPendingCommands( ::pPtr ) + METHOD close() INLINE Qt_QFtp_close( ::pPtr ) + METHOD connectToHost( cHost, nPort ) INLINE Qt_QFtp_connectToHost( ::pPtr, cHost, nPort ) + METHOD currentCommand() INLINE Qt_QFtp_currentCommand( ::pPtr ) + METHOD currentDevice() INLINE Qt_QFtp_currentDevice( ::pPtr ) + METHOD currentId() INLINE Qt_QFtp_currentId( ::pPtr ) + METHOD error() INLINE Qt_QFtp_error( ::pPtr ) + METHOD errorString() INLINE Qt_QFtp_errorString( ::pPtr ) + METHOD get( cFile, pDev, nType ) INLINE Qt_QFtp_get( ::pPtr, cFile, pDev, nType ) + METHOD hasPendingCommands() INLINE Qt_QFtp_hasPendingCommands( ::pPtr ) + METHOD list( cDir ) INLINE Qt_QFtp_list( ::pPtr, cDir ) + METHOD login( cUser, cPassword ) INLINE Qt_QFtp_login( ::pPtr, cUser, cPassword ) + METHOD mkdir( cDir ) INLINE Qt_QFtp_mkdir( ::pPtr, cDir ) + METHOD put( pDev, cFile, nType ) INLINE Qt_QFtp_put( ::pPtr, pDev, cFile, nType ) + METHOD put_1( pData, cFile, nType ) INLINE Qt_QFtp_put_1( ::pPtr, pData, cFile, nType ) + METHOD rawCommand( cCommand ) INLINE Qt_QFtp_rawCommand( ::pPtr, cCommand ) + METHOD readAll() INLINE Qt_QFtp_readAll( ::pPtr ) + METHOD remove( cFile ) INLINE Qt_QFtp_remove( ::pPtr, cFile ) + METHOD rename( cOldname, cNewname ) INLINE Qt_QFtp_rename( ::pPtr, cOldname, cNewname ) + METHOD rmdir( cDir ) INLINE Qt_QFtp_rmdir( ::pPtr, cDir ) + METHOD setProxy( cHost, nPort ) INLINE Qt_QFtp_setProxy( ::pPtr, cHost, nPort ) + METHOD setTransferMode( nMode ) INLINE Qt_QFtp_setTransferMode( ::pPtr, nMode ) + METHOD state() INLINE Qt_QFtp_state( ::pPtr ) + METHOD abort() INLINE Qt_QFtp_abort( ::pPtr ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD New( pParent ) CLASS QFtp + + ::pParent := pParent + + ::pPtr := Qt_QFtp( pParent ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD Configure( xObject ) CLASS QFtp + + IF hb_isObject( xObject ) + ::pPtr := xObject:pPtr + ELSEIF hb_isPointer( xObject ) + ::pPtr := xObject + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/qtnetwork/TQHttp.prg b/harbour/contrib/hbqt/qtnetwork/TQHttp.prg new file mode 100644 index 0000000000..5a98d1347f --- /dev/null +++ b/harbour/contrib/hbqt/qtnetwork/TQHttp.prg @@ -0,0 +1,123 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://www.harbour-project.org + * + * This program 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. + * + * This program 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + + +#include "hbclass.ch" + + +CREATE CLASS QHttp INHERIT QObject + + VAR pParent + VAR pPtr + + METHOD New() + METHOD Configure( xObject ) + + METHOD bytesAvailable() INLINE Qt_QHttp_bytesAvailable( ::pPtr ) + METHOD clearPendingRequests() INLINE Qt_QHttp_clearPendingRequests( ::pPtr ) + METHOD close() INLINE Qt_QHttp_close( ::pPtr ) + METHOD currentDestinationDevice() INLINE Qt_QHttp_currentDestinationDevice( ::pPtr ) + METHOD currentId() INLINE Qt_QHttp_currentId( ::pPtr ) + METHOD currentRequest() INLINE Qt_QHttp_currentRequest( ::pPtr ) + METHOD currentSourceDevice() INLINE Qt_QHttp_currentSourceDevice( ::pPtr ) + METHOD error() INLINE Qt_QHttp_error( ::pPtr ) + METHOD errorString() INLINE Qt_QHttp_errorString( ::pPtr ) + METHOD get( cPath, pTo ) INLINE Qt_QHttp_get( ::pPtr, cPath, pTo ) + METHOD hasPendingRequests() INLINE Qt_QHttp_hasPendingRequests( ::pPtr ) + METHOD head( cPath ) INLINE Qt_QHttp_head( ::pPtr, cPath ) + METHOD lastResponse() INLINE Qt_QHttp_lastResponse( ::pPtr ) + METHOD post( cPath, pData, pTo ) INLINE Qt_QHttp_post( ::pPtr, cPath, pData, pTo ) + METHOD post_1( cPath, pData, pTo ) INLINE Qt_QHttp_post_1( ::pPtr, cPath, pData, pTo ) + METHOD readAll() INLINE Qt_QHttp_readAll( ::pPtr ) + METHOD request( pHeader, pData, pTo ) INLINE Qt_QHttp_request( ::pPtr, pHeader, pData, pTo ) + METHOD request_1( pHeader, pData, pTo ) INLINE Qt_QHttp_request_1( ::pPtr, pHeader, pData, pTo ) + METHOD setHost( cHostName, nPort ) INLINE Qt_QHttp_setHost( ::pPtr, cHostName, nPort ) + METHOD setHost_1( cHostName, nMode, nPort ) INLINE Qt_QHttp_setHost_1( ::pPtr, cHostName, nMode, nPort ) + METHOD setProxy( cHost, nPort, cUsername, cPassword ) INLINE Qt_QHttp_setProxy( ::pPtr, cHost, nPort, cUsername, cPassword ) + METHOD setUser( cUserName, cPassword ) INLINE Qt_QHttp_setUser( ::pPtr, cUserName, cPassword ) + METHOD state() INLINE Qt_QHttp_state( ::pPtr ) + METHOD abort() INLINE Qt_QHttp_abort( ::pPtr ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD New( pParent ) CLASS QHttp + + ::pParent := pParent + + ::pPtr := Qt_QHttp( pParent ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD Configure( xObject ) CLASS QHttp + + IF hb_isObject( xObject ) + ::pPtr := xObject:pPtr + ELSEIF hb_isPointer( xObject ) + ::pPtr := xObject + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/qtnetwork/TQHttpRequestHeader.prg b/harbour/contrib/hbqt/qtnetwork/TQHttpRequestHeader.prg new file mode 100644 index 0000000000..f8c6cc7921 --- /dev/null +++ b/harbour/contrib/hbqt/qtnetwork/TQHttpRequestHeader.prg @@ -0,0 +1,104 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://www.harbour-project.org + * + * This program 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. + * + * This program 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + + +#include "hbclass.ch" + + +CREATE CLASS QHttpRequestHeader INHERIT QHttpHeader + + VAR pParent + VAR pPtr + + METHOD New() + METHOD Configure( xObject ) + + METHOD majorVersion() INLINE Qt_QHttpRequestHeader_majorVersion( ::pPtr ) + METHOD method() INLINE Qt_QHttpRequestHeader_method( ::pPtr ) + METHOD minorVersion() INLINE Qt_QHttpRequestHeader_minorVersion( ::pPtr ) + METHOD path() INLINE Qt_QHttpRequestHeader_path( ::pPtr ) + METHOD setRequest( cMethod, cPath, nMajorVer, nMinorVer ) INLINE Qt_QHttpRequestHeader_setRequest( ::pPtr, cMethod, cPath, nMajorVer, nMinorVer ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD New( pParent ) CLASS QHttpRequestHeader + + ::pParent := pParent + + ::pPtr := Qt_QHttpRequestHeader( pParent ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD Configure( xObject ) CLASS QHttpRequestHeader + + IF hb_isObject( xObject ) + ::pPtr := xObject:pPtr + ELSEIF hb_isPointer( xObject ) + ::pPtr := xObject + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/qtnetwork/TQHttpResponseHeader.prg b/harbour/contrib/hbqt/qtnetwork/TQHttpResponseHeader.prg new file mode 100644 index 0000000000..92170d3fa3 --- /dev/null +++ b/harbour/contrib/hbqt/qtnetwork/TQHttpResponseHeader.prg @@ -0,0 +1,104 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://www.harbour-project.org + * + * This program 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. + * + * This program 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + + +#include "hbclass.ch" + + +CREATE CLASS QHttpResponseHeader INHERIT QHttpHeader + + VAR pParent + VAR pPtr + + METHOD New() + METHOD Configure( xObject ) + + METHOD majorVersion() INLINE Qt_QHttpResponseHeader_majorVersion( ::pPtr ) + METHOD minorVersion() INLINE Qt_QHttpResponseHeader_minorVersion( ::pPtr ) + METHOD reasonPhrase() INLINE Qt_QHttpResponseHeader_reasonPhrase( ::pPtr ) + METHOD setStatusLine( nCode, cText, nMajorVer, nMinorVer ) INLINE Qt_QHttpResponseHeader_setStatusLine( ::pPtr, nCode, cText, nMajorVer, nMinorVer ) + METHOD statusCode() INLINE Qt_QHttpResponseHeader_statusCode( ::pPtr ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD New( pParent ) CLASS QHttpResponseHeader + + ::pParent := pParent + + ::pPtr := Qt_QHttpResponseHeader( pParent ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD Configure( xObject ) CLASS QHttpResponseHeader + + IF hb_isObject( xObject ) + ::pPtr := xObject:pPtr + ELSEIF hb_isPointer( xObject ) + ::pPtr := xObject + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/qtnetwork/TQNetworkRequest.prg b/harbour/contrib/hbqt/qtnetwork/TQNetworkRequest.prg new file mode 100644 index 0000000000..8d6c0eedaa --- /dev/null +++ b/harbour/contrib/hbqt/qtnetwork/TQNetworkRequest.prg @@ -0,0 +1,108 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://www.harbour-project.org + * + * This program 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. + * + * This program 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ + + +#include "hbclass.ch" + + +CREATE CLASS QNetworkRequest + + VAR pParent + VAR pPtr + + METHOD New() + METHOD Configure( xObject ) + + METHOD attribute( nCode, pDefaultValue ) INLINE Qt_QNetworkRequest_attribute( ::pPtr, nCode, pDefaultValue ) + METHOD hasRawHeader( pHeaderName ) INLINE Qt_QNetworkRequest_hasRawHeader( ::pPtr, pHeaderName ) + METHOD header( nHeader ) INLINE Qt_QNetworkRequest_header( ::pPtr, nHeader ) + METHOD rawHeader( pHeaderName ) INLINE Qt_QNetworkRequest_rawHeader( ::pPtr, pHeaderName ) + METHOD setAttribute( nCode, pValue ) INLINE Qt_QNetworkRequest_setAttribute( ::pPtr, nCode, pValue ) + METHOD setHeader( nHeader, pValue ) INLINE Qt_QNetworkRequest_setHeader( ::pPtr, nHeader, pValue ) + METHOD setRawHeader( pHeaderName, pHeaderValue ) INLINE Qt_QNetworkRequest_setRawHeader( ::pPtr, pHeaderName, pHeaderValue ) + METHOD setUrl( pUrl ) INLINE Qt_QNetworkRequest_setUrl( ::pPtr, pUrl ) + METHOD url() INLINE Qt_QNetworkRequest_url( ::pPtr ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD New( pParent ) CLASS QNetworkRequest + + ::pParent := pParent + + ::pPtr := Qt_QNetworkRequest( pParent ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD Configure( xObject ) CLASS QNetworkRequest + + IF hb_isObject( xObject ) + ::pPtr := xObject:pPtr + ELSEIF hb_isPointer( xObject ) + ::pPtr := xObject + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/qtnetwork/filelist.mk b/harbour/contrib/hbqt/qtnetwork/filelist.mk new file mode 100644 index 0000000000..3df9ed61e9 --- /dev/null +++ b/harbour/contrib/hbqt/qtnetwork/filelist.mk @@ -0,0 +1,28 @@ +# +# $Id$ +# + +# -------------------------------------------------------------------- +# WARNING: Automatically generated source file. DO NOT EDIT! +# Instead, edit corresponding .qth file, +# or the generator tool itself, and run regenarate. +# -------------------------------------------------------------------- + +CPP_SOURCES := \ + QFtp.cpp \ + QHttp.cpp \ + QHttpRequestHeader.cpp \ + QHttpResponseHeader.cpp \ + QNetworkRequest.cpp \ + + + +PRG_SOURCES := \ + TQFtp.prg \ + TQHttp.prg \ + TQHttpRequestHeader.prg \ + TQHttpResponseHeader.prg \ + TQNetworkRequest.prg \ + +# Don't delete this comment, it's here to ensure empty +# line above is kept intact.