#include <kdialog.h>
#include <tdelocale.h>

/****************************************************************************
** Form implementation generated from reading ui file 'newform.ui'
**
** Created by: The TQt user interface compiler (TQt 3.5.0)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "newform.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqiconview.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a NewFormBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
NewFormBase::NewFormBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "NewFormBase" );
    setSizeGripEnabled( true );
    NewFormBaseLayout = new TQGridLayout( this, 1, 1, 11, 6, "NewFormBaseLayout"); 

    Layout1 = new TQHBoxLayout( 0, 0, 6, "Layout1"); 

    helpButton = new TQPushButton( this, "helpButton" );
    helpButton->setAutoDefault( true );
    Layout1->addWidget( helpButton );
    Horizontal_Spacing2 = new TQSpacerItem( 20, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout1->addItem( Horizontal_Spacing2 );

    buttonOk = new TQPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( true );
    buttonOk->setDefault( true );
    Layout1->addWidget( buttonOk );

    buttonCancel = new TQPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( true );
    Layout1->addWidget( buttonCancel );

    NewFormBaseLayout->addMultiCellLayout( Layout1, 2, 2, 0, 2 );

    templateView = new TQIconView( this, "templateView" );
    templateView->setGridX( 120 );
    templateView->setResizeMode( TQIconView::Adjust );
    templateView->setItemsMovable( false );
    templateView->setWordWrapIconText( true );

    NewFormBaseLayout->addMultiCellWidget( templateView, 1, 1, 0, 2 );
    Spacer2 = new TQSpacerItem( 20, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    NewFormBaseLayout->addItem( Spacer2, 0, 2 );
    languageChange();
    resize( TQSize(557, 436).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( buttonCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( templateView, TQ_SIGNAL( currentChanged(TQIconViewItem*) ), this, TQ_SLOT( itemChanged(TQIconViewItem*) ) );
    connect( templateView, TQ_SIGNAL( doubleClicked(TQIconViewItem*) ), this, TQ_SLOT( accept() ) );
    connect( templateView, TQ_SIGNAL( returnPressed(TQIconViewItem*) ), this, TQ_SLOT( accept() ) );

    // tab order
    setTabOrder( templateView, helpButton );
    setTabOrder( helpButton, buttonOk );
    setTabOrder( buttonOk, buttonCancel );
}

/*
 *  Destroys the object and frees any allocated resources
 */
NewFormBase::~NewFormBase()
{
    // no need to delete child widgets, TQt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void NewFormBase::languageChange()
{
    setCaption( tr2i18n( "New File" ) );
    TQWhatsThis::add( this, tr2i18n( "<b>New Form</b><p>Select a template for the new form and click the <b>OK</b>-button to create it.</p>" ) );
    helpButton->setText( tr2i18n( "&Help" ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    TQWhatsThis::add( buttonOk, tr2i18n( "Create a new form using the selected template." ) );
    buttonCancel->setText( tr2i18n( "&Cancel" ) );
    TQWhatsThis::add( buttonCancel, tr2i18n( "Close the dialog without creating a new form." ) );
    TQWhatsThis::add( templateView, tr2i18n( "Displays a list of the available templates." ) );
}

void NewFormBase::itemChanged(TQIconViewItem*)
{
    tqWarning( "NewFormBase::itemChanged(TQIconViewItem*): Not implemented yet" );
}

void NewFormBase::projectChanged(const TQString&)
{
    tqWarning( "NewFormBase::projectChanged(const TQString&): Not implemented yet" );
}

/****************************************************************************
** NewFormBase meta object code from reading C++ file 'newform.h'
**
** Created by: The TQt Meta Object Compiler version 26 (TQt 3.5.0)
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#undef TQT_NO_COMPAT
#include "newform.h"
#include <ntqmetaobject.h>
#include <ntqapplication.h>

#include <private/qucomextra_p.h>
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
#error "This file was generated using the moc from 3.5.0. It"
#error "cannot be used with the include files from this version of TQt."
#error "(The moc has changed too much.)"
#endif

const char *NewFormBase::className() const
{
    return "NewFormBase";
}

TQMetaObject *NewFormBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_NewFormBase( "NewFormBase", &NewFormBase::staticMetaObject );

#ifndef TQT_NO_TRANSLATION
TQString NewFormBase::tr( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "NewFormBase", s, c, TQApplication::DefaultCodec );
    else
	return TQString::fromLatin1( s );
}
#ifndef TQT_NO_TRANSLATION_UTF8
TQString NewFormBase::trUtf8( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "NewFormBase", s, c, TQApplication::UnicodeUTF8 );
    else
	return TQString::fromUtf8( s );
}
#endif // TQT_NO_TRANSLATION_UTF8

#endif // TQT_NO_TRANSLATION

TQMetaObject* NewFormBase::staticMetaObject()
{
    if ( metaObj ) {
	return metaObj;
}
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();
    if ( metaObj ) {
	if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
	return metaObj;
    }
#endif // TQT_THREAD_SUPPORT
    TQMetaObject* parentObject = TQDialog::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQUParameter param_slot_1[] = {
	{ 0, &static_QUType_ptr, "TQIconViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"itemChanged", 1, param_slot_1 };
    static const TQUParameter param_slot_2[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_2 = {"projectChanged", 1, param_slot_2 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "itemChanged(TQIconViewItem*)", &slot_1, TQMetaData::Protected },
	{ "projectChanged(const TQString&)", &slot_2, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"NewFormBase", parentObject,
	slot_tbl, 3,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_NewFormBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

void* NewFormBase::tqt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "NewFormBase" ) )
	return this;
    return TQDialog::tqt_cast( clname );
}

bool NewFormBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: itemChanged((TQIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 2: projectChanged((const TQString&)static_QUType_TQString.get(_o+1)); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

bool NewFormBase::tqt_emit( int _id, TQUObject* _o )
{
    return TQDialog::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

bool NewFormBase::tqt_property( int id, int f, TQVariant* v)
{
    return TQDialog::tqt_property( id, f, v);
}

bool NewFormBase::tqt_static_property( TQObject* , int , int , TQVariant* ){ return false; }
#endif // TQT_NO_PROPERTIES
