translated var in test.prg

translated var in test.prg

import "mod_debug";
import "mod_draw";
import "mod_file";
import "mod_grproc";
import "mod_joy";
import "mod_key";
import "mod_map";
import "mod_math";
import "mod_proc";
import "mod_rand";
import "mod_say";
import "mod_screen";
import "mod_string";
import "mod_scroll";
import "mod_sound";
import "mod_text";
import "mod_time";
import "mod_video";
import "mod_wm";

/*------------------------------------------------------------------------------*/

include "tilescroll.prg";

/*------------------------------------------------------------------------------*/

GLOBAL

	_tsmap example_tilemap;

	int map_layers = 3;
	int map_width = 700;
	int map_height = 700;

	mouse_tile_x;
	mouse_tile_y;

END

BEGIN

	set_mode(640,480,32,mode_window);
	set_fps(0,0);
	write_var( 0,0,0,0, fps );

	write_var( 0, 0, 20, 0, mouse_tile_x );
	write_var( 0, 0, 30, 0, mouse_tile_y );

	// shows debug info
	ts.debuginfo = true;

	// variable initialization
	tsMapAlloc( example_tilemap, map_layers, map_width, map_height );

	// fills the map with random values
	FOR ( z=0; z<example_tilemap.layers; z++ )
		FOR (x=0; x<example_tilemap.width; x++)
			FOR (y=0; y<example_tilemap.height; y++)

				tileSet( example_tilemap, z, x, y, rand(0,3) );

			END
		END
	END

	tsMapSave( example_tilemap, "mapa.dat" );

	tsMapClear( example_tilemap );

	tsMapLoad( example_tilemap, "mapa.dat" );

	// load FPGs ( only for 2 layers )
	example_tilemap.fpg[0] = load_fpg("fpg/terrain.fpg");
	example_tilemap.fpg[1] = load_fpg("fpg/objects.fpg");

	// initialize the scroll
	tsManager(0, 0, 640, 480, example_tilemap, 64, 100);

	mouse.graph = 1;

	tsDebugMove(8);

	LOOP

		if ( key(_esc) )
			exit();
		end

		// calculate the cursor position in tiles
		tsPixelToTile( ts.pos_x + mouse.x, ts.pos_y + mouse.y, mouse_tile_x, mouse_tile_y );

		FRAME;

	END

END

import "mod_debug";
import "mod_draw";
import "mod_file";
import "mod_grproc";
import "mod_joy";
import "mod_key";
import "mod_map";
import "mod_math";
import "mod_proc";
import "mod_rand";
import "mod_say";
import "mod_screen";
import "mod_string";
import "mod_scroll";
import "mod_sound";
import "mod_text";
import "mod_time";
import "mod_video";
import "mod_wm";

/*------------------------------------------------------------------------------*/

include "tilescroll.prg";

/*------------------------------------------------------------------------------*/

GLOBAL

	_tsmap mapa_ejemplo;

	int map_layers = 3;
	int map_width = 700;
	int map_height = 700;

	mouse_tile_x;
	mouse_tile_y;

END

BEGIN

	set_mode(640,480,32,mode_window);
	set_fps(0,0);
	write_var( 0,0,0,0, fps );

	write_var( 0, 0, 20, 0, mouse_tile_x );
	write_var( 0, 0, 30, 0, mouse_tile_y );

	// shows debug info
	ts.debuginfo = true;

	// variable initialization
	tsMapAlloc( mapa_ejemplo, map_layers, map_width, map_height );

	// fills the map with random values
	FOR ( z=0; z<mapa_ejemplo.layers; z++ )
		FOR (x=0; x<mapa_ejemplo.width; x++)
			FOR (y=0; y<mapa_ejemplo.height; y++)

				tileSet( mapa_ejemplo, z, x, y, rand(0,3) );

			END
		END
	END

	tsMapSave( mapa_ejemplo, "mapa.dat" );

	tsMapClear( mapa_ejemplo );

	tsMapLoad( mapa_ejemplo, "mapa.dat" );

	// load FPGs ( only for 2 layers )
	mapa_ejemplo.fpg[0] = load_fpg("fpg/terrain.fpg");
	mapa_ejemplo.fpg[1] = load_fpg("fpg/objects.fpg");

	// initialize the scroll
	tsManager(0, 0, 640, 480, mapa_ejemplo, 64, 100);

	mouse.graph = 1;

	tsDebugMove(8);

	LOOP

		if ( key(_esc) )
			exit();
		end

		// calculate the cursor position in tiles
		tsPixelToTile( ts.pos_x + mouse.x, ts.pos_y + mouse.y, mouse_tile_x, mouse_tile_y );

		FRAME;

	END

END


tests/HAbstractTableModelV213.prg: updated

Modified:
tests/HAbstractTableModelV213.prg

/*

  Qt5xHb Project - Test Program

  Copyright (C) 2017 Marcos Antonio Gambeta

  E-mail:
  marcosgambeta AT outlook DOT com

  Website:
  https://github.com/marcosgambeta/Qt5xHb

*/

#include "qt5xhb.ch"

PROCEDURE Main ()

   LOCAL oApp
   LOCAL oWindow
   LOCAL oModel
   LOCAL oView
   LOCAL nRow

   IF !file("test.dbf")
      dbcreate("test",{;
         {"field1    ","c",20,0},;
         {"field2    ","c",20,0},;
         {"field3    ","c",20,0},;
         {"field4    ","c",20,0},;
         {"field5    ","c",20,0},;
         {"field6    ","c",20,0},;
         {"field7    ","c",20,0},;
         {"field8    ","c",20,0},;
         {"field9    ","c",20,0},;
         {"field10   ","c",20,0},;
         {"field11   ","c",20,0},;
         {"field12   ","c",20,0},;
         {"field13   ","c",20,0},;
         {"field14   ","c",20,0},;
         {"field15   ","c",20,0},;
         {"field16   ","c",20,0},;
         {"field17   ","c",20,0},;
         {"field18   ","c",20,0},;
         {"field19   ","c",20,0},;
         {"field20   ","c",20,0}})
   ENDIF

   USE test ALIAS test

   IF reccount() == 0

      FOR nRow := 1 TO 10000
         APPEND BLANK
         REPLACE field1  WITH alltrim(str(nRow))+","+alltrim(str(1))
         REPLACE field2  WITH alltrim(str(nRow))+","+alltrim(str(2))
         REPLACE field3  WITH alltrim(str(nRow))+","+alltrim(str(3))
         REPLACE field4  WITH alltrim(str(nRow))+","+alltrim(str(4))
         REPLACE field5  WITH alltrim(str(nRow))+","+alltrim(str(5))
         REPLACE field6  WITH alltrim(str(nRow))+","+alltrim(str(6))
         REPLACE field7  WITH alltrim(str(nRow))+","+alltrim(str(7))
         REPLACE field8  WITH alltrim(str(nRow))+","+alltrim(str(8))
         REPLACE field9  WITH alltrim(str(nRow))+","+alltrim(str(9))
         REPLACE field10 WITH alltrim(str(nRow))+","+alltrim(str(10))
         REPLACE field11 WITH alltrim(str(nRow))+","+alltrim(str(11))
         REPLACE field12 WITH alltrim(str(nRow))+","+alltrim(str(12))
         REPLACE field13 WITH alltrim(str(nRow))+","+alltrim(str(13))
         REPLACE field14 WITH alltrim(str(nRow))+","+alltrim(str(14))
         REPLACE field15 WITH alltrim(str(nRow))+","+alltrim(str(15))
         REPLACE field16 WITH alltrim(str(nRow))+","+alltrim(str(16))
         REPLACE field17 WITH alltrim(str(nRow))+","+alltrim(str(17))
         REPLACE field18 WITH alltrim(str(nRow))+","+alltrim(str(18))
         REPLACE field19 WITH alltrim(str(nRow))+","+alltrim(str(19))
         REPLACE field20 WITH alltrim(str(nRow))+","+alltrim(str(20))
      NEXT nRow

   ENDIF

   oApp := QApplication():new()

   oWindow := QWidget():new()
   oWindow:setWindowTitle("Teste")
   oWindow:resize(800,600)

   oModel := myModel():new()

   oView := QTableView():new(oWindow)
   oView:move(10,10)
   oView:resize(800-20,600-20)
   oView:setModel(oModel)

   oWindow:show()

   oApp:exec()

   oModel:delete()

   oWindow:delete()

   oApp:delete()

   USE

RETURN

#include "hbclass.ch"

CLASS myModel INHERIT HAbstractTableModelV2

   METHOD new
   METHOD rowCount
   METHOD columnCount
   METHOD data
   METHOD headerData
   METHOD flags
   METHOD setData

END CLASS

METHOD new (...) CLASS myModel

   ::super:new(...)

   ::setRowCountCB( {|...|::rowCount(...)} )
   ::setColumnCountCB( {|...|::columnCount(...)} )
   ::setDataCB( {|...|::data(...)} )
   ::setHeaderDataCB( {|...|::headerData(...)} )
   ::setFlagsCB( {|...|::flags(...)} )
   ::setSetDataCB( {|...|::setData(...)} )

RETURN self

METHOD rowCount () CLASS myModel
RETURN reccount()

METHOD columnCount () CLASS myModel
RETURN fcount()

METHOD data (pIndex, nRole) CLASS myModel

   LOCAL oVariant := QVariant():new()
   LOCAL oIndex := QModelIndex():newFrom(pIndex)
   LOCAL nRow := oIndex:row()
   LOCAL nColumn := oIndex:column()

   IF oIndex:isValid()

      dbgoto(nRow+1)

      IF nRole == Qt_DisplayRole
         oVariant := QVariant():new(fieldget(nColumn+1))
      ELSEIF nRole == Qt_EditRole
         oVariant := QVariant():new(fieldget(nColumn+1))
      ENDIF

   ENDIF

RETURN oVariant

METHOD headerData (nSection, nOrientation, nRole) CLASS myModel

   LOCAL oVariant := QVariant():new()

   IF nOrientation == Qt_Horizontal .AND. nRole == Qt_DisplayRole
      oVariant := QVariant():new("Campo "+alltrim(str(nSection+1)))
   ELSEIF nOrientation == Qt_Vertical .AND. nRole == Qt_DisplayRole
      oVariant := QVariant():new("Registro "+alltrim(str(nSection+1)))
   ENDIF

RETURN oVariant

METHOD flags (pIndex) CLASS myModel

   LOCAL nFlags := Qt_ItemIsSelectable + Qt_ItemIsEditable + Qt_ItemIsEnabled
   LOCAL oIndex := QModelIndex():newFrom(pIndex)
   LOCAL nRow := oIndex:row()
   LOCAL nColumn := oIndex:column()

RETURN nFlags

METHOD setData (pIndex, pVariant, nRole) CLASS myModel

   LOCAL lSuccess := .F.
   LOCAL oIndex := QModelIndex():newFrom(pIndex)
   LOCAL oVariant := QVariant():newFrom(pVariant)
   LOCAL nRow := oIndex:row()
   LOCAL nColumn := oIndex:column()
   LOCAL cValue := ""

   IF oIndex:isValid()

      IF nRole == Qt_EditRole

         dbgoto(nRow+1)

         cValue := oVariant:toString()

         IF !empty(cValue)
            fieldput(nColumn+1, oVariant:toString())
            lSuccess := .T.
         ENDIF

      ENDIF

   ENDIF

RETURN lSuccess

/*

  Qt5xHb Project - Test Program

  Copyright (C) 2017 Marcos Antonio Gambeta

  E-mail:
  marcosgambeta AT outlook DOT com

  Website:
  https://github.com/marcosgambeta/Qt5xHb

*/

#include "qt5xhb.ch"

PROCEDURE Main ()

   LOCAL oApp
   LOCAL oWindow
   LOCAL oModel
   LOCAL oView
   LOCAL nRow

   IF !file("test.dbf")
      dbcreate("test",{;
         {"field1    ","c",20,0},;
         {"field2    ","c",20,0},;
         {"field3    ","c",20,0},;
         {"field4    ","c",20,0},;
         {"field5    ","c",20,0},;
         {"field6    ","c",20,0},;
         {"field7    ","c",20,0},;
         {"field8    ","c",20,0},;
         {"field9    ","c",20,0},;
         {"field10   ","c",20,0},;
         {"field11   ","c",20,0},;
         {"field12   ","c",20,0},;
         {"field13   ","c",20,0},;
         {"field14   ","c",20,0},;
         {"field15   ","c",20,0},;
         {"field16   ","c",20,0},;
         {"field17   ","c",20,0},;
         {"field18   ","c",20,0},;
         {"field19   ","c",20,0},;
         {"field20   ","c",20,0}})
   ENDIF

   USE test ALIAS test

   IF reccount() == 0

      FOR nRow := 1 TO 10000
         APPEND BLANK
         REPLACE field1  WITH alltrim(str(nRow))+","+alltrim(str(1))
         REPLACE field2  WITH alltrim(str(nRow))+","+alltrim(str(2))
         REPLACE field3  WITH alltrim(str(nRow))+","+alltrim(str(3))
         REPLACE field4  WITH alltrim(str(nRow))+","+alltrim(str(4))
         REPLACE field5  WITH alltrim(str(nRow))+","+alltrim(str(5))
         REPLACE field6  WITH alltrim(str(nRow))+","+alltrim(str(6))
         REPLACE field7  WITH alltrim(str(nRow))+","+alltrim(str(7))
         REPLACE field8  WITH alltrim(str(nRow))+","+alltrim(str(8))
         REPLACE field9  WITH alltrim(str(nRow))+","+alltrim(str(9))
         REPLACE field10 WITH alltrim(str(nRow))+","+alltrim(str(10))
         REPLACE field11 WITH alltrim(str(nRow))+","+alltrim(str(11))
         REPLACE field12 WITH alltrim(str(nRow))+","+alltrim(str(12))
         REPLACE field13 WITH alltrim(str(nRow))+","+alltrim(str(13))
         REPLACE field14 WITH alltrim(str(nRow))+","+alltrim(str(14))
         REPLACE field15 WITH alltrim(str(nRow))+","+alltrim(str(15))
         REPLACE field16 WITH alltrim(str(nRow))+","+alltrim(str(16))
         REPLACE field17 WITH alltrim(str(nRow))+","+alltrim(str(17))
         REPLACE field18 WITH alltrim(str(nRow))+","+alltrim(str(18))
         REPLACE field19 WITH alltrim(str(nRow))+","+alltrim(str(19))
         REPLACE field20 WITH alltrim(str(nRow))+","+alltrim(str(20))
      NEXT nRow

   ENDIF

   oApp := QApplication():new()

   oWindow := QWidget():new()
   oWindow:setWindowTitle("Teste")
   oWindow:resize(800,600)

   oModel := myModel():new()

   oView := QTableView():new(oWindow)
   oView:move(10,10)
   oView:resize(800-20,600-20)
   oView:setModel(oModel)
   oView:resizeRowsToContents()
   oView:resizeColumnsToContents()

   oWindow:show()

   oApp:exec()

   oModel:delete()

   oWindow:delete()

   oApp:delete()

   USE

RETURN

#include "hbclass.ch"

CLASS myModel INHERIT HAbstractTableModelV2

   METHOD new
   METHOD rowCount
   METHOD columnCount
   METHOD data
   METHOD headerData
   METHOD flags
   METHOD setData

END CLASS

METHOD new (...) CLASS myModel

   ::super:new(...)

   ::setRowCountCB( {|...|::rowCount(...)} )
   ::setColumnCountCB( {|...|::columnCount(...)} )
   ::setDataCB( {|...|::data(...)} )
   ::setHeaderDataCB( {|...|::headerData(...)} )
   ::setFlagsCB( {|...|::flags(...)} )
   ::setSetDataCB( {|...|::setData(...)} )

RETURN self

METHOD rowCount () CLASS myModel
RETURN reccount()

METHOD columnCount () CLASS myModel
RETURN fcount()

METHOD data (pIndex, nRole) CLASS myModel

   LOCAL oVariant := QVariant():new()
   LOCAL oIndex := QModelIndex():newFrom(pIndex)
   LOCAL nRow := oIndex:row()
   LOCAL nColumn := oIndex:column()

   IF oIndex:isValid()

      dbgoto(nRow+1)

      IF nRole == Qt_DisplayRole
         oVariant := QVariant():new(fieldget(nColumn+1))
      ELSEIF nRole == Qt_EditRole
         oVariant := QVariant():new(fieldget(nColumn+1))
      ENDIF

   ENDIF

RETURN oVariant

METHOD headerData (nSection, nOrientation, nRole) CLASS myModel

   LOCAL oVariant := QVariant():new()

   IF nOrientation == Qt_Horizontal .AND. nRole == Qt_DisplayRole
      oVariant := QVariant():new("Campo "+alltrim(str(nSection+1)))
   ELSEIF nOrientation == Qt_Vertical .AND. nRole == Qt_DisplayRole
      oVariant := QVariant():new("Registro "+alltrim(str(nSection+1)))
   ENDIF

RETURN oVariant

METHOD flags (pIndex) CLASS myModel

   LOCAL nFlags := Qt_ItemIsSelectable + Qt_ItemIsEditable + Qt_ItemIsEnabled
   LOCAL oIndex := QModelIndex():newFrom(pIndex)
   LOCAL nRow := oIndex:row()
   LOCAL nColumn := oIndex:column()

RETURN nFlags

METHOD setData (pIndex, pVariant, nRole) CLASS myModel

   LOCAL lSuccess := .F.
   LOCAL oIndex := QModelIndex():newFrom(pIndex)
   LOCAL oVariant := QVariant():newFrom(pVariant)
   LOCAL nRow := oIndex:row()
   LOCAL nColumn := oIndex:column()
   LOCAL cValue := ""

   IF oIndex:isValid()

      IF nRole == Qt_EditRole

         dbgoto(nRow+1)

         cValue := oVariant:toString()

         IF !empty(cValue)
            fieldput(nColumn+1, oVariant:toString())
            lSuccess := .T.
         ENDIF

      ENDIF

   ENDIF

RETURN lSuccess


QWebSocket: class updated

QWebSocket: class updated

Modified:
source/QtWebSockets/QWebSocket.prg

/*

  Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5

  Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QHOSTADDRESS
REQUEST QNETWORKPROXY
REQUEST QMASKGENERATOR
REQUEST QURL
REQUEST QSSLCONFIGURATION
#endif

CLASS QWebSocket INHERIT QObject

   METHOD new
   METHOD delete
   METHOD abort
   METHOD error
   METHOD errorString
   METHOD flush
   METHOD isValid
   METHOD localAddress
   METHOD localPort
   METHOD pauseMode
   METHOD peerAddress
   METHOD peerName
   METHOD peerPort
   METHOD proxy
   METHOD setProxy
   METHOD maskGenerator
   METHOD setMaskGenerator
   METHOD readBufferSize
   METHOD setReadBufferSize
   METHOD resume
   METHOD setPauseMode
   METHOD state
   METHOD version
   METHOD resourceName
   METHOD requestUrl
   METHOD origin
   METHOD closeCode
   METHOD closeReason
   METHOD sendTextMessage
   METHOD sendBinaryMessage
   METHOD ignoreSslErrors
   METHOD sslConfiguration
   METHOD setSslConfiguration
   METHOD close
   METHOD open
   METHOD ping

   METHOD onAboutToClose
   METHOD onConnected
   METHOD onDisconnected
   METHOD onStateChanged
   METHOD onProxyAuthenticationRequired
   METHOD onReadChannelFinished
   METHOD onTextFrameReceived
   METHOD onBinaryFrameReceived
   METHOD onTextMessageReceived
   METHOD onBinaryMessageReceived
   METHOD onError
   METHOD onPong
   METHOD onBytesWritten
   METHOD onSslErrors

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QWebSocket
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <Qt>

#ifndef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
#include <QWebSocket>
#endif
#endif

#include "qt5xhb_common.h"
#include "qt5xhb_macros.h"
#include "qt5xhb_utils.h"

#ifdef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
#include <QWebSocket>
#endif
#endif

#include <QMaskGenerator>

/*
explicit QWebSocket(const QString &origin = QString(),QWebSocketProtocol::Version version = QWebSocketProtocol::VersionLatest,QObject *parent = Q_NULLPTR)
*/
HB_FUNC_STATIC( QWEBSOCKET_NEW )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  if( ISBETWEEN(0,3) && ISOPTCHAR(1) && ISOPTNUM(2) && (ISQOBJECT(3)||ISNIL(3)) )
  {
    QWebSocket * o = new QWebSocket ( OPQSTRING(1,QString()), ISNIL(2)? (QWebSocketProtocol::Version) QWebSocketProtocol::VersionLatest : (QWebSocketProtocol::Version) hb_parni(2), OPQOBJECT(3,Q_NULLPTR) );
    _qt5xhb_returnNewObject( o, false );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
#endif
}

HB_FUNC_STATIC( QWEBSOCKET_DELETE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void abort()
*/
HB_FUNC_STATIC( QWEBSOCKET_ABORT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      obj->abort ();
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
QAbstractSocket::SocketError error() const
*/
HB_FUNC_STATIC( QWEBSOCKET_ERROR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RENUM( obj->error () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QString errorString() const
*/
HB_FUNC_STATIC( QWEBSOCKET_ERRORSTRING )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRING( obj->errorString () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
bool flush()
*/
HB_FUNC_STATIC( QWEBSOCKET_FLUSH )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RBOOL( obj->flush () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
bool isValid() const
*/
HB_FUNC_STATIC( QWEBSOCKET_ISVALID )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RBOOL( obj->isValid () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QHostAddress localAddress() const
*/
HB_FUNC_STATIC( QWEBSOCKET_LOCALADDRESS )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      QHostAddress * ptr = new QHostAddress( obj->localAddress () );
      _qt5xhb_createReturnClass ( ptr, "QHOSTADDRESS", true );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
quint16 localPort() const
*/
HB_FUNC_STATIC( QWEBSOCKET_LOCALPORT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQUINT16( obj->localPort () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QAbstractSocket::PauseModes pauseMode() const
*/
HB_FUNC_STATIC( QWEBSOCKET_PAUSEMODE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RENUM( obj->pauseMode () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QHostAddress peerAddress() const
*/
HB_FUNC_STATIC( QWEBSOCKET_PEERADDRESS )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      QHostAddress * ptr = new QHostAddress( obj->peerAddress () );
      _qt5xhb_createReturnClass ( ptr, "QHOSTADDRESS", true );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QString peerName() const
*/
HB_FUNC_STATIC( QWEBSOCKET_PEERNAME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRING( obj->peerName () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
quint16 peerPort() const
*/
HB_FUNC_STATIC( QWEBSOCKET_PEERPORT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQUINT16( obj->peerPort () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QNetworkProxy proxy() const
*/
HB_FUNC_STATIC( QWEBSOCKET_PROXY )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      QNetworkProxy * ptr = new QNetworkProxy( obj->proxy () );
      _qt5xhb_createReturnClass ( ptr, "QNETWORKPROXY", true );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
void setProxy(const QNetworkProxy &networkProxy)
*/
HB_FUNC_STATIC( QWEBSOCKET_SETPROXY )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISQNETWORKPROXY(1) )
    {
      obj->setProxy ( *PQNETWORKPROXY(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
const QMaskGenerator *maskGenerator() const
*/
HB_FUNC_STATIC( QWEBSOCKET_MASKGENERATOR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      const QMaskGenerator * ptr = obj->maskGenerator ();
      _qt5xhb_createReturnQObjectClass ( ptr, "QMASKGENERATOR" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
void setMaskGenerator(const QMaskGenerator *maskGenerator)
*/
HB_FUNC_STATIC( QWEBSOCKET_SETMASKGENERATOR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISQMASKGENERATOR(1) )
    {
      obj->setMaskGenerator ( PQMASKGENERATOR(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
qint64 readBufferSize() const
*/
HB_FUNC_STATIC( QWEBSOCKET_READBUFFERSIZE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQINT64( obj->readBufferSize () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
void setReadBufferSize(qint64 size)
*/
HB_FUNC_STATIC( QWEBSOCKET_SETREADBUFFERSIZE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISNUM(1) )
    {
      obj->setReadBufferSize ( PQINT64(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void resume()
*/
HB_FUNC_STATIC( QWEBSOCKET_RESUME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      obj->resume ();
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void setPauseMode(QAbstractSocket::PauseModes pauseMode)
*/
HB_FUNC_STATIC( QWEBSOCKET_SETPAUSEMODE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISNUM(1) )
    {
      obj->setPauseMode ( (QAbstractSocket::PauseModes) hb_parni(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
QAbstractSocket::SocketState state() const
*/
HB_FUNC_STATIC( QWEBSOCKET_STATE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RENUM( obj->state () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QWebSocketProtocol::Version version() const
*/
HB_FUNC_STATIC( QWEBSOCKET_VERSION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RENUM( obj->version () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QString resourceName() const
*/
HB_FUNC_STATIC( QWEBSOCKET_RESOURCENAME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRING( obj->resourceName () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QUrl requestUrl() const
*/
HB_FUNC_STATIC( QWEBSOCKET_REQUESTURL )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      QUrl * ptr = new QUrl( obj->requestUrl () );
      _qt5xhb_createReturnClass ( ptr, "QURL", true );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QString origin() const
*/
HB_FUNC_STATIC( QWEBSOCKET_ORIGIN )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRING( obj->origin () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QWebSocketProtocol::CloseCode closeCode() const
*/
HB_FUNC_STATIC( QWEBSOCKET_CLOSECODE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RENUM( obj->closeCode () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QString closeReason() const
*/
HB_FUNC_STATIC( QWEBSOCKET_CLOSEREASON )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRING( obj->closeReason () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
qint64 sendTextMessage(const QString &message)
*/
HB_FUNC_STATIC( QWEBSOCKET_SENDTEXTMESSAGE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISCHAR(1) )
    {
      RQINT64( obj->sendTextMessage ( PQSTRING(1) ) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
qint64 sendBinaryMessage(const QByteArray &data)
*/
HB_FUNC_STATIC( QWEBSOCKET_SENDBINARYMESSAGE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISQBYTEARRAY(1) )
    {
      RQINT64( obj->sendBinaryMessage ( *PQBYTEARRAY(1) ) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
void ignoreSslErrors(const QList<QSslError> &errors)
*/
void QWebSocket_ignoreSslErrors1 ()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
       QList<QSslError> par1;
PHB_ITEM aList1 = hb_param(1, HB_IT_ARRAY);
int i1;
int nLen1 = hb_arrayLen(aList1);
for (i1=0;i1<nLen1;i1++)
{
  par1 << *(QSslError *) hb_itemGetPtr( hb_objSendMsg( hb_arrayGetItemPtr( aList1, i1+1 ), "POINTER", 0 ) );
}
      obj->ignoreSslErrors ( par1 );
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void ignoreSslErrors()
*/
void QWebSocket_ignoreSslErrors2 ()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
      obj->ignoreSslErrors ();
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

//[1]void ignoreSslErrors(const QList<QSslError> &errors)
//[2]void ignoreSslErrors()

HB_FUNC_STATIC( QWEBSOCKET_IGNORESSLERRORS )
{
  if( ISNUMPAR(1) && ISARRAY(1) )
  {
    QWebSocket_ignoreSslErrors1();
  }
  else if( ISNUMPAR(0) )
  {
    QWebSocket_ignoreSslErrors2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
QSslConfiguration sslConfiguration() const
*/
HB_FUNC_STATIC( QWEBSOCKET_SSLCONFIGURATION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      QSslConfiguration * ptr = new QSslConfiguration( obj->sslConfiguration () );
      _qt5xhb_createReturnClass ( ptr, "QSSLCONFIGURATION", true );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
void setSslConfiguration(const QSslConfiguration &sslConfiguration)
*/
HB_FUNC_STATIC( QWEBSOCKET_SETSSLCONFIGURATION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISQSSLCONFIGURATION(1) )
    {
      obj->setSslConfiguration ( *PQSSLCONFIGURATION(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void close(QWebSocketProtocol::CloseCode closeCode = QWebSocketProtocol::CloseCodeNormal,const QString &reason = QString())
*/
HB_FUNC_STATIC( QWEBSOCKET_CLOSE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(0,2) && ISOPTNUM(1) && ISOPTCHAR(2) )
    {
      obj->close ( ISNIL(1)? (QWebSocketProtocol::CloseCode) QWebSocketProtocol::CloseCodeNormal : (QWebSocketProtocol::CloseCode) hb_parni(1), OPQSTRING(2,QString()) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void open(const QUrl &url)
*/
HB_FUNC_STATIC( QWEBSOCKET_OPEN )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISQURL(1) )
    {
      obj->open ( *PQURL(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void ping(const QByteArray &payload = QByteArray())
*/
HB_FUNC_STATIC( QWEBSOCKET_PING )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(0,1) && (ISQBYTEARRAY(1)||ISNIL(1)) )
    {
      obj->ping ( ISNIL(1)? QByteArray() : *(QByteArray *) _qt5xhb_itemGetPtr(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

#pragma ENDDUMP

/*

  Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5

  Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QHOSTADDRESS
REQUEST QNETWORKPROXY
REQUEST QMASKGENERATOR
REQUEST QURL
REQUEST QSSLCONFIGURATION
#endif

CLASS QWebSocket INHERIT QObject

   METHOD new
   METHOD delete
   METHOD abort
   METHOD error
   METHOD errorString
   METHOD flush
   METHOD isValid
   METHOD localAddress
   METHOD localPort
   METHOD pauseMode
   METHOD peerAddress
   METHOD peerName
   METHOD peerPort
   METHOD proxy
   METHOD setProxy
   METHOD maskGenerator
   METHOD setMaskGenerator
   METHOD readBufferSize
   METHOD setReadBufferSize
   METHOD resume
   METHOD setPauseMode
   METHOD state
   METHOD version
   METHOD resourceName
   METHOD requestUrl
   METHOD origin
   METHOD closeCode
   METHOD closeReason
   METHOD sendTextMessage
   METHOD sendBinaryMessage
   METHOD ignoreSslErrors
   METHOD sslConfiguration
   METHOD setSslConfiguration
   METHOD close
   METHOD open
   METHOD ping

   METHOD onAboutToClose
   METHOD onConnected
   METHOD onDisconnected
   METHOD onStateChanged
   METHOD onProxyAuthenticationRequired
   METHOD onReadChannelFinished
   METHOD onTextFrameReceived
   METHOD onBinaryFrameReceived
   METHOD onTextMessageReceived
   METHOD onBinaryMessageReceived
   METHOD onError
   METHOD onPong
   METHOD onBytesWritten
   METHOD onSslErrors

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QWebSocket
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <Qt>

#ifndef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
#include <QWebSocket>
#endif
#endif

#include "qt5xhb_common.h"
#include "qt5xhb_macros.h"
#include "qt5xhb_utils.h"

#ifdef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
#include <QWebSocket>
#endif
#endif

#include <QMaskGenerator>

/*
explicit QWebSocket(const QString &origin = QString(),QWebSocketProtocol::Version version = QWebSocketProtocol::VersionLatest,QObject *parent = Q_NULLPTR)
*/
HB_FUNC_STATIC( QWEBSOCKET_NEW )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  if( ISBETWEEN(0,3) && ISOPTCHAR(1) && ISOPTNUM(2) && (ISQOBJECT(3)||ISNIL(3)) )
  {
    QWebSocket * o = new QWebSocket ( OPQSTRING(1,QString()), ISNIL(2)? (QWebSocketProtocol::Version) QWebSocketProtocol::VersionLatest : (QWebSocketProtocol::Version) hb_parni(2), OPQOBJECT(3,Q_NULLPTR) );
    _qt5xhb_returnNewObject( o, false );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
#endif
}

HB_FUNC_STATIC( QWEBSOCKET_DELETE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void abort()
*/
HB_FUNC_STATIC( QWEBSOCKET_ABORT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      obj->abort ();
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
QAbstractSocket::SocketError error() const
*/
HB_FUNC_STATIC( QWEBSOCKET_ERROR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RENUM( obj->error () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QString errorString() const
*/
HB_FUNC_STATIC( QWEBSOCKET_ERRORSTRING )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRING( obj->errorString () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
bool flush()
*/
HB_FUNC_STATIC( QWEBSOCKET_FLUSH )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RBOOL( obj->flush () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
bool isValid() const
*/
HB_FUNC_STATIC( QWEBSOCKET_ISVALID )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RBOOL( obj->isValid () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QHostAddress localAddress() const
*/
HB_FUNC_STATIC( QWEBSOCKET_LOCALADDRESS )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      QHostAddress * ptr = new QHostAddress( obj->localAddress () );
      _qt5xhb_createReturnClass ( ptr, "QHOSTADDRESS", true );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
quint16 localPort() const
*/
HB_FUNC_STATIC( QWEBSOCKET_LOCALPORT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQUINT16( obj->localPort () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QAbstractSocket::PauseModes pauseMode() const
*/
HB_FUNC_STATIC( QWEBSOCKET_PAUSEMODE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RENUM( obj->pauseMode () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QHostAddress peerAddress() const
*/
HB_FUNC_STATIC( QWEBSOCKET_PEERADDRESS )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      QHostAddress * ptr = new QHostAddress( obj->peerAddress () );
      _qt5xhb_createReturnClass ( ptr, "QHOSTADDRESS", true );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QString peerName() const
*/
HB_FUNC_STATIC( QWEBSOCKET_PEERNAME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRING( obj->peerName () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
quint16 peerPort() const
*/
HB_FUNC_STATIC( QWEBSOCKET_PEERPORT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQUINT16( obj->peerPort () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QNetworkProxy proxy() const
*/
HB_FUNC_STATIC( QWEBSOCKET_PROXY )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      QNetworkProxy * ptr = new QNetworkProxy( obj->proxy () );
      _qt5xhb_createReturnClass ( ptr, "QNETWORKPROXY", true );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
void setProxy(const QNetworkProxy &networkProxy)
*/
HB_FUNC_STATIC( QWEBSOCKET_SETPROXY )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISQNETWORKPROXY(1) )
    {
      obj->setProxy ( *PQNETWORKPROXY(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
const QMaskGenerator *maskGenerator() const
*/
HB_FUNC_STATIC( QWEBSOCKET_MASKGENERATOR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      const QMaskGenerator * ptr = obj->maskGenerator ();
      _qt5xhb_createReturnQObjectClass ( ptr, "QMASKGENERATOR" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
void setMaskGenerator(const QMaskGenerator *maskGenerator)
*/
HB_FUNC_STATIC( QWEBSOCKET_SETMASKGENERATOR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISQMASKGENERATOR(1) )
    {
      obj->setMaskGenerator ( PQMASKGENERATOR(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
qint64 readBufferSize() const
*/
HB_FUNC_STATIC( QWEBSOCKET_READBUFFERSIZE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQINT64( obj->readBufferSize () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
void setReadBufferSize(qint64 size)
*/
HB_FUNC_STATIC( QWEBSOCKET_SETREADBUFFERSIZE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISNUM(1) )
    {
      obj->setReadBufferSize ( PQINT64(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void resume()
*/
HB_FUNC_STATIC( QWEBSOCKET_RESUME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      obj->resume ();
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void setPauseMode(QAbstractSocket::PauseModes pauseMode)
*/
HB_FUNC_STATIC( QWEBSOCKET_SETPAUSEMODE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISNUM(1) )
    {
      obj->setPauseMode ( (QAbstractSocket::PauseModes) hb_parni(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
QAbstractSocket::SocketState state() const
*/
HB_FUNC_STATIC( QWEBSOCKET_STATE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RENUM( obj->state () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QWebSocketProtocol::Version version() const
*/
HB_FUNC_STATIC( QWEBSOCKET_VERSION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RENUM( obj->version () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QString resourceName() const
*/
HB_FUNC_STATIC( QWEBSOCKET_RESOURCENAME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRING( obj->resourceName () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QUrl requestUrl() const
*/
HB_FUNC_STATIC( QWEBSOCKET_REQUESTURL )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      QUrl * ptr = new QUrl( obj->requestUrl () );
      _qt5xhb_createReturnClass ( ptr, "QURL", true );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QString origin() const
*/
HB_FUNC_STATIC( QWEBSOCKET_ORIGIN )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRING( obj->origin () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QWebSocketProtocol::CloseCode closeCode() const
*/
HB_FUNC_STATIC( QWEBSOCKET_CLOSECODE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RENUM( obj->closeCode () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
QString closeReason() const
*/
HB_FUNC_STATIC( QWEBSOCKET_CLOSEREASON )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRING( obj->closeReason () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
qint64 sendTextMessage(const QString &message)
*/
HB_FUNC_STATIC( QWEBSOCKET_SENDTEXTMESSAGE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISCHAR(1) )
    {
      RQINT64( obj->sendTextMessage ( PQSTRING(1) ) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
qint64 sendBinaryMessage(const QByteArray &data)
*/
HB_FUNC_STATIC( QWEBSOCKET_SENDBINARYMESSAGE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISQBYTEARRAY(1) )
    {
      RQINT64( obj->sendBinaryMessage ( *PQBYTEARRAY(1) ) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
void ignoreSslErrors(const QList<QSslError> &errors)
*/
void QWebSocket_ignoreSslErrors1 ()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
       QList<QSslError> par1;
PHB_ITEM aList1 = hb_param(1, HB_IT_ARRAY);
int i1;
int nLen1 = hb_arrayLen(aList1);
for (i1=0;i1<nLen1;i1++)
{
  par1 << *(QSslError *) hb_itemGetPtr( hb_objSendMsg( hb_arrayGetItemPtr( aList1, i1+1 ), "POINTER", 0 ) );
}
      obj->ignoreSslErrors ( par1 );
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void ignoreSslErrors()
*/
void QWebSocket_ignoreSslErrors2 ()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
      obj->ignoreSslErrors ();
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

//[1]void ignoreSslErrors(const QList<QSslError> &errors)
//[2]void ignoreSslErrors()

HB_FUNC_STATIC( QWEBSOCKET_IGNORESSLERRORS )
{
  if( ISNUMPAR(1) && ISARRAY(1) )
  {
    QWebSocket_ignoreSslErrors1();
  }
  else if( ISNUMPAR(0) )
  {
    QWebSocket_ignoreSslErrors2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
QSslConfiguration sslConfiguration() const
*/
HB_FUNC_STATIC( QWEBSOCKET_SSLCONFIGURATION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      QSslConfiguration * ptr = new QSslConfiguration( obj->sslConfiguration () );
      _qt5xhb_createReturnClass ( ptr, "QSSLCONFIGURATION", true );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
#endif
}

/*
void setSslConfiguration(const QSslConfiguration &sslConfiguration)
*/
HB_FUNC_STATIC( QWEBSOCKET_SETSSLCONFIGURATION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISQSSLCONFIGURATION(1) )
    {
      obj->setSslConfiguration ( *PQSSLCONFIGURATION(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void close(QWebSocketProtocol::CloseCode closeCode = QWebSocketProtocol::CloseCodeNormal,const QString &reason = QString())
*/
HB_FUNC_STATIC( QWEBSOCKET_CLOSE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(1,2) && ISOPTNUM(1) && ISOPTCHAR(2) )
    {
      obj->close ( ISNIL(1)? (QWebSocketProtocol::CloseCode) QWebSocketProtocol::CloseCodeNormal : (QWebSocketProtocol::CloseCode) hb_parni(1), OPQSTRING(2,QString()) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void open(const QUrl &url)
*/
HB_FUNC_STATIC( QWEBSOCKET_OPEN )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISQURL(1) )
    {
      obj->open ( *PQURL(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void ping(const QByteArray &payload = QByteArray())
*/
HB_FUNC_STATIC( QWEBSOCKET_PING )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  QWebSocket * obj = (QWebSocket *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(0,1) && (ISQBYTEARRAY(1)||ISNIL(1)) )
    {
      obj->ping ( ISNIL(1)? QByteArray() : *(QByteArray *) _qt5xhb_itemGetPtr(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

#pragma ENDDUMP