Additional fixes for #307: using WinEncoding to code/deode bytes to strings and binary + string now returns a binary

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//
USING System
USING System.Text
USING System.Runtime.InteropServices
USING System.Runtime.CompilerServices
USING System.Diagnostics
#pragma options ("az", on)
BEGIN NAMESPACE XSharp
    // use explicit layout so we can compact the size into 12 bytes
    // Type is Immutable, so has no settable properties
    /// <summary>Internal type that implements the FoxPro Compatible BINARY type.
    /// This type has many operators and implicit converters that normally are never directly called from user code.
    /// The data in this type is stored as an array of Bytes
    /// Conversion To String are supported and they use the current active windows codepage.
    /// </summary>
    PUBLIC STRUCTURE __Binary IMPLEMENTS IFormattable, ;
        IComparable<__Binary>, ;
        IEquatable<__Binary>, ;
        IComparable

        PRIVATE INITONLY _value AS BYTE[]

        #region constructors
        /// <include file="RTComments.xml" path="Comments/Constructor/*" />
        /// <param name="b">Byte[] value that has the bytes that define the binary</param>
        [DebuggerStepThroughAttribute] [MethodImpl(MethodImplOptions.AggressiveInlining)];
        CONSTRUCTOR (b as Byte[])
            IF b == NULL
                VAR err			 := Error{ArgumentException{}}
                err:Gencode		 := Gencode.EG_ARG
                err:ArgNum		 := 1
                err:FuncSym		 := "Binary.ctor"
                err:Description  := "Argument cannot be null"
                err:Args         := <OBJECT> {b}
                THROW err
            ENDIF
            SELF:_value    := b
        PRIVATE CONSTRUCTOR( lhs as byte[], rhs as byte[])
            var len := lhs:Length + rhs:Length
            var result := byte[]{len}
            System.Array.Copy(lhs, result, lhs:Length)
            System.Array.Copy(rhs, 0, result,lhs:Length, rhs:Length)
            RETURN __Binary{result}

        #endregion
        #region Properties
        /// <summary>REAL8 (System.Double) value</summary>
        PROPERTY @@Value    AS Byte[]	GET _value
        PROPERTY Length as LONG GET @@Value:Length
        #endregion

        #region Equality Operators
        /// <inheritdoc />
        OVERRIDE METHOD Equals(rhs AS OBJECT  ) AS LOGIC
            LOCAL result AS LOGIC
            IF rhs != NULL .AND. rhs IS __Binary
                result := SELF:Equals( (__Binary) rhs)
            ELSE
                result := FALSE
            ENDIF
            RETURN result

        /// <inheritdoc />
        METHOD Equals(rhs AS __Binary ) AS LOGIC
            IF SELF:Length != rhs:Length
                RETURN FALSE
            ENDIF
            FOR VAR i := 0 to SELF:Length
                IF SELF:Value[i] != rhs:Value[i]
                    RETURN FALSE
                ENDIF
            NEXT
            RETURN TRUE

            /// <inheritdoc />
        OVERRIDE METHOD GetHashCode() AS INT
            RETURN SELF:_value:GetHashCode()

            /// <exclude />
        METHOD GetTypeCode() AS TypeCode
            RETURN TypeCode.Object

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR ==(lhs AS __Binary, rhs AS __Binary) AS LOGIC
            RETURN lhs:Equals(rhs)

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR !=(lhs AS __Binary, rhs AS __Binary) AS LOGIC
            RETURN ! lhs:Equals(rhs)
            #endregion

        #region Comparison Operators
        /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR >(lhs AS __Binary, rhs AS __Binary) AS LOGIC
            var len := Math.Min(lhs:Length,rhs:Length)
            FOR VAR i := 0 to len-1
                IF lhs:Value[i] > rhs:Value[i]
                    RETURN TRUE
                ELSEIF lhs:Value[i] < rhs:Value[i]
                    RETURN FALSE
                ENDIF
            NEXT
            RETURN FALSE

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR <(lhs AS __Binary, rhs AS __Binary) AS LOGIC
            var len := Math.Min(lhs:Length,rhs:Length)
            FOR VAR i := 0 to len-1
                IF lhs:Value[i] < rhs:Value[i]
                    RETURN TRUE
                ELSEIF lhs:Value[i] > rhs:Value[i]
                    RETURN FALSE
                ENDIF
            NEXT
            RETURN FALSE

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR >=(lhs AS __Binary, rhs AS __Binary) AS LOGIC
            var len := Math.Min(lhs:Value:Length,rhs:Value:Length)
            FOR VAR i := 0 to len-1
                IF lhs:Value[i] < rhs:Value[i]
                    RETURN FALSE
                ENDIF
            NEXT
            RETURN TRUE

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR <=(lhs AS __Binary, rhs AS __Binary) AS LOGIC
            var len := Math.Min(lhs:Value:Length,rhs:Value:Length)
            FOR VAR i := 0 to len-1
                IF lhs:Value[i] > rhs:Value[i]
                    RETURN FALSE
                ENDIF
            NEXT
            RETURN FALSE

            #endregion

        #region Implicit Converters
        /// <include file="RTComments.xml" path="Comments/Operator/*" />
        [DebuggerStepThroughAttribute];
        STATIC OPERATOR IMPLICIT(b AS BYTE[]) AS __Binary
            RETURN __Binary{b}

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        [DebuggerStepThroughAttribute];
        STATIC OPERATOR IMPLICIT(b AS __Binary) AS BYTE[]
            RETURN b:Value

        [DebuggerStepThroughAttribute];
        STATIC OPERATOR IMPLICIT(bytes AS __Binary) AS STRING
            var sb := StringBuilder{}
            foreach var b in bytes:Value
                sb:Append(Chr(b))
            next
            return sb:ToString()

            #endregion

        #region Numeric Operators

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR+(lhs AS __Binary, rhs AS __Binary) AS __Binary
            return __Binary{lhs:Value, rhs:Value}

        /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR+(lhs AS __Binary, rhs AS STRING) AS __Binary
            return __Binary{lhs:Value, RuntimeState.WinEncoding:GetBytes(rhs)}

        OPERATOR+(lhs AS STRING, rhs AS __Binary) AS STRING
            var sb := StringBuilder{}
            sb:Append(lhs)
            sb:Append(RuntimeState.WinEncoding:GetString(rhs))
            RETURN sb:ToString()

        #endregion
        #region Unary Operators

            #endregion
        #region Add and Subtract
        /// <exclude />
        METHOD Add(rhs AS __Binary) AS __Binary
            RETURN SELF + rhs

        /// <inheritdoc />
        PUBLIC METHOD CompareTo(rhs AS __Binary) AS INT
            var len := Math.Min(SELF:Length,rhs:Length)
            for var i := 0 to len-1
                if SELF:Value[i] > rhs:Value[i]
                    return 1
                ELSEIF SELF:Value[i] < rhs:Value[i]
                    return -1
                ENDIF
            next
            if SELF:Length > rhs:Length
                RETURN 1
            ELSEIF SELF:Length < rhs:Length
                return -1
            ENDIF
            RETURN 0
            /// <inheritdoc />
        PUBLIC METHOD CompareTo(rhs AS OBJECT) AS INT
            RETURN SELF:CompareTo( (__Binary) rhs)
            #endregion

        #region IFormattable
        /// <inheritdoc />
        PUBLIC OVERRIDE METHOD ToString() AS STRING
            RETURN ToString("")

        /// <inheritdoc cref="M:System.Double.ToString(System.String)"/>
        PUBLIC METHOD ToString(sFormat AS STRING) AS STRING
            if sFormat == "G"
                return RuntimeState:WinEncoding:GetString(self:Value)
            endif
            var sb := StringBuilder{}
            sb:Append("0h")
            foreach var b in self:Value
                sb:Append(b:ToString("X"))
            next
            return sb:ToString()
            /// <inheritdoc />
        PUBLIC METHOD ToString(format AS STRING, provider AS System.IFormatProvider) AS STRING
            RETURN ToString(format)
            #endregion

    END STRUCTURE

END NAMESPACE

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//
USING System
USING System.Text
USING System.Runtime.InteropServices
USING System.Runtime.CompilerServices
USING System.Diagnostics

BEGIN NAMESPACE XSharp
    // use explicit layout so we can compact the size into 12 bytes
    // Type is Immutable, so has no settable properties
    /// <summary>Internal type that implements the FoxPro Compatible BINARY type.
    /// This type has many operators and implicit converters that normally are never directly called from user code.
    /// The data in this type is stored as an array of Bytes
    /// Conversion To String are supported and they use the current active windows codepage.
    /// </summary>
    PUBLIC STRUCTURE __Binary IMPLEMENTS IFormattable, ;
        IComparable<__Binary>, ;
        IEquatable<__Binary>, ;
        IComparable

        PRIVATE INITONLY _value AS BYTE[]

        #region constructors
        /// <include file="RTComments.xml" path="Comments/Constructor/*" />
        /// <param name="b">Byte[] value that has the bytes that define the binary</param>
        [DebuggerStepThroughAttribute] [MethodImpl(MethodImplOptions.AggressiveInlining)];
        CONSTRUCTOR (b as Byte[])
            IF b == NULL
                VAR err			 := Error{ArgumentException{}}
                err:Gencode		 := Gencode.EG_ARG
                err:ArgNum		 := 1
                err:FuncSym		 := "Binary.ctor"
                err:Description  := "Argument cannot be null"
                err:Args         := <OBJECT> {b}
                THROW err
            ENDIF
            SELF:_value    := b

        #endregion
        #region Properties
        /// <summary>REAL8 (System.Double) value</summary>
        PROPERTY @@Value    AS Byte[]	GET _value
        PROPERTY Length as LONG GET @@Value:Length
        #endregion

        #region Equality Operators
        /// <inheritdoc />
        OVERRIDE METHOD Equals(rhs AS OBJECT  ) AS LOGIC
            LOCAL result AS LOGIC
            IF rhs != NULL .AND. rhs IS __Binary
                result := SELF:Equals( (__Binary) rhs)
            ELSE
                result := FALSE
            ENDIF
            RETURN result

        /// <inheritdoc />
        METHOD Equals(rhs AS __Binary ) AS LOGIC
            IF SELF:Length != rhs:Length
                RETURN FALSE
            ENDIF
            FOR VAR i := 0 to SELF:Length
                IF SELF:Value[i] != rhs:Value[i]
                    RETURN FALSE
                ENDIF
            NEXT
            RETURN TRUE

            /// <inheritdoc />
        OVERRIDE METHOD GetHashCode() AS INT
            RETURN SELF:_value:GetHashCode()

            /// <exclude />
        METHOD GetTypeCode() AS TypeCode
            RETURN TypeCode.Object

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR ==(lhs AS __Binary, rhs AS __Binary) AS LOGIC
            RETURN lhs:Equals(rhs)

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR !=(lhs AS __Binary, rhs AS __Binary) AS LOGIC
            RETURN ! lhs:Equals(rhs)
            #endregion

        #region Comparison Operators
        /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR >(lhs AS __Binary, rhs AS __Binary) AS LOGIC
            var len := Math.Min(lhs:Length,rhs:Length)
            FOR VAR i := 0 to len-1
                IF lhs:Value[i] > rhs:Value[i]
                    RETURN TRUE
                ELSEIF lhs:Value[i] < rhs:Value[i]
                    RETURN FALSE
                ENDIF
            NEXT
            RETURN FALSE

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR <(lhs AS __Binary, rhs AS __Binary) AS LOGIC
            var len := Math.Min(lhs:Length,rhs:Length)
            FOR VAR i := 0 to len-1
                IF lhs:Value[i] < rhs:Value[i]
                    RETURN TRUE
                ELSEIF lhs:Value[i] > rhs:Value[i]
                    RETURN FALSE
                ENDIF
            NEXT
            RETURN FALSE

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR >=(lhs AS __Binary, rhs AS __Binary) AS LOGIC
            var len := Math.Min(lhs:Value:Length,rhs:Value:Length)
            FOR VAR i := 0 to len-1
                IF lhs:Value[i] < rhs:Value[i]
                    RETURN FALSE
                ENDIF
            NEXT
            RETURN TRUE

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR <=(lhs AS __Binary, rhs AS __Binary) AS LOGIC
            var len := Math.Min(lhs:Value:Length,rhs:Value:Length)
            FOR VAR i := 0 to len-1
                IF lhs:Value[i] > rhs:Value[i]
                    RETURN FALSE
                ENDIF
            NEXT
            RETURN FALSE

            #endregion

        #region Implicit Converters
        /// <include file="RTComments.xml" path="Comments/Operator/*" />
        [DebuggerStepThroughAttribute];
        STATIC OPERATOR IMPLICIT(b AS BYTE[]) AS __Binary
            RETURN __Binary{b}

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        [DebuggerStepThroughAttribute];
        STATIC OPERATOR IMPLICIT(b AS __Binary) AS BYTE[]
            RETURN b:Value

        [DebuggerStepThroughAttribute];
        STATIC OPERATOR IMPLICIT(bytes AS __Binary) AS STRING
            var sb := StringBuilder{}
            foreach var b in bytes:Value
                sb:Append(Chr(b))
            next
            return sb:ToString()

            #endregion

        #region Numeric Operators

            /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR+(lhs AS __Binary, rhs AS __Binary) AS __Binary
            var len := lhs:Value:Length + rhs:Value:Length
            var result := byte[]{len}
            System.Array.Copy(lhs, result, lhs:Value:Length)
            System.Array.Copy(rhs, 0, result,lhs:Length, rhs:Value:Length)
            RETURN __Binary{result}

        /// <include file="RTComments.xml" path="Comments/Operator/*" />
        OPERATOR+(lhs AS __Binary, rhs AS STRING) AS STRING
            var sb := StringBuilder{}
            foreach var b in lhs:Value
                sb:Append(Chr(b))
            next
            sb:Append(rhs)
            RETURN sb:ToString()

        OPERATOR+(lhs AS STRING, rhs AS __Binary) AS STRING
            var sb := StringBuilder{}
            sb:Append(lhs)
            foreach var b in rhs:Value
                sb:Append(Chr(b))
            next
            RETURN sb:ToString()

        #endregion
        #region Unary Operators

            #endregion
        #region Add and Subtract
        /// <exclude />
        METHOD Add(rhs AS __Binary) AS __Binary
            RETURN SELF + rhs

        /// <inheritdoc />
        PUBLIC METHOD CompareTo(rhs AS __Binary) AS INT
            var len := Math.Min(SELF:Length,rhs:Length)
            for var i := 0 to len-1
                if SELF:Value[i] > rhs:Value[i]
                    return 1
                ELSEIF SELF:Value[i] < rhs:Value[i]
                    return -1
                ENDIF
            next
            if SELF:Length > rhs:Length
                RETURN 1
            ELSEIF SELF:Length < rhs:Length
                return -1
            ENDIF
            RETURN 0
            /// <inheritdoc />
        PUBLIC METHOD CompareTo(rhs AS OBJECT) AS INT
            RETURN SELF:CompareTo( (__Binary) rhs)
            #endregion

        #region IFormattable
        /// <inheritdoc />
        PUBLIC OVERRIDE METHOD ToString() AS STRING
            RETURN ToString("")

        /// <inheritdoc cref="M:System.Double.ToString(System.String)"/>
        PUBLIC METHOD ToString(sFormat AS STRING) AS STRING
            var sb := StringBuilder{}
            if sFormat == "G"
                foreach var b in self:Value
                    sb:Append(Chr(b))
                next
            else
                sb:Append("0h")
                foreach var b in self:Value
                    sb:Append(b:ToString("X"))
                next
            endif
            return sb:ToString()
            /// <inheritdoc />
        PUBLIC METHOD ToString(format AS STRING, provider AS System.IFormatProvider) AS STRING
            RETURN ToString(format)
            #endregion

    END STRUCTURE

END NAMESPACE


QtScript: data for code generation updated

Modified:
codegen/QtScript/QScriptEngine.prg

%%
%% Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4
%%
%% Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>
%%

$header

#include "hbclass.ch"

#ifndef QT4XHB_NO_REQUESTS
REQUEST QSCRIPTENGINEAGENT
REQUEST QSCRIPTCONTEXT
REQUEST QSCRIPTVALUE
REQUEST QSCRIPTSTRING
REQUEST QSCRIPTSYNTAXCHECKRESULT
#endif

CLASS QScriptEngine INHERIT QObject

   METHOD new
   METHOD delete
   METHOD abortEvaluation
   METHOD agent
   METHOD availableExtensions
   METHOD clearExceptions
   METHOD collectGarbage
   METHOD currentContext
   METHOD defaultPrototype
   METHOD evaluate
   METHOD globalObject
   METHOD hasUncaughtException
   METHOD importExtension
   METHOD importedExtensions
   METHOD installTranslatorFunctions
   METHOD isEvaluating
   METHOD newArray
   METHOD newRegExp
   METHOD newVariant
   METHOD nullValue
   METHOD popContext
   METHOD processEventsInterval
   METHOD pushContext
   METHOD reportAdditionalMemoryCost
   METHOD setAgent
   METHOD setDefaultPrototype
   METHOD setGlobalObject
   METHOD setProcessEventsInterval
   METHOD toObject
   METHOD toStringHandle
   METHOD uncaughtException
   METHOD uncaughtExceptionBacktrace
   METHOD uncaughtExceptionLineNumber
   METHOD undefinedValue
   METHOD checkSyntax

   METHOD onSignalHandlerException

   DESTRUCTOR destroyObject

END CLASS

$destructor

#pragma BEGINDUMP

$includes

#include <QStringList>

$prototype=QScriptEngine ()
$internalConstructor=|new1|

$prototype=QScriptEngine ( QObject * parent )
$internalConstructor=|new2|QObject *

//[1]QScriptEngine ()
//[2]QScriptEngine ( QObject * parent )

HB_FUNC_STATIC( QSCRIPTENGINE_NEW )
{
  if( ISNUMPAR(0) )
  {
    QScriptEngine_new1();
  }
  else if( ISNUMPAR(1) && ISQOBJECT(1) )
  {
    QScriptEngine_new2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$deleteMethod

$prototype=void abortEvaluation ( const QScriptValue & result = QScriptValue() )
$method=|void|abortEvaluation|const QScriptValue &=QScriptValue()

$prototype=QScriptEngineAgent * agent () const
$method=|QScriptEngineAgent *|agent|

$prototype=QStringList availableExtensions () const
$method=|QStringList|availableExtensions|

$prototype=void clearExceptions ()
$method=|void|clearExceptions|

$prototype=void collectGarbage ()
$method=|void|collectGarbage|

$prototype=QScriptContext * currentContext () const
$method=|QScriptContext *|currentContext|

$prototype=QScriptValue defaultPrototype ( int metaTypeId ) const
$method=|QScriptValue|defaultPrototype|int

$prototype=QScriptValue evaluate ( const QString & program, const QString & fileName = QString(), int lineNumber = 1 )
$internalMethod=|QScriptValue|evaluate,evaluate1|const QString &,const QString &=QString(),int=1

$prototype=QScriptValue evaluate ( const QScriptProgram & program )
$internalMethod=|QScriptValue|evaluate,evaluate2|const QScriptProgram &

//[1]QScriptValue evaluate ( const QString & program, const QString & fileName = QString(), int lineNumber = 1 )
//[2]QScriptValue evaluate ( const QScriptProgram & program )

HB_FUNC_STATIC( QSCRIPTENGINE_EVALUATE )
{
  if( ISBETWEEN(1,3) && ISCHAR(1) && (ISCHAR(2)||ISNIL(2)) && (ISNUM(3)||ISNUM(3)) )
  {
    QScriptEngine_evaluate1();
  }
  else if( ISNUMPAR(1) && ISQSCRIPTPROGRAM(1) )
  {
    QScriptEngine_evaluate2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue globalObject () const
$method=|QScriptValue|globalObject|

$prototype=bool hasUncaughtException () const
$method=|bool|hasUncaughtException|

$prototype=QScriptValue importExtension ( const QString & extension )
$method=|QScriptValue|importExtension|const QString &

$prototype=QStringList importedExtensions () const
$method=|QStringList|importedExtensions|

$prototype=void installTranslatorFunctions ( const QScriptValue & object = QScriptValue() )
$method=|void|installTranslatorFunctions|const QScriptValue &=QScriptValue()

$prototype=bool isEvaluating () const
$method=|bool|isEvaluating|

$prototype=QScriptValue newArray ( uint length = 0 )
$method=|QScriptValue|newArray|uint=0

$prototype=QScriptValue newRegExp ( const QRegExp & regexp )
$internalMethod=|QScriptValue|newRegExp,newRegExp1|const QRegExp &

$prototype=QScriptValue newRegExp ( const QString & pattern, const QString & flags )
$internalMethod=|QScriptValue|newRegExp,newRegExp2|const QString &,const QString &

//[1]QScriptValue newRegExp ( const QRegExp & regexp )
//[2]QScriptValue newRegExp ( const QString & pattern, const QString & flags )

HB_FUNC_STATIC( QSCRIPTENGINE_NEWREGEXP )
{
  if( ISNUMPAR(1) && ISQREGEXP(1) )
  {
    QScriptEngine_newRegExp1();
  }
  else if( ISNUMPAR(2) && ISCHAR(1) && ISCHAR(2) )
  {
    QScriptEngine_newRegExp2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue newVariant ( const QVariant & value )
$internalMethod=|QScriptValue|newVariant,newVariant1|const QVariant &

$prototype=QScriptValue newVariant ( const QScriptValue & object, const QVariant & value )
$internalMethod=|QScriptValue|newVariant,newVariant2|const QScriptValue &,const QVariant &

//[1]QScriptValue newVariant ( const QVariant & value )
//[2]QScriptValue newVariant ( const QScriptValue & object, const QVariant & value )

HB_FUNC_STATIC( QSCRIPTENGINE_NEWVARIANT )
{
  if( ISNUMPAR(1) && ISQVARIANT(1) )
  {
    QScriptEngine_newVariant1();
  }
  else if( ISNUMPAR(2) && ISQSCRIPTVALUE(1) && ISQVARIANT(2) )
  {
    QScriptEngine_newVariant2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue nullValue ()
$method=|QScriptValue|nullValue|

$prototype=void popContext ()
$method=|void|popContext|

$prototype=int processEventsInterval () const
$method=|int|processEventsInterval|

$prototype=QScriptContext * pushContext ()
$method=|QScriptContext *|pushContext|

$prototype=void reportAdditionalMemoryCost ( int size )
$method=|void|reportAdditionalMemoryCost|int

$prototype=void setAgent ( QScriptEngineAgent * agent )
$method=|void|setAgent|QScriptEngineAgent *

$prototype=void setDefaultPrototype ( int metaTypeId, const QScriptValue & prototype )
$method=|void|setDefaultPrototype|int,const QScriptValue &

$prototype=void setGlobalObject ( const QScriptValue & object )
$method=|void|setGlobalObject|const QScriptValue &

$prototype=void setProcessEventsInterval ( int interval )
$method=|void|setProcessEventsInterval|int

$prototype=QScriptValue toObject ( const QScriptValue & value )
$method=|QScriptValue|toObject|const QScriptValue &

$prototype=QScriptString toStringHandle ( const QString & str )
$method=|QScriptString|toStringHandle|const QString &

$prototype=QScriptValue uncaughtException () const
$method=|QScriptValue|uncaughtException|

$prototype=QStringList uncaughtExceptionBacktrace () const
$method=|QStringList|uncaughtExceptionBacktrace|

$prototype=int uncaughtExceptionLineNumber () const
$method=|int|uncaughtExceptionLineNumber|

$prototype=QScriptValue undefinedValue ()
$method=|QScriptValue|undefinedValue|

$prototype=static QScriptSyntaxCheckResult checkSyntax ( const QString & program )
$staticMethod=|QScriptSyntaxCheckResult|checkSyntax|const QString &

$beginSignals
$signalMethod=|signalHandlerException(QScriptValue)
$endSignals

#pragma ENDDUMP

%%
%% Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4
%%
%% Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>
%%

$header

#include "hbclass.ch"

#ifndef QT4XHB_NO_REQUESTS
REQUEST QSCRIPTENGINEAGENT
REQUEST QSCRIPTCONTEXT
REQUEST QSCRIPTVALUE
REQUEST QSCRIPTSTRING
REQUEST QSCRIPTSYNTAXCHECKRESULT
#endif

CLASS QScriptEngine INHERIT QObject

   METHOD new
   METHOD delete
   METHOD abortEvaluation
   METHOD agent
   METHOD availableExtensions
   METHOD clearExceptions
   METHOD collectGarbage
   METHOD currentContext
   METHOD defaultPrototype
   METHOD evaluate
   METHOD globalObject
   METHOD hasUncaughtException
   METHOD importExtension
   METHOD importedExtensions
   METHOD installTranslatorFunctions
   METHOD isEvaluating
   METHOD newArray
   METHOD newRegExp
   METHOD newVariant
   METHOD nullValue
   METHOD popContext
   METHOD processEventsInterval
   METHOD pushContext
   METHOD reportAdditionalMemoryCost
   METHOD setAgent
   METHOD setDefaultPrototype
   METHOD setGlobalObject
   METHOD setProcessEventsInterval
   METHOD toObject
   METHOD toStringHandle
   METHOD uncaughtException
   METHOD uncaughtExceptionBacktrace
   METHOD uncaughtExceptionLineNumber
   METHOD undefinedValue
   METHOD checkSyntax

   METHOD onSignalHandlerException

   DESTRUCTOR destroyObject

END CLASS

$destructor

#pragma BEGINDUMP

$includes

#include <QStringList>

$prototype=QScriptEngine ()
$internalConstructor=|new1|

$prototype=QScriptEngine ( QObject * parent )
$internalConstructor=|new2|QObject *

//[1]QScriptEngine ()
//[2]QScriptEngine ( QObject * parent )

HB_FUNC_STATIC( QSCRIPTENGINE_NEW )
{
  if( ISNUMPAR(0) )
  {
    QScriptEngine_new1();
  }
  else if( ISNUMPAR(1) && ISQOBJECT(1) )
  {
    QScriptEngine_new2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$deleteMethod

$prototype=void abortEvaluation ( const QScriptValue & result = QScriptValue() )
$method=|void|abortEvaluation|const QScriptValue &=QScriptValue()

$prototype=QScriptEngineAgent * agent () const
$method=|QScriptEngineAgent *|agent|

$prototype=QStringList availableExtensions () const
$method=|QStringList|availableExtensions|

$prototype=void clearExceptions ()
$method=|void|clearExceptions|

$prototype=void collectGarbage ()
$method=|void|collectGarbage|

$prototype=QScriptContext * currentContext () const
$method=|QScriptContext *|currentContext|

$prototype=QScriptValue defaultPrototype ( int metaTypeId ) const
$method=|QScriptValue|defaultPrototype|int

$prototype=QScriptValue evaluate ( const QString & program, const QString & fileName = QString(), int lineNumber = 1 )
$internalMethod=|QScriptValue|evaluate,evaluate1|const QString &,const QString &=QString(),int=1

$prototype=QScriptValue evaluate ( const QScriptProgram & program )
$internalMethod=|QScriptValue|evaluate,evaluate2|const QScriptProgram &

//[1]QScriptValue evaluate ( const QString & program, const QString & fileName = QString(), int lineNumber = 1 )
//[2]QScriptValue evaluate ( const QScriptProgram & program )

HB_FUNC_STATIC( QSCRIPTENGINE_EVALUATE )
{
  if( ISBETWEEN(1,3) && ISCHAR(1) && (ISCHAR(2)||ISNIL(2)) && (ISNUM(3)||ISNUM(3)) )
  {
    QScriptEngine_evaluate1();
  }
  else if( ISNUMPAR(1) && ISQSCRIPTPROGRAM(1) )
  {
    QScriptEngine_evaluate2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue globalObject () const
$method=|QScriptValue|globalObject|

$prototype=bool hasUncaughtException () const
$method=|bool|hasUncaughtException|

$prototype=QScriptValue importExtension ( const QString & extension )
$method=|QScriptValue|importExtension|const QString &

$prototype=QStringList importedExtensions () const
$method=|QStringList|importedExtensions|

$prototype=void installTranslatorFunctions ( const QScriptValue & object = QScriptValue() )
$method=|void|installTranslatorFunctions|const QScriptValue &=QScriptValue()

$prototype=bool isEvaluating () const
$method=|bool|isEvaluating|

$prototype=QScriptValue newArray ( uint length = 0 )
$method=|QScriptValue|newArray|uint=0

$prototype=QScriptValue newRegExp ( const QRegExp & regexp )
$internalMethod=|QScriptValue|newRegExp,newRegExp1|const QRegExp &

$prototype=QScriptValue newRegExp ( const QString & pattern, const QString & flags )
$internalMethod=|QScriptValue|newRegExp,newRegExp2|const QString &,const QString &

//[1]QScriptValue newRegExp ( const QRegExp & regexp )
//[2]QScriptValue newRegExp ( const QString & pattern, const QString & flags )

HB_FUNC_STATIC( QSCRIPTENGINE_NEWREGEXP )
{
  if( ISNUMPAR(1) && ISQREGEXP(1) )
  {
    QScriptEngine_newRegExp1();
  }
  else if( ISNUMPAR(2) && ISCHAR(1) && ISCHAR(2) )
  {
    QScriptEngine_newRegExp2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue newVariant ( const QVariant & value )
$internalMethod=|QScriptValue|newVariant,newVariant1|const QVariant &

$prototype=QScriptValue newVariant ( const QScriptValue & object, const QVariant & value )
$internalMethod=|QScriptValue|newVariant,newVariant2|const QScriptValue &,const QVariant &

//[1]QScriptValue newVariant ( const QVariant & value )
//[2]QScriptValue newVariant ( const QScriptValue & object, const QVariant & value )

HB_FUNC_STATIC( QSCRIPTENGINE_NEWVARIANT )
{
  if( ISNUMPAR(1) && ISQVARIANT(1) )
  {
    QScriptEngine_newVariant1();
  }
  else if( ISNUMPAR(2) && ISQSCRIPTVALUE(1) && ISQVARIANT(2) )
  {
    QScriptEngine_newVariant2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

$prototype=QScriptValue nullValue ()
$method=|QScriptValue|nullValue|

$prototype=void popContext ()
$method=|void|popContext|

$prototype=int processEventsInterval () const
$method=|int|processEventsInterval|

$prototype=QScriptContext * pushContext ()
$method=|QScriptContext *|pushContext|

$prototype=void reportAdditionalMemoryCost ( int size )
$method=|void|reportAdditionalMemoryCost|int

$prototype=void setAgent ( QScriptEngineAgent * agent )
$method=|void|setAgent|QScriptEngineAgent *

$prototype=void setDefaultPrototype ( int metaTypeId, const QScriptValue & prototype )
$method=|void|setDefaultPrototype|int,const QScriptValue &

$prototype=void setGlobalObject ( const QScriptValue & object )
$method=|void|setGlobalObject|const QScriptValue &

$prototype=void setProcessEventsInterval ( int interval )
$method=|void|setProcessEventsInterval|int

$prototype=QScriptValue toObject ( const QScriptValue & value )
$method=|QScriptValue|toObject|const QScriptValue &

$prototype=QScriptString toStringHandle ( const QString & str )
$method=|QScriptString|toStringHandle|const QString &

$prototype=QScriptValue uncaughtException () const
$method=|QScriptValue|uncaughtException|

$prototype=QStringList uncaughtExceptionBacktrace () const
$method=|QStringList|uncaughtExceptionBacktrace|

$prototype=int uncaughtExceptionLineNumber () const
$method=|int|uncaughtExceptionLineNumber|

$prototype=QScriptValue undefinedValue ()
$method=|QScriptValue|undefinedValue|

$prototype=static QScriptSyntaxCheckResult checkSyntax ( const QString & program )
$staticMethod=|QScriptSyntaxCheckResult|checkSyntax|const QString &

$connectSignalFunction

$signalMethod=|signalHandlerException(QScriptValue)

#pragma ENDDUMP


QtPositioning: updated to use the macro PBOOL

/*

  Qt5xHb - bibliotecas de ligao entre Harbour/xHarbour e Qt Framework 5

  Copyright (C) 2012-2017 Marcos Antonio Gambeta <marcosgambeta@uol.com.br>

*/

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QGEOSHAPE
REQUEST QDATETIME
#endif

CLASS QGeoAreaMonitorInfo

   DATA pointer
   DATA class_flags INIT 0
   DATA self_destruction INIT .F.

   METHOD new1
   METHOD new2
   METHOD new
   METHOD delete
   METHOD name
   METHOD setName
   METHOD identifier
   METHOD isValid
   METHOD area
   METHOD setArea
   METHOD expiration
   METHOD setExpiration
   METHOD isPersistent
   METHOD setPersistent

   METHOD newFrom
   METHOD newFromObject
   METHOD newFromPointer
   METHOD selfDestruction
   METHOD setSelfDestruction

   DESTRUCTOR destroyObject

END CLASS

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

#pragma BEGINDUMP

#include <Qt>

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

#include "qt5xhb_common.h"
#include "qt5xhb_clsid.h"
#include "qt5xhb_utils.h"

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

#include <QDateTime>

/*
QGeoAreaMonitorInfo(const QString &name = QString())
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_NEW1 )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QString par1 = ISNIL(1)? QString() : QLatin1String( hb_parc(1) );
  QGeoAreaMonitorInfo * o = new QGeoAreaMonitorInfo ( par1 );
  _qt5xhb_storePointerAndFlag( o, true );
#endif
}

/*
QGeoAreaMonitorInfo(const QGeoAreaMonitorInfo &other)
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_NEW2 )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * par1 = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtr(1);
  QGeoAreaMonitorInfo * o = new QGeoAreaMonitorInfo ( *par1 );
  _qt5xhb_storePointerAndFlag( o, true );
#endif
}

//[1]QGeoAreaMonitorInfo(const QString &name = QString())
//[2]QGeoAreaMonitorInfo(const QGeoAreaMonitorInfo &other)

HB_FUNC_STATIC( QGEOAREAMONITORINFO_NEW )
{
  if( ISBETWEEN(0,1) && ISOPTCHAR(1) )
  {
    HB_FUNC_EXEC( QGEOAREAMONITORINFO_NEW1 );
  }
  else if( ISNUMPAR(1) && ISQGEOAREAMONITORINFO(1) )
  {
    HB_FUNC_EXEC( QGEOAREAMONITORINFO_NEW2 );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QGEOAREAMONITORINFO_DELETE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  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
}

/*
QString name() const
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_NAME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retc( (const char *) obj->name (  ).toLatin1().data() );
  }
#endif
}

/*
void setName(const QString &name)
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_SETNAME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    obj->setName ( PQSTRING(1) );
  }
  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
QString identifier() const
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_IDENTIFIER )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retc( (const char *) obj->identifier (  ).toLatin1().data() );
  }
#endif
}

/*
bool isValid() const
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_ISVALID )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retl( obj->isValid (  ) );
  }
#endif
}

/*
QGeoShape area() const
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_AREA )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QGeoShape * ptr = new QGeoShape( obj->area (  ) );
    _qt5xhb_createReturnClass ( ptr, "QGEOSHAPE", true );
  }
#endif
}

/*
void setArea(const QGeoShape &newShape)
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_SETAREA )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QGeoShape * par1 = (QGeoShape *) _qt5xhb_itemGetPtr(1);
    obj->setArea ( *par1 );
  }
  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
QDateTime expiration() const
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_EXPIRATION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QDateTime * ptr = new QDateTime( obj->expiration (  ) );
    _qt5xhb_createReturnClass ( ptr, "QDATETIME", true );
  }
#endif
}

/*
void setExpiration(const QDateTime &expiry)
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_SETEXPIRATION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QDateTime * par1 = (QDateTime *) _qt5xhb_itemGetPtr(1);
    obj->setExpiration ( *par1 );
  }
  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
bool isPersistent() const
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_ISPERSISTENT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retl( obj->isPersistent (  ) );
  }
#endif
}

/*
void setPersistent(bool isPersistent)
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_SETPERSISTENT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    obj->setPersistent ( PBOOL(1) );
  }
  hb_itemReturn( hb_stackSelfItem() );
#endif
}

HB_FUNC_STATIC( QGEOAREAMONITORINFO_NEWFROM )
{
  PHB_ITEM self = hb_stackSelfItem();
  if( hb_pcount() == 1 && ISOBJECT(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else if( hb_pcount() == 1 && ISPOINTER(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_param(1, HB_IT_POINTER ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  hb_itemReturn( self );
}

HB_FUNC_STATIC( QGEOAREAMONITORINFO_NEWFROMOBJECT )
{
  HB_FUNC_EXEC( QGEOAREAMONITORINFO_NEWFROM );
}

HB_FUNC_STATIC( QGEOAREAMONITORINFO_NEWFROMPOINTER )
{
  HB_FUNC_EXEC( QGEOAREAMONITORINFO_NEWFROM );
}

HB_FUNC_STATIC( QGEOAREAMONITORINFO_SELFDESTRUCTION )
{
  hb_retl( (bool) hb_itemGetL( hb_objSendMsg( hb_stackSelfItem(), "SELF_DESTRUCTION", 0 ) ) );
}

HB_FUNC_STATIC( QGEOAREAMONITORINFO_SETSELFDESTRUCTION )
{
  PHB_ITEM self = hb_stackSelfItem();
  if( hb_pcount() == 1 && ISLOG(1) )
  {
    PHB_ITEM des = hb_itemPutL( NULL, hb_parl(1) );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  hb_itemReturn( self );
}

#pragma ENDDUMP

/*

  Qt5xHb - bibliotecas de ligao entre Harbour/xHarbour e Qt Framework 5

  Copyright (C) 2012-2017 Marcos Antonio Gambeta <marcosgambeta@uol.com.br>

*/

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QGEOSHAPE
REQUEST QDATETIME
#endif

CLASS QGeoAreaMonitorInfo

   DATA pointer
   DATA class_flags INIT 0
   DATA self_destruction INIT .F.

   METHOD new1
   METHOD new2
   METHOD new
   METHOD delete
   METHOD name
   METHOD setName
   METHOD identifier
   METHOD isValid
   METHOD area
   METHOD setArea
   METHOD expiration
   METHOD setExpiration
   METHOD isPersistent
   METHOD setPersistent

   METHOD newFrom
   METHOD newFromObject
   METHOD newFromPointer
   METHOD selfDestruction
   METHOD setSelfDestruction

   DESTRUCTOR destroyObject

END CLASS

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

#pragma BEGINDUMP

#include <Qt>

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

#include "qt5xhb_common.h"
#include "qt5xhb_clsid.h"
#include "qt5xhb_utils.h"

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

#include <QDateTime>

/*
QGeoAreaMonitorInfo(const QString &name = QString())
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_NEW1 )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QString par1 = ISNIL(1)? QString() : QLatin1String( hb_parc(1) );
  QGeoAreaMonitorInfo * o = new QGeoAreaMonitorInfo ( par1 );
  _qt5xhb_storePointerAndFlag( o, true );
#endif
}

/*
QGeoAreaMonitorInfo(const QGeoAreaMonitorInfo &other)
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_NEW2 )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * par1 = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtr(1);
  QGeoAreaMonitorInfo * o = new QGeoAreaMonitorInfo ( *par1 );
  _qt5xhb_storePointerAndFlag( o, true );
#endif
}

//[1]QGeoAreaMonitorInfo(const QString &name = QString())
//[2]QGeoAreaMonitorInfo(const QGeoAreaMonitorInfo &other)

HB_FUNC_STATIC( QGEOAREAMONITORINFO_NEW )
{
  if( ISBETWEEN(0,1) && ISOPTCHAR(1) )
  {
    HB_FUNC_EXEC( QGEOAREAMONITORINFO_NEW1 );
  }
  else if( ISNUMPAR(1) && ISQGEOAREAMONITORINFO(1) )
  {
    HB_FUNC_EXEC( QGEOAREAMONITORINFO_NEW2 );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QGEOAREAMONITORINFO_DELETE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  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
}

/*
QString name() const
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_NAME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retc( (const char *) obj->name (  ).toLatin1().data() );
  }
#endif
}

/*
void setName(const QString &name)
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_SETNAME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    obj->setName ( PQSTRING(1) );
  }
  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
QString identifier() const
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_IDENTIFIER )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retc( (const char *) obj->identifier (  ).toLatin1().data() );
  }
#endif
}

/*
bool isValid() const
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_ISVALID )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retl( obj->isValid (  ) );
  }
#endif
}

/*
QGeoShape area() const
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_AREA )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QGeoShape * ptr = new QGeoShape( obj->area (  ) );
    _qt5xhb_createReturnClass ( ptr, "QGEOSHAPE", true );
  }
#endif
}

/*
void setArea(const QGeoShape &newShape)
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_SETAREA )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QGeoShape * par1 = (QGeoShape *) _qt5xhb_itemGetPtr(1);
    obj->setArea ( *par1 );
  }
  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
QDateTime expiration() const
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_EXPIRATION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QDateTime * ptr = new QDateTime( obj->expiration (  ) );
    _qt5xhb_createReturnClass ( ptr, "QDATETIME", true );
  }
#endif
}

/*
void setExpiration(const QDateTime &expiry)
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_SETEXPIRATION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QDateTime * par1 = (QDateTime *) _qt5xhb_itemGetPtr(1);
    obj->setExpiration ( *par1 );
  }
  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
bool isPersistent() const
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_ISPERSISTENT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retl( obj->isPersistent (  ) );
  }
#endif
}

/*
void setPersistent(bool isPersistent)
*/
HB_FUNC_STATIC( QGEOAREAMONITORINFO_SETPERSISTENT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QGeoAreaMonitorInfo * obj = (QGeoAreaMonitorInfo *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    obj->setPersistent ( (bool) hb_parl(1) );
  }
  hb_itemReturn( hb_stackSelfItem() );
#endif
}

HB_FUNC_STATIC( QGEOAREAMONITORINFO_NEWFROM )
{
  PHB_ITEM self = hb_stackSelfItem();
  if( hb_pcount() == 1 && ISOBJECT(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else if( hb_pcount() == 1 && ISPOINTER(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_param(1, HB_IT_POINTER ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  hb_itemReturn( self );
}

HB_FUNC_STATIC( QGEOAREAMONITORINFO_NEWFROMOBJECT )
{
  HB_FUNC_EXEC( QGEOAREAMONITORINFO_NEWFROM );
}

HB_FUNC_STATIC( QGEOAREAMONITORINFO_NEWFROMPOINTER )
{
  HB_FUNC_EXEC( QGEOAREAMONITORINFO_NEWFROM );
}

HB_FUNC_STATIC( QGEOAREAMONITORINFO_SELFDESTRUCTION )
{
  hb_retl( (bool) hb_itemGetL( hb_objSendMsg( hb_stackSelfItem(), "SELF_DESTRUCTION", 0 ) ) );
}

HB_FUNC_STATIC( QGEOAREAMONITORINFO_SETSELFDESTRUCTION )
{
  PHB_ITEM self = hb_stackSelfItem();
  if( hb_pcount() == 1 && ISLOG(1) )
  {
    PHB_ITEM des = hb_itemPutL( NULL, hb_parl(1) );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  hb_itemReturn( self );
}

#pragma ENDDUMP