Closes #79

Closes #79

CLASS DateTimePicker INHERIT TextControl
    HIDDEN _lNoAssign AS LOGIC
    PROTECT lNullFormat       AS LOGIC
    PROTECT cOldFormat        AS STRING
    PROTECT cFormat           AS STRING

	//PP-030828 Strong typing
METHOD __Gather() AS LOGIC STRICT
  //SE-040929 DTS_SHOWNONE Workaround
  LOCAL lReturn AS LOGIC

  _lNoAssign := TRUE
  lReturn := SUPER:__Gather()
  _lNoAssign := FALSE

  RETURN lReturn

METHOD __GetMCColor(dwColorID AS DWORD) AS Color STRICT
	//PP-030828 Strong typing
	LOCAL cr AS LONGINT

	cr := SendMessage(SELF:Handle(), DTM_GETMCCOLOR, dwColorID, 0L)

	RETURN Color{_AND(cr, 0xFF), _AND((cr>>8), 0xFF), _AND((cr>>16), 0xFF)}

METHOD __SetMCColor(oColor AS Color, dwColorID AS DWORD) AS Color STRICT
	//PP-030828 Strong typing

	SendMessage(SELF:Handle(), DTM_SETMCCOLOR, dwColorID, oColor:ColorRef)
	RETURN oColor

ASSIGN __Value(uValue AS USUAL)  STRICT
	//PP-030828 Strong typing
	//SE-040929 DTS_SHOWNONE Workaround

	IF ! _lNoAssign

	   SUPER:__Value := uValue

   	IF IsDate(uValue)
   		SELF:SelectedDate := uValue
   	ELSEIF IsString(uValue)
   		SELF:SelectedTime := uValue
   	ENDIF
   ENDIF
	RETURN

ACCESS DateRange
	LOCAL DIM dates[2] IS _winSYSTEMTIME

	IF (SendMessage(SELF:handle(), DTM_GETRANGE, 0, LONGINT(_CAST, @dates[1])) > 0)
		RETURN DateRange{ConDate(dates[1]:wYear, dates[1]:wMonth, dates[1]:wDay), ConDate(dates[2]:wYear, dates[2]:wMonth, dates[2]:wDay) }
	ENDIF

	RETURN NULL_OBJECT

ASSIGN DateRange(oNewRange)
	LOCAL DIM dates[2] IS _winSYSTEMTIME

	dates[1]:wDay := WORD(Day(oNewRange:Min))
	dates[1]:wMonth := WORD(Month(oNewRange:Min))
	dates[1]:wYear := WORD(Year(oNewRange:Min))

	dates[2]:wDay := WORD(Day(oNewRange:Max))
	dates[2]:wMonth := WORD(Month(oNewRange:Max))
	dates[2]:wYear := WORD(Year(oNewRange:Max))
   // RvdH 090212 This makes sure that every time on the Max-Date is valid
   dates[2]:wHour := 32
   dates[2]:wMinute := 59
   dates[2]:wSecond := 59
   dates[2]:wMilliseconds := 999

	SendMessage(SELF:handle(), DTM_SETRANGE, _OR(GDTR_MIN, GDTR_MAX), LONGINT(_CAST, @dates[1]))

ACCESS Format
    RETURN cFormat

ASSIGN Format(sNewFormat)
    cFormat := sNewFormat
    IF (sNewFormat != "''")
        cOldFormat := sNewFormat
    ENDIF
    SendMessage(SELF:Handle(), DTM_SETFORMAT, 0, LONG(_CAST, String2Psz(sNewFormat)))

	RETURN

CONSTRUCTOR(oOwner, xID, oPoint, oDimension, dwStyle, lDataAware)

	DEFAULT(@lDataAware, TRUE)

	SUPER(oOwner, xID, oPoint, oDimension, "SysDateTimePick32", dwStyle, lDataAware)
	RETURN

ACCESS MCBackgroundColor
	RETURN SELF:__GetMCColor(MCSC_BACKGROUND)

ASSIGN MCBackgroundColor(oColor)
	RETURN SELF:__SetMCColor(oColor, MCSC_BACKGROUND)

ASSIGN MCFont(oNewFont)
	SendMessage(SELF:handle(), DTM_SETMCFONT, DWORD(_CAST, oNewFont:Handle()), LONGINT(_CAST, TRUE))
	RETURN

ACCESS MCMonthBackgroundColor
	RETURN SELF:__GetMCColor(MCSC_MONTHBK)

ASSIGN MCMonthBackgroundColor(oColor)
	RETURN SELF:__SetMCColor(oColor, MCSC_MONTHBK)

ACCESS MCTextColor
	RETURN SELF:__GetMCColor(MCSC_TEXT)

ASSIGN MCTextColor(oColor)
	RETURN SELF:__SetMCColor(oColor, MCSC_TEXT)

ACCESS MCTitleBackgroundColor
	RETURN SELF:__GetMCColor(MCSC_TITLEBK)

ASSIGN MCTitleBackgroundColor(oColor)
	RETURN SELF:__SetMCColor(oColor, MCSC_TITLEBK)

ACCESS MCTitleTextColor
	RETURN SELF:__GetMCColor(MCSC_TITLETEXT)

ASSIGN MCTitleTextColor(oColor)
	RETURN SELF:__SetMCColor(oColor, MCSC_TITLETEXT)

ACCESS MCTrailingTextColor
	RETURN SELF:__GetMCColor(MCSC_TRAILINGTEXT)

ASSIGN MCTrailingTextColor(oColor)
	RETURN SELF:__SetMCColor(oColor, MCSC_TRAILINGTEXT)

ACCESS NullFormat
    RETURN SELF:lNullFormat
METHOD ParentNotify(nCode, lParam)
   //SE-040929 For a correct focus after closing the calender

   IF nCode = DTN_CLOSEUP
      IF GetFocus() != SELF:Handle()
         SetFocus(SELF:Handle())
      ENDIF
      keybd_event(VK_RIGHT, 0, 0, 0)
   ENDIF

   RETURN 0l

METHOD PerformValidations()
LOCAL lSuccess		AS LOGIC
LOCAL uOldValue		AS USUAL

	// DHer: 18/12/2008
	uOldValue := SELF:uValue
	IF _AND(GetWindowLong(SELF:Handle(),GWL_STYLE),DTS_TIMEFORMAT)>0
		SELF:uValue := SELF:SelectedTime
	ELSE
		SELF:uValue := SELF:SelectedDate
	ENDIF
	lSuccess := SUPER:PerformValidations()
	SELF:uValue := uOldValue

RETURN lSuccess

ACCESS SelectedDate
	LOCAL sDate IS _winSYSTEMTIME

	IF (SendMessage(SELF:handle(), DTM_GETSYSTEMTIME, 0, LONGINT(_CAST, @sDate)) == GDT_VALID)
		RETURN ConDate(sDate:wYear, sDate:wMonth, sDate:wDay)
	ENDIF

	RETURN NULL_DATE

ASSIGN SelectedDate(dNewDate)
    // Suggestion from Hkon Clausen
    SELF:SetDateTime(dNewDate, NULL_STRING)
	RETURN

ACCESS SelectedTime
	LOCAL sdate IS _winSYSTEMTIME

	IF (SendMessage(SELF:Handle(), DTM_GETSYSTEMTIME, 0, LONGINT(_CAST, @sDate)) == GDT_VALID)
	    RETURN ConTime(sDate:wHour, sDate:wMinute, sDate:wSecond)
	ENDIF

	RETURN NULL_STRING

ASSIGN SelectedTime(sNewTime)
    // Suggestion from Hkon Clausen
    SELF:SetDateTime(NULL_DATE, sNewTime)
	RETURN

METHOD SetDateTime(dNewDate AS DATE, sNewTime AS STRING) AS VOID STRICT
    // Suggestion from Hkon Clausen and Dirk Herijgers
    LOCAL sDate IS _winSYSTEMTIME
    LOCAL dwFlag AS DWORD

    // if no date or time given. Reset to default values and uncheck
    IF dNewDate == NULL_DATE .AND. SLen(sNewTime) == 0
        // clear the control
        IF SELF:lNullFormat=FALSE
           SELF:cOldFormat := SELF:Format
        ENDIF
        SELF:Format := "''"
        SELF:lNullFormat := TRUE
        dwFlag := GDT_NONE
    ELSE
        SELF:Format := cOldFormat
        SELF:lNullFormat := FALSE
        dwFlag := GDT_VALID
        // get current value from control and set the parts that are given
        SendMessage(SELF:Handle(), DTM_GETSYSTEMTIME, 0, LONG(_CAST, @sDate))
        IF dNewDate != NULL_DATE
            sDate:wDay       := LoWord (dNewDate:Day )
   	        sDate:wMonth     := LoWord (dNewDate:Month )
       	    sDate:wYear      := LoWord (dNewDate:Year )
        ENDIF

        IF SLen(sNewTime) > 0

        	// Start  KHR

        	// make sure that lateron DTM_SETSYSTEMTIME is always called with a valid date part !
		    dNewDate := ConDate(sDate:wYear, sDate:wMonth, sDate:wDay)
		    IF dNewDate == NULL_DATE
	            dNewDate          := Today()
	            sDate:wDay       := LoWord (dNewDate:Day )
	   	        sDate:wMonth     := LoWord (dNewDate:Month )
	       	    sDate:wYear      := LoWord (dNewDate:Year )
        	ENDIF
        	// End KHR

            sDate:wHour      := Val(Left(sNewTime, 2))
            sDate:wMinute    := Val(SubStr3(sNewTime, 4,2))
            sDate:wSecond    := Val(SubStr3(sNewTime, 7,2))

        ENDIF
    ENDIF

    SendMessage(SELF:Handle(), DTM_SETSYSTEMTIME, dwFlag, LONG(_CAST, @sDate))
    RETURN

ACCESS TextValue
	IF (_AND(GetWindowLong(SELF:Handle(), GWL_STYLE), DTS_TIMEFORMAT) > 0)
		RETURN SELF:SelectedTime
	ENDIF
	RETURN AsString(SELF:SelectedDate)

ACCESS Value
	// DHer: 18/12/2008
	IF _AND(GetWindowLong(SELF:Handle(),GWL_STYLE),DTS_TIMEFORMAT)>0
		SELF:uValue := SELF:SelectedTime
	ELSE
		SELF:uValue := SELF:SelectedDate
	ENDIF

RETURN SUPER:Value

END CLASS

CLASS DateTimePicker INHERIT TextControl
    HIDDEN _lNoAssign AS LOGIC
    PROTECT lNullFormat       AS LOGIC
    PROTECT cOldFormat        AS STRING
    PROTECT cFormat           AS STRING

	//PP-030828 Strong typing
METHOD __Gather() AS LOGIC STRICT
  //SE-040929 DTS_SHOWNONE Workaround
  LOCAL lReturn AS LOGIC

  _lNoAssign := TRUE
  lReturn := SUPER:__Gather()
  _lNoAssign := FALSE

  RETURN lReturn

METHOD __GetMCColor(dwColorID AS DWORD) AS Color STRICT
	//PP-030828 Strong typing
	LOCAL cr AS LONGINT

	cr := SendMessage(SELF:Handle(), DTM_GETMCCOLOR, dwColorID, 0L)

	RETURN Color{_AND(cr, 0xFF), _AND((cr>>8), 0xFF), _AND((cr>>16), 0xFF)}

METHOD __SetMCColor(oColor AS Color, dwColorID AS DWORD) AS Color STRICT
	//PP-030828 Strong typing

	SendMessage(SELF:Handle(), DTM_SETMCCOLOR, dwColorID, oColor:ColorRef)
	RETURN oColor

ASSIGN __Value(uValue AS USUAL)  STRICT
	//PP-030828 Strong typing
	//SE-040929 DTS_SHOWNONE Workaround

	IF ! _lNoAssign

	   SUPER:__Value := uValue

   	IF IsDate(uValue)
   		SELF:SelectedDate := uValue
   	ELSEIF IsString(uValue)
   		SELF:SelectedTime := uValue
   	ENDIF
   ENDIF
	RETURN

ACCESS DateRange
	LOCAL DIM dates[2] IS _winSYSTEMTIME

	IF (SendMessage(SELF:handle(), DTM_GETRANGE, 0, LONGINT(_CAST, @dates[1])) > 0)
		RETURN DateRange{ConDate(dates[1]:wYear, dates[1]:wMonth, dates[1]:wDay), ConDate(dates[2]:wYear, dates[2]:wMonth, dates[2]:wDay) }
	ENDIF

	RETURN NULL_OBJECT

ASSIGN DateRange(oNewRange)
	LOCAL DIM dates[2] IS _winSYSTEMTIME

	dates[1]:wDay := WORD(Day(oNewRange:Min))
	dates[1]:wMonth := WORD(Month(oNewRange:Min))
	dates[1]:wYear := WORD(Year(oNewRange:Min))

	dates[2]:wDay := WORD(Day(oNewRange:Max))
	dates[2]:wMonth := WORD(Month(oNewRange:Max))
	dates[2]:wYear := WORD(Year(oNewRange:Max))
   // RvdH 090212 This makes sure that every time on the Max-Date is valid
   dates[2]:wHour := 32
   dates[2]:wMinute := 59
   dates[2]:wSecond := 59
   dates[2]:wMilliseconds := 999

	SendMessage(SELF:handle(), DTM_SETRANGE, _OR(GDTR_MIN, GDTR_MAX), LONGINT(_CAST, @dates[1]))

ACCESS Format
    RETURN cFormat

ASSIGN Format(sNewFormat)
    cFormat := sNewFormat
    IF (sNewFormat != "''")
        cOldFormat := sNewFormat
    ENDIF
    SendMessage(SELF:Handle(), DTM_SETFORMAT, 0, LONG(_CAST, String2Psz(sNewFormat)))

	RETURN

CONSTRUCTOR(oOwner, xID, oPoint, oDimension, dwStyle, lDataAware)

	Default(@lDataAware, TRUE)

	SUPER(oOwner, xID, oPoint, oDimension, "SysDateTimePick32", dwStyle, lDataAware)
	RETURN

ACCESS MCBackgroundColor
	RETURN SELF:__GetMCColor(MCSC_BACKGROUND)

ASSIGN MCBackgroundColor(oColor)
	RETURN SELF:__SetMCColor(oColor, MCSC_BACKGROUND)

ASSIGN MCFont(oNewFont)
	SendMessage(SELF:handle(), DTM_SETMCFONT, DWORD(_CAST, oNewFont:Handle()), LONGINT(_CAST, TRUE))
	RETURN

ACCESS MCMonthBackgroundColor
	RETURN SELF:__GetMCColor(MCSC_MONTHBK)

ASSIGN MCMonthBackgroundColor(oColor)
	RETURN SELF:__SetMCColor(oColor, MCSC_MONTHBK)

ACCESS MCTextColor
	RETURN SELF:__GetMCColor(MCSC_TEXT)

ASSIGN MCTextColor(oColor)
	RETURN SELF:__SetMCColor(oColor, MCSC_TEXT)

ACCESS MCTitleBackgroundColor
	RETURN SELF:__GetMCColor(MCSC_TITLEBK)

ASSIGN MCTitleBackgroundColor(oColor)
	RETURN SELF:__SetMCColor(oColor, MCSC_TITLEBK)

ACCESS MCTitleTextColor
	RETURN SELF:__GetMCColor(MCSC_TITLETEXT)

ASSIGN MCTitleTextColor(oColor)
	RETURN SELF:__SetMCColor(oColor, MCSC_TITLETEXT)

ACCESS MCTrailingTextColor
	RETURN SELF:__GetMCColor(MCSC_TRAILINGTEXT)

ASSIGN MCTrailingTextColor(oColor)
	RETURN SELF:__SetMCColor(oColor, MCSC_TRAILINGTEXT)

ACCESS NullFormat
    RETURN SELF:lNullFormat
METHOD ParentNotify(nCode, lParam)
   //SE-040929 For a correct focus after closing the calender

   IF nCode = DTN_CLOSEUP
      IF GetFocus() != SELF:Handle()
         SetFocus(SELF:Handle())
      ENDIF
      keybd_event(VK_RIGHT, 0, 0, 0)
   ENDIF

   RETURN 0l

METHOD PerformValidations()
LOCAL lSuccess		AS LOGIC
LOCAL uOldValue		AS USUAL

	// DHer: 18/12/2008
	uOldValue := SELF:uValue
	IF _AND(GetWindowLong(SELF:Handle(),GWL_STYLE),DTS_TIMEFORMAT)>0
		SELF:uValue := SELF:SelectedTime
	ELSE
		SELF:uValue := SELF:SelectedDate
	ENDIF
	lSuccess := SUPER:PerformValidations()
	SELF:uValue := uOldValue

RETURN lSuccess

ACCESS SelectedDate
	LOCAL sDate IS _winSYSTEMTIME

	IF (SendMessage(SELF:handle(), DTM_GETSYSTEMTIME, 0, LONGINT(_CAST, @sDate)) == GDT_VALID)
		RETURN ConDate(sDate:wYear, sDate:wMonth, sDate:wDay)
	ENDIF

	RETURN NULL_DATE

ASSIGN SelectedDate(dNewDate)
    // Suggestion from Hkon Clausen
    SELF:SetDateTime(dNewDate, NULL_STRING)
	RETURN

ACCESS SelectedTime
	LOCAL sdate IS _winSYSTEMTIME

	IF (SendMessage(SELF:Handle(), DTM_GETSYSTEMTIME, 0, LONGINT(_CAST, @sDate)) == GDT_VALID)
	    RETURN ConTime(sDate:wHour, sDate:wMinute, sDate:wSecond)
	ENDIF

	RETURN NULL_STRING

ASSIGN SelectedTime(sNewTime)
    // Suggestion from Hkon Clausen
    SELF:SetDateTime(NULL_DATE, sNewTime)
	RETURN
METHOD SetDateTime(dNewDate AS DATE, sNewTime AS STRING) AS VOID STRICT
    // Suggestion from Hkon Clausen and Dirk Herijgers
    LOCAL sDate IS _winSYSTEMTIME
    LOCAL dwFlag AS DWORD

    // if no date or time given. Reset to default values and uncheck
    IF dNewDate == NULL_DATE .AND. SLen(sNewTime) == 0
        // clear the control
        IF SELF:lNullFormat=FALSE
           SELF:cOldFormat := SELF:Format
        ENDIF
        SELF:Format := "''"
        SELF:lNullFormat := TRUE
        dwFlag := GDT_NONE
    ELSE
        SELF:Format := cOldFormat
        SELF:lNullFormat := FALSE
        dwFlag := GDT_VALID
        // get current value from control and set the parts that are given
        SendMessage(SELF:Handle(), DTM_GETSYSTEMTIME, 0, LONG(_CAST, @sDate))
        IF dNewDate != NULL_DATE
            sDate:wDay       := LoWord(Day(dNewDate))
            sDate:wMonth     := LoWord(Month(dNewDate))
            sDate:wYear      := LoWord(Year(dNewDate))
        ENDIF

        IF SLen(sNewTime) > 0
            sDate:wHour      := Val(Left(sNewTime, 2))
            sDate:wMinute    := Val(SubStr(sNewTime, 4,2))
            sDate:wSecond    := Val(SubStr(sNewTime, 7,2))
        ENDIF
    ENDIF

    SendMessage(SELF:Handle(), DTM_SETSYSTEMTIME, dwFlag, LONG(_CAST, @sDate))
    RETURN

ACCESS TextValue
	IF (_AND(GetWindowLong(SELF:Handle(), GWL_STYLE), DTS_TIMEFORMAT) > 0)
		RETURN SELF:SelectedTime
	ENDIF
	RETURN AsString(SELF:SelectedDate)

ACCESS Value
	// DHer: 18/12/2008
	IF _AND(GetWindowLong(SELF:Handle(),GWL_STYLE),DTS_TIMEFORMAT)>0
		SELF:uValue := SELF:SelectedTime
	ELSE
		SELF:uValue := SELF:SelectedDate
	ENDIF

RETURN SUPER:Value

END CLASS


source/QtUiTools: updated

source/QtUiTools: updated

Modified:
source/QtUiTools/QUiLoader.prg

/*

  Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4

  Copyright (C) 2021 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 QT4XHB_NO_REQUESTS
REQUEST QACTION
REQUEST QACTIONGROUP
REQUEST QDIR
REQUEST QLAYOUT
REQUEST QWIDGET
#endif

CLASS QUiLoader INHERIT QObject

   METHOD new
   METHOD delete
   METHOD addPluginPath
   METHOD availableLayouts
   METHOD availableWidgets
   METHOD clearPluginPaths
   METHOD createAction
   METHOD createActionGroup
   METHOD createLayout
   METHOD createWidget
   METHOD isLanguageChangeEnabled
   METHOD load
   METHOD pluginPaths
   METHOD setLanguageChangeEnabled
   METHOD setWorkingDirectory
   METHOD workingDirectory

   DESTRUCTOR destroyObject

END CLASS

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

#pragma BEGINDUMP

#include <QtUiTools/QUiLoader>

#include "qt4xhb_common.h"
#include "qt4xhb_macros.h"
#include "qt4xhb_utils.h"
#include "qt4xhb_events.h"
#include "qt4xhb_signals.h"

#include <QtCore/QStringList>
#include <QtCore/QDir>
#include <QtGui/QAction>
#include <QtGui/QLayout>

/*
QUiLoader( QObject * parent = 0 )
*/
HB_FUNC_STATIC( QUILOADER_NEW )
{
  if( ISBETWEEN( 0, 1 ) && ( ISQOBJECT( 1 ) || ISNIL( 1 ) ) )
  {
    QUiLoader * obj = new QUiLoader( OPQOBJECT( 1, 0 ) );
    Qt4xHb::returnNewObject( obj, false );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QUILOADER_DELETE )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

  if( obj )
  {
    Qt4xHb::Events_disconnect_all_events( obj, true );
    Qt4xHb::Signals_disconnect_all_signals( obj, true );
    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() );
}

/*
void addPluginPath( const QString & path )
*/
HB_FUNC_STATIC( QUILOADER_ADDPLUGINPATH )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

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

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QStringList availableLayouts() const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLELAYOUTS )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR( 0 ) )
    {
#endif
      RQSTRINGLIST( obj->availableLayouts() );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList availableWidgets() const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLEWIDGETS )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR( 0 ) )
    {
#endif
      RQSTRINGLIST( obj->availableWidgets() );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void clearPluginPaths()
*/
HB_FUNC_STATIC( QUILOADER_CLEARPLUGINPATHS )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

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

  hb_itemReturn( hb_stackSelfItem() );
}

/*
virtual QAction * createAction( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTION )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN( 0, 2 ) && ( ISQOBJECT( 1 ) || ISNIL( 1 ) ) && ( ISCHAR( 2 ) || ISNIL( 2 ) ) )
    {
#endif
      QAction * ptr = obj->createAction( OPQOBJECT( 1, 0 ), OPQSTRING( 2, QString() ) );
      Qt4xHb::createReturnQObjectClass( ptr, "QACTION" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
virtual QActionGroup * createActionGroup( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTIONGROUP )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN( 0, 2 ) && ( ISQOBJECT( 1 ) || ISNIL( 1 ) ) && ( ISCHAR( 2 ) || ISNIL( 2 ) ) )
    {
#endif
      QActionGroup * ptr = obj->createActionGroup( OPQOBJECT( 1, 0 ), OPQSTRING( 2, QString() ) );
      Qt4xHb::createReturnQObjectClass( ptr, "QACTIONGROUP" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
virtual QLayout * createLayout( const QString & className, QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATELAYOUT )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN( 1, 3 ) && ISCHAR( 1 ) && ( ISQOBJECT( 2 ) || ISNIL( 2 ) ) && ( ISCHAR( 3 ) || ISNIL( 3 ) ) )
    {
#endif
      QLayout * ptr = obj->createLayout( PQSTRING( 1 ), OPQOBJECT( 2, 0 ), OPQSTRING( 3, QString() ) );
      Qt4xHb::createReturnQObjectClass( ptr, "QLAYOUT" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
virtual QWidget * createWidget( const QString & className, QWidget * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEWIDGET )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN( 1, 3 ) && ISCHAR( 1 ) && ( ISQWIDGET( 2 ) || ISNIL( 2 ) ) && ( ISCHAR( 3 ) || ISNIL( 3 ) ) )
    {
#endif
      QWidget * ptr = obj->createWidget( PQSTRING( 1 ), OPQWIDGET( 2, 0 ), OPQSTRING( 3, QString() ) );
      Qt4xHb::createReturnQWidgetClass( ptr, "QWIDGET" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
bool isLanguageChangeEnabled() const
*/
HB_FUNC_STATIC( QUILOADER_ISLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

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

/*
QWidget * load( QIODevice * device, QWidget * parentWidget = 0 )
*/
HB_FUNC_STATIC( QUILOADER_LOAD )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN( 1, 2 ) && ISQIODEVICE( 1 ) && ( ISQWIDGET( 2 ) || ISNIL( 2 ) ) )
    {
#endif
      QWidget * ptr = obj->load( PQIODEVICE( 1 ), OPQWIDGET( 2, 0 ) );
      Qt4xHb::createReturnQWidgetClass( ptr, "QWIDGET" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList pluginPaths() const
*/
HB_FUNC_STATIC( QUILOADER_PLUGINPATHS )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR( 0 ) )
    {
#endif
      RQSTRINGLIST( obj->pluginPaths() );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void setLanguageChangeEnabled( bool enabled )
*/
HB_FUNC_STATIC( QUILOADER_SETLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR( 1 ) && ISLOG( 1 ) )
    {
#endif
      obj->setLanguageChangeEnabled( PBOOL( 1 ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setWorkingDirectory( const QDir & dir )
*/
HB_FUNC_STATIC( QUILOADER_SETWORKINGDIRECTORY )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR( 1 ) && ISQDIR( 1 ) )
    {
#endif
      obj->setWorkingDirectory( *PQDIR( 1 ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QDir workingDirectory() const
*/
HB_FUNC_STATIC( QUILOADER_WORKINGDIRECTORY )
{
  QUiLoader * obj = static_cast< QUiLoader * >( Qt4xHb::itemGetPtrStackSelfItem() );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR( 0 ) )
    {
#endif
      QDir * ptr = new QDir( obj->workingDirectory() );
      Qt4xHb::createReturnClass( ptr, "QDIR", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

#pragma ENDDUMP

/*

  Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4

  Copyright (C) 2021 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 QT4XHB_NO_REQUESTS
REQUEST QACTION
REQUEST QACTIONGROUP
REQUEST QDIR
REQUEST QLAYOUT
REQUEST QWIDGET
#endif

CLASS QUiLoader INHERIT QObject

   METHOD new
   METHOD delete
   METHOD addPluginPath
   METHOD availableLayouts
   METHOD availableWidgets
   METHOD clearPluginPaths
   METHOD createAction
   METHOD createActionGroup
   METHOD createLayout
   METHOD createWidget
   METHOD isLanguageChangeEnabled
   METHOD load
   METHOD pluginPaths
   METHOD setLanguageChangeEnabled
   METHOD setWorkingDirectory
   METHOD workingDirectory

   DESTRUCTOR destroyObject

END CLASS

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

#pragma BEGINDUMP

#include <QtUiTools/QUiLoader>

#include "qt4xhb_common.h"
#include "qt4xhb_macros.h"
#include "qt4xhb_utils.h"
#include "qt4xhb_events.h"
#include "qt4xhb_signals.h"

#include <QtCore/QStringList>
#include <QtCore/QDir>
#include <QtGui/QAction>
#include <QtGui/QLayout>

/*
QUiLoader( QObject * parent = 0 )
*/
HB_FUNC_STATIC( QUILOADER_NEW )
{
  if( ISBETWEEN( 0, 1 ) && ( ISQOBJECT( 1 ) || ISNIL( 1 ) ) )
  {
    QUiLoader * obj = new QUiLoader( OPQOBJECT( 1, 0 ) );
    Qt4xHb::returnNewObject( obj, false );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QUILOADER_DELETE )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
    Qt4xHb::Events_disconnect_all_events( obj, true );
    Qt4xHb::Signals_disconnect_all_signals( obj, true );
    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() );
}

/*
void addPluginPath( const QString & path )
*/
HB_FUNC_STATIC( QUILOADER_ADDPLUGINPATH )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

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

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QStringList availableLayouts() const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLELAYOUTS )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR( 0 ) )
    {
#endif
      RQSTRINGLIST( obj->availableLayouts() );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList availableWidgets() const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLEWIDGETS )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR( 0 ) )
    {
#endif
      RQSTRINGLIST( obj->availableWidgets() );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void clearPluginPaths()
*/
HB_FUNC_STATIC( QUILOADER_CLEARPLUGINPATHS )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

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

  hb_itemReturn( hb_stackSelfItem() );
}

/*
virtual QAction * createAction( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTION )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN( 0, 2 ) && ( ISQOBJECT( 1 ) || ISNIL( 1 ) ) && ISOPTCHAR( 2 ) )
    {
#endif
      QAction * ptr = obj->createAction( OPQOBJECT( 1, 0 ), OPQSTRING( 2, QString() ) );
      Qt4xHb::createReturnQObjectClass( ptr, "QACTION" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
virtual QActionGroup * createActionGroup( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTIONGROUP )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN( 0, 2 ) && ( ISQOBJECT( 1 ) || ISNIL( 1 ) ) && ISOPTCHAR( 2 ) )
    {
#endif
      QActionGroup * ptr = obj->createActionGroup( OPQOBJECT( 1, 0 ), OPQSTRING( 2, QString() ) );
      Qt4xHb::createReturnQObjectClass( ptr, "QACTIONGROUP" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
virtual QLayout * createLayout( const QString & className, QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATELAYOUT )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN( 1, 3 ) && ISCHAR( 1 ) && ( ISQOBJECT( 2 ) || ISNIL( 2 ) ) && ISOPTCHAR( 3 ) )
    {
#endif
      QLayout * ptr = obj->createLayout( PQSTRING( 1 ), OPQOBJECT( 2, 0 ), OPQSTRING( 3, QString() ) );
      Qt4xHb::createReturnQObjectClass( ptr, "QLAYOUT" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
virtual QWidget * createWidget( const QString & className, QWidget * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEWIDGET )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN( 1, 3 ) && ISCHAR( 1 ) && ( ISQWIDGET( 2 ) || ISNIL( 2 ) ) && ISOPTCHAR( 3 ) )
    {
#endif
      QWidget * ptr = obj->createWidget( PQSTRING( 1 ), OPQWIDGET( 2, 0 ), OPQSTRING( 3, QString() ) );
      Qt4xHb::createReturnQWidgetClass( ptr, "QWIDGET" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
bool isLanguageChangeEnabled() const
*/
HB_FUNC_STATIC( QUILOADER_ISLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

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

/*
QWidget * load( QIODevice * device, QWidget * parentWidget = 0 )
*/
HB_FUNC_STATIC( QUILOADER_LOAD )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN( 1, 2 ) && ISQIODEVICE( 1 ) && ( ISQWIDGET( 2 ) || ISNIL( 2 ) ) )
    {
#endif
      QWidget * ptr = obj->load( PQIODEVICE( 1 ), OPQWIDGET( 2, 0 ) );
      Qt4xHb::createReturnQWidgetClass( ptr, "QWIDGET" );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList pluginPaths() const
*/
HB_FUNC_STATIC( QUILOADER_PLUGINPATHS )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR( 0 ) )
    {
#endif
      RQSTRINGLIST( obj->pluginPaths() );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void setLanguageChangeEnabled( bool enabled )
*/
HB_FUNC_STATIC( QUILOADER_SETLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR( 1 ) && ISLOG( 1 ) )
    {
#endif
      obj->setLanguageChangeEnabled( PBOOL( 1 ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setWorkingDirectory( const QDir & dir )
*/
HB_FUNC_STATIC( QUILOADER_SETWORKINGDIRECTORY )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR( 1 ) && ISQDIR( 1 ) )
    {
#endif
      obj->setWorkingDirectory( *PQDIR( 1 ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QDir workingDirectory() const
*/
HB_FUNC_STATIC( QUILOADER_WORKINGDIRECTORY )
{
  QUiLoader * obj = ( QUiLoader * ) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR( 0 ) )
    {
#endif
      QDir * ptr = new QDir( obj->workingDirectory() );
      Qt4xHb::createReturnClass( ptr, "QDIR", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

#pragma ENDDUMP


[RDD] Added a cast to suppress a compiler warning

//
// 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.Collections
USING System.Collections.Generic
USING System.Diagnostics
USING System.Globalization
USING System.IO
USING System.Reflection
USING System.Text
USING System.Threading
USING XSharp.RDD.Enums
USING XSharp.RDD.Support

BEGIN NAMESPACE XSharp.RDD.NTX

    INTERNAL ENUM ParkingLot
        MEMBER SPACES_SIZE := 1024                              // 1K of token space
        MEMBER GATE_SIZE := 1
        MEMBER LOT_SIZE := SPACES_SIZE + GATE_SIZE              // All elements, including spaces and gate

        MEMBER TOKEN_AREA := 1                                  // parking space tokens
        MEMBER ROOT_GATE := TOKEN_AREA + SPACES_SIZE + 1        // root parking lot gate
        MEMBER ROOT_LOT := ROOT_GATE + GATE_SIZE                // root parking lot
    END ENUM

    INTERNAL PARTIAL SEALED CLASS NtxOrder
        // Methods for NTX Locking

        PRIVATE METHOD _genSeed() AS LONG
            LOCAL dateTime AS DateTime

            dateTime := DateTime{Environment.TickCount}
            RETURN ((dateTime:Hour * 60 + dateTime:Minute) * 60 + dateTime:Second) * 100 + dateTime:Millisecond

        PRIVATE METHOD _lockBytes( nOffset AS DWORD, nLong AS DWORD , retries AS DWORD ) AS LOGIC
            LOCAL isOk AS LOGIC
            LOCAL counter AS DWORD
            isOk := FALSE
            counter := 0
            isOk := SELF:_lockBytes( nOffset, nLong )
            DO WHILE !isOk .AND. counter++ < retries
                isOk := SELF:_lockBytes( nOffset, nLong )
                Thread.Sleep(1)
            ENDDO
            RETURN isOk

        PRIVATE METHOD _lockBytes( nOffset AS DWORD, nLong AS DWORD  ) AS LOGIC
            LOCAL locked AS LOGIC
            TRY
                locked := FFLock( SELF:_hFile, nOffset, nLong )
            CATCH ex AS Exception
                Trace.WriteLine("Lock Error:" + ex:Message)
                locked := FALSE
            END TRY
            RETURN locked

        PRIVATE METHOD _unlockBytes( nOffset AS DWORD, nLong AS DWORD  ) AS LOGIC
            LOCAL unlocked AS LOGIC
            TRY
                unlocked := FFUnLock( SELF:_hFile, nOffset, nLong )
            CATCH ex AS Exception
                Trace.WriteLine("UnLock Error:" + ex:Message)
                unlocked := FALSE
            END TRY
            RETURN unlocked

        PRIVATE METHOD _lockGate( tag AS INT ) AS LOGIC
            LOCAL count AS DWORD
            LOCAL isOk AS LOGIC
            LOCAL liOffSet AS LONG

            count := 0
            isOk := FALSE
            liOffSet := ~ SELF:_getParkLotGate( tag )
            DO WHILE count++ < SELF:_maxLockTries  .AND. !isOk
                isOk := SELF:_lockBytes((DWORD)liOffSet, 1)
            ENDDO
            RETURN isOk

        PRIVATE METHOD _lockInit() AS LOGIC
            LOCAL tries AS LONG
            LOCAL seed AS LONG
            tries := 0
            seed := 0
            SELF:_parkPlace := 0
            seed := SELF:_genSeed()
            DO WHILE tries++ < MAX_TRIES  .AND. SELF:_parkPlace == 0
                IF seed <= 0
                    seed := 1
                ENDIF
                seed := (seed * 1221 + 1) % ParkingLot:LOT_SIZE
                SELF:_parkPlace := seed
                IF !SELF:_lockBytes( (DWORD) ~(SELF:_parkPlace + ParkingLot.TOKEN_AREA), 1)
                    RETURN FALSE
                ENDIF
            ENDDO

            RETURN TRUE

        PRIVATE METHOD _getParkLotPlace( place AS LONG ) AS LONG
            RETURN ParkingLot.ROOT_LOT + ParkingLot:LOT_SIZE * place

        PRIVATE METHOD _getParkLotGate( tagNumber AS LONG ) AS LONG
            RETURN ParkingLot.ROOT_GATE + ParkingLot:LOT_SIZE * tagNumber

        PRIVATE METHOD _lockExit() AS LOGIC
            RETURN SELF:_unlockBytes( (DWORD)~(SELF:_parkPlace + 1), 1)

        PRIVATE METHOD _TryReadLock() AS LOGIC
            LOCAL result AS LOGIC
            LOCAL liOffSet AS LONG

            result := FALSE
            IF _lockGate(SELF:_tagNumber)
                liOffSet := ~(SELF:_getParkLotPlace(SELF:_tagNumber) + SELF:_parkPlace)
                IF !SELF:_lockBytes((DWORD)liOffSet, 1)
                    SELF:_unlockBytes( (DWORD)~SELF:_getParkLotGate( SELF:_tagNumber ), 1)
                    SELF:_lockExit()
                    SELF:_lockInit()
                ELSE
                    SELF:_unlockBytes( (DWORD)~SELF:_getParkLotGate( SELF:_tagNumber ), 1)
                    result := TRUE
                ENDIF
            ENDIF
            RETURN result

        PRIVATE METHOD _tryReadUnLock() AS LOGIC
            LOCAL liOffSet AS LONG
            liOffSet := ~( SELF:_getParkLotPlace(SELF:_tagNumber) + SELF:_parkPlace )
            RETURN SELF:_unlockBytes( (DWORD)liOffSet, 1)

        PRIVATE METHOD _tryWriteUnLock() AS LOGIC
            LOCAL liOffSet AS LONG
            liOffSet := ~( SELF:_getParkLotPlace(SELF:_tagNumber) + ParkingLot.LOT_SIZE )
            RETURN SELF:_unlockBytes( (DWORD)liOffSet, 1)

        PRIVATE METHOD _TryWriteLock() AS LOGIC
            LOCAL liOffSet AS LONG
            LOCAL maxTries AS DWORD
            LOCAL isOk AS LOGIC

            liOffSet := 0
            maxTries := 990
            isOk := FALSE
            IF SELF:_lockGate( SELF:_tagNumber )
                DO WHILE maxTries++ < SELF:_maxLockTries .AND. !isOk
                    liOffSet := ~( SELF:_getParkLotPlace(SELF:_tagNumber) + ParkingLot.LOT_SIZE )
                    isOk := SELF:_lockBytes((DWORD)liOffSet, ParkingLot.LOT_SIZE)
                ENDDO
                IF !isOk
                    SELF:_unlockBytes( (DWORD)~SELF:_getParkLotGate( SELF:_tagNumber ), 1)
                ENDIF
            ENDIF
            RETURN isOk

        PRIVATE METHOD _tryExclLock() AS LOGIC
            RETURN SELF:_lockBytes( (DWORD)SELF:_LockOffset, 1, (DWORD)SELF:_maxLockTries)

        PRIVATE METHOD _tryExclUnlock() AS LOGIC
            RETURN SELF:_unlockBytes( (DWORD)SELF:_LockOffset, 1)

        PRIVATE METHOD _lockForRead() AS LOGIC
            LOCAL locked AS LOGIC

            locked := TRUE
            IF SELF:Shared
                IF !SELF:_HPLocking
                    locked := SELF:_WriteLock()
                ELSE
                    locked := SELF:_ReadLock()
                ENDIF
                IF !locked
                    SELF:_oRdd:_dbfError(Subcodes.ERDD_READ_LOCK, Gencode.EG_LOCK, SELF:FileName)
                    RETURN FALSE
                ENDIF
            ENDIF
            RETURN locked

        PRIVATE METHOD _unLockForRead() AS LOGIC
            LOCAL result AS LOGIC

            result := TRUE
            IF SELF:Shared
                IF !SELF:_HPLocking
                    result := SELF:_WriteUnLock()
                ELSE
                    result := SELF:_ReadUnLock()
                ENDIF
            ENDIF
            RETURN result

        PRIVATE METHOD _ReadLock() AS LOGIC
            LOCAL isOk AS LOGIC

            isOk := TRUE
            Trace.Assert(SELF:_writeLocks == 0, "Attempting read lock while holding write lock")
            IF SELF:_readLocks != 0
                SELF:_readLocks++
            ELSE
                REPEAT
                    isOk := TRUE
                    IF SELF:_HPLocking
                        IF !SELF:_TryReadLock()
                            isOk := FALSE
                        ELSE
                            SELF:_readLocks++
                        ENDIF
                    ELSE
                        IF !SELF:_tryExclLock()
                            isOk := FALSE
                        ELSE
                            SELF:_readLocks++
                        ENDIF
                    ENDIF
                UNTIL isOk
                SELF:_LockStuff()
            ENDIF
            RETURN isOk

        PRIVATE METHOD _ReadUnLock() AS LOGIC
            LOCAL result AS LOGIC

            result := TRUE
            Trace.Assert(SELF:_readLocks != 0, "Attempting read unlock with no pending locks")
            IF SELF:_readLocks != 0
                SELF:_readLocks--
                IF SELF:_readLocks == 0
                    Trace.Assert(!SELF:_Hot, "ntx unlock hot")
                    IF SELF:_HPLocking
                        IF !SELF:_tryReadUnLock()
                            result := FALSE
                        ENDIF
                    ELSE
                        IF !SELF:_tryExclUnlock()
                            result := FALSE
                        ENDIF
                    ENDIF
                ENDIF
            ENDIF
            RETURN result

        PRIVATE METHOD _WriteLock() AS LOGIC
            LOCAL isOk AS LOGIC

            isOk := TRUE
            IF SELF:_writeLocks != 0
                SELF:_writeLocks++
            ELSE
                REPEAT
                    isOk := TRUE
                    IF SELF:_HPLocking
                        IF !SELF:_TryWriteLock()
                            isOk := FALSE
                        ELSE
                            SELF:_writeLocks++
                        ENDIF
                    ELSE
                        IF !SELF:_tryExclLock()
                            isOk := FALSE
                        ELSE
                            SELF:_writeLocks++
                        ENDIF
                    ENDIF
                UNTIL isOk
                SELF:_LockStuff()
            ENDIF
            RETURN isOk

        PRIVATE METHOD _WriteUnLock() AS LOGIC
            LOCAL isOk AS LOGIC

            isOk := TRUE
            IF SELF:_writeLocks != 0
                SELF:_writeLocks--
                IF SELF:_writeLocks == 0
                    IF SELF:_HPLocking
                        IF !SELF:_tryWriteUnLock()
                            isOk := FALSE
                        ENDIF
                    ELSE
                        IF !SELF:_tryExclUnlock()
                            isOk := FALSE
                        ENDIF
                    ENDIF
                ENDIF
            ENDIF
            RETURN isOk

        PRIVATE METHOD _LockStuff() AS VOID
            IF SELF:_getHeader()
                SELF:_PageList:Flush(FALSE)

                FSeek3( SELF:_hFile, 0, FS_END )
                SELF:_fileSize  := (LONG) FTell( SELF:_hFile )
                SELF:ClearStack()
            ENDIF

        PRIVATE METHOD _getHeader() AS LOGIC
            LOCAL changed AS LOGIC

            changed := TRUE
            IF SELF:_Header:Read()
                changed := (SELF:_indexVersion != SELF:_Header:IndexingVersion)
                SELF:_indexVersion := SELF:_Header:IndexingVersion
                SELF:_firstPageOffset := SELF:_Header:FirstPageOffset
                SELF:_nextUnusedPageOffset := SELF:_Header:NextUnusedPageOffset
            ENDIF
            RETURN changed
    END CLASS

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.Collections
USING System.Collections.Generic
USING System.Diagnostics
USING System.Globalization
USING System.IO
USING System.Reflection
USING System.Text
USING System.Threading
USING XSharp.RDD.Enums
USING XSharp.RDD.Support

BEGIN NAMESPACE XSharp.RDD.NTX

    INTERNAL ENUM ParkingLot
        MEMBER SPACES_SIZE := 1024                              // 1K of token space
        MEMBER GATE_SIZE := 1
        MEMBER LOT_SIZE := SPACES_SIZE + GATE_SIZE              // All elements, including spaces and gate

        MEMBER TOKEN_AREA := 1                                  // parking space tokens
        MEMBER ROOT_GATE := TOKEN_AREA + SPACES_SIZE + 1        // root parking lot gate
        MEMBER ROOT_LOT := ROOT_GATE + GATE_SIZE                // root parking lot
    END ENUM

    INTERNAL PARTIAL SEALED CLASS NtxOrder
        // Methods for NTX Locking

        PRIVATE METHOD _genSeed() AS LONG
            LOCAL dateTime AS DateTime

            dateTime := DateTime{Environment.TickCount}
            RETURN ((dateTime:Hour * 60 + dateTime:Minute) * 60 + dateTime:Second) * 100 + dateTime:Millisecond

        PRIVATE METHOD _lockBytes( nOffset AS DWORD, nLong AS DWORD , retries AS DWORD ) AS LOGIC
            LOCAL isOk AS LOGIC
            LOCAL counter AS DWORD
            isOk := FALSE
            counter := 0
            isOk := SELF:_lockBytes( nOffset, nLong )
            DO WHILE !isOk .AND. counter++ < retries
                isOk := SELF:_lockBytes( nOffset, nLong )
                Thread.Sleep(1)
            ENDDO
            RETURN isOk

        PRIVATE METHOD _lockBytes( nOffset AS DWORD, nLong AS DWORD  ) AS LOGIC
            LOCAL locked AS LOGIC
            TRY
                locked := FFLock( SELF:_hFile, nOffset, nLong )
            CATCH ex AS Exception
                Trace.WriteLine("Lock Error:" + ex:Message)
                locked := FALSE
            END TRY
            RETURN locked

        PRIVATE METHOD _unlockBytes( nOffset AS DWORD, nLong AS DWORD  ) AS LOGIC
            LOCAL unlocked AS LOGIC
            TRY
                unlocked := FFUnLock( SELF:_hFile, nOffset, nLong )
            CATCH ex AS Exception
                Trace.WriteLine("UnLock Error:" + ex:Message)
                unlocked := FALSE
            END TRY
            RETURN unlocked

        PRIVATE METHOD _lockGate( tag AS INT ) AS LOGIC
            LOCAL count AS DWORD
            LOCAL isOk AS LOGIC
            LOCAL liOffSet AS LONG

            count := 0
            isOk := FALSE
            liOffSet := ~ SELF:_getParkLotGate( tag )
            DO WHILE count++ < SELF:_maxLockTries  .AND. !isOk
                isOk := SELF:_lockBytes((DWORD)liOffSet, 1)
            ENDDO
            RETURN isOk

        PRIVATE METHOD _lockInit() AS LOGIC
            LOCAL tries AS LONG
            LOCAL seed AS LONG
            tries := 0
            seed := 0
            SELF:_parkPlace := 0
            seed := SELF:_genSeed()
            DO WHILE tries++ < MAX_TRIES  .AND. SELF:_parkPlace == 0
                IF seed <= 0
                    seed := 1
                ENDIF
                seed := (seed * 1221 + 1) % ParkingLot:LOT_SIZE
                SELF:_parkPlace := seed
                IF !SELF:_lockBytes( ~(SELF:_parkPlace + ParkingLot.TOKEN_AREA), 1)
                    RETURN FALSE
                ENDIF
            ENDDO

            RETURN TRUE

        PRIVATE METHOD _getParkLotPlace( place AS LONG ) AS LONG
            RETURN ParkingLot.ROOT_LOT + ParkingLot:LOT_SIZE * place

        PRIVATE METHOD _getParkLotGate( tagNumber AS LONG ) AS LONG
            RETURN ParkingLot.ROOT_GATE + ParkingLot:LOT_SIZE * tagNumber

        PRIVATE METHOD _lockExit() AS LOGIC
            RETURN SELF:_unlockBytes( (DWORD)~(SELF:_parkPlace + 1), 1)

        PRIVATE METHOD _TryReadLock() AS LOGIC
            LOCAL result AS LOGIC
            LOCAL liOffSet AS LONG

            result := FALSE
            IF _lockGate(SELF:_tagNumber)
                liOffSet := ~(SELF:_getParkLotPlace(SELF:_tagNumber) + SELF:_parkPlace)
                IF !SELF:_lockBytes((DWORD)liOffSet, 1)
                    SELF:_unlockBytes( (DWORD)~SELF:_getParkLotGate( SELF:_tagNumber ), 1)
                    SELF:_lockExit()
                    SELF:_lockInit()
                ELSE
                    SELF:_unlockBytes( (DWORD)~SELF:_getParkLotGate( SELF:_tagNumber ), 1)
                    result := TRUE
                ENDIF
            ENDIF
            RETURN result

        PRIVATE METHOD _tryReadUnLock() AS LOGIC
            LOCAL liOffSet AS LONG
            liOffSet := ~( SELF:_getParkLotPlace(SELF:_tagNumber) + SELF:_parkPlace )
            RETURN SELF:_unlockBytes( (DWORD)liOffSet, 1)

        PRIVATE METHOD _tryWriteUnLock() AS LOGIC
            LOCAL liOffSet AS LONG
            liOffSet := ~( SELF:_getParkLotPlace(SELF:_tagNumber) + ParkingLot.LOT_SIZE )
            RETURN SELF:_unlockBytes( (DWORD)liOffSet, 1)

        PRIVATE METHOD _TryWriteLock() AS LOGIC
            LOCAL liOffSet AS LONG
            LOCAL maxTries AS DWORD
            LOCAL isOk AS LOGIC

            liOffSet := 0
            maxTries := 990
            isOk := FALSE
            IF SELF:_lockGate( SELF:_tagNumber )
                DO WHILE maxTries++ < SELF:_maxLockTries .AND. !isOk
                    liOffSet := ~( SELF:_getParkLotPlace(SELF:_tagNumber) + ParkingLot.LOT_SIZE )
                    isOk := SELF:_lockBytes((DWORD)liOffSet, ParkingLot.LOT_SIZE)
                ENDDO
                IF !isOk
                    SELF:_unlockBytes( (DWORD)~SELF:_getParkLotGate( SELF:_tagNumber ), 1)
                ENDIF
            ENDIF
            RETURN isOk

        PRIVATE METHOD _tryExclLock() AS LOGIC
            RETURN SELF:_lockBytes( (DWORD)SELF:_LockOffset, 1, (DWORD)SELF:_maxLockTries)

        PRIVATE METHOD _tryExclUnlock() AS LOGIC
            RETURN SELF:_unlockBytes( (DWORD)SELF:_LockOffset, 1)

        PRIVATE METHOD _lockForRead() AS LOGIC
            LOCAL locked AS LOGIC

            locked := TRUE
            IF SELF:Shared
                IF !SELF:_HPLocking
                    locked := SELF:_WriteLock()
                ELSE
                    locked := SELF:_ReadLock()
                ENDIF
                IF !locked
                    SELF:_oRdd:_dbfError(Subcodes.ERDD_READ_LOCK, Gencode.EG_LOCK, SELF:FileName)
                    RETURN FALSE
                ENDIF
            ENDIF
            RETURN locked

        PRIVATE METHOD _unLockForRead() AS LOGIC
            LOCAL result AS LOGIC

            result := TRUE
            IF SELF:Shared
                IF !SELF:_HPLocking
                    result := SELF:_WriteUnLock()
                ELSE
                    result := SELF:_ReadUnLock()
                ENDIF
            ENDIF
            RETURN result

        PRIVATE METHOD _ReadLock() AS LOGIC
            LOCAL isOk AS LOGIC

            isOk := TRUE
            Trace.Assert(SELF:_writeLocks == 0, "Attempting read lock while holding write lock")
            IF SELF:_readLocks != 0
                SELF:_readLocks++
            ELSE
                REPEAT
                    isOk := TRUE
                    IF SELF:_HPLocking
                        IF !SELF:_TryReadLock()
                            isOk := FALSE
                        ELSE
                            SELF:_readLocks++
                        ENDIF
                    ELSE
                        IF !SELF:_tryExclLock()
                            isOk := FALSE
                        ELSE
                            SELF:_readLocks++
                        ENDIF
                    ENDIF
                UNTIL isOk
                SELF:_LockStuff()
            ENDIF
            RETURN isOk

        PRIVATE METHOD _ReadUnLock() AS LOGIC
            LOCAL result AS LOGIC

            result := TRUE
            Trace.Assert(SELF:_readLocks != 0, "Attempting read unlock with no pending locks")
            IF SELF:_readLocks != 0
                SELF:_readLocks--
                IF SELF:_readLocks == 0
                    Trace.Assert(!SELF:_Hot, "ntx unlock hot")
                    IF SELF:_HPLocking
                        IF !SELF:_tryReadUnLock()
                            result := FALSE
                        ENDIF
                    ELSE
                        IF !SELF:_tryExclUnlock()
                            result := FALSE
                        ENDIF
                    ENDIF
                ENDIF
            ENDIF
            RETURN result

        PRIVATE METHOD _WriteLock() AS LOGIC
            LOCAL isOk AS LOGIC

            isOk := TRUE
            IF SELF:_writeLocks != 0
                SELF:_writeLocks++
            ELSE
                REPEAT
                    isOk := TRUE
                    IF SELF:_HPLocking
                        IF !SELF:_TryWriteLock()
                            isOk := FALSE
                        ELSE
                            SELF:_writeLocks++
                        ENDIF
                    ELSE
                        IF !SELF:_tryExclLock()
                            isOk := FALSE
                        ELSE
                            SELF:_writeLocks++
                        ENDIF
                    ENDIF
                UNTIL isOk
                SELF:_LockStuff()
            ENDIF
            RETURN isOk

        PRIVATE METHOD _WriteUnLock() AS LOGIC
            LOCAL isOk AS LOGIC

            isOk := TRUE
            IF SELF:_writeLocks != 0
                SELF:_writeLocks--
                IF SELF:_writeLocks == 0
                    IF SELF:_HPLocking
                        IF !SELF:_tryWriteUnLock()
                            isOk := FALSE
                        ENDIF
                    ELSE
                        IF !SELF:_tryExclUnlock()
                            isOk := FALSE
                        ENDIF
                    ENDIF
                ENDIF
            ENDIF
            RETURN isOk

        PRIVATE METHOD _LockStuff() AS VOID
            IF SELF:_getHeader()
                SELF:_PageList:Flush(FALSE)

                FSeek3( SELF:_hFile, 0, FS_END )
                SELF:_fileSize  := (LONG) FTell( SELF:_hFile )
                SELF:ClearStack()
            ENDIF

        PRIVATE METHOD _getHeader() AS LOGIC
            LOCAL changed AS LOGIC

            changed := TRUE
            IF SELF:_Header:Read()
                changed := (SELF:_indexVersion != SELF:_Header:IndexingVersion)
                SELF:_indexVersion := SELF:_Header:IndexingVersion
                SELF:_firstPageOffset := SELF:_Header:FirstPageOffset
                SELF:_nextUnusedPageOffset := SELF:_Header:NextUnusedPageOffset
            ENDIF
            RETURN changed
    END CLASS

END NAMESPACE