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

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

#include "phpnewclassdlgbase.h"

#include <ntqvariant.h>
#include <kdialog.h>
#include <klineedit.h>
#include <ntqlabel.h>
#include <ntqpushbutton.h>
#include <ntqtoolbutton.h>
#include <ntqtextedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a PHPNewClassDlgBase 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.
 */
PHPNewClassDlgBase::PHPNewClassDlgBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "m_ClassDLG" );
    m_ClassDLGLayout = new TQGridLayout( this, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "m_ClassDLGLayout"); 

    TextLabel1 = new TQLabel( this, "TextLabel1" );

    m_ClassDLGLayout->addWidget( TextLabel1, 0, 0 );
    Spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    m_ClassDLGLayout->addMultiCell( Spacer1, 5, 5, 0, 2 );

    m_okButton = new TQPushButton( this, "m_okButton" );
    m_okButton->setDefault( true );

    m_ClassDLGLayout->addMultiCellWidget( m_okButton, 5, 5, 3, 4 );

    m_cancelButton = new TQPushButton( this, "m_cancelButton" );

    m_ClassDLGLayout->addMultiCellWidget( m_cancelButton, 5, 5, 5, 6 );

    m_baseClassEdit = new KLineEdit( this, "m_baseClassEdit" );

    m_ClassDLGLayout->addMultiCellWidget( m_baseClassEdit, 0, 0, 4, 6 );

    m_classNameEdit = new KLineEdit( this, "m_classNameEdit" );

    m_ClassDLGLayout->addWidget( m_classNameEdit, 0, 1 );

    TextLabel2 = new TQLabel( this, "TextLabel2" );

    m_ClassDLGLayout->addMultiCellWidget( TextLabel2, 0, 0, 2, 3 );

    TextLabel4 = new TQLabel( this, "TextLabel4" );

    m_ClassDLGLayout->addMultiCellWidget( TextLabel4, 3, 3, 0, 2 );

    TextLabel1_2 = new TQLabel( this, "TextLabel1_2" );

    m_ClassDLGLayout->addWidget( TextLabel1_2, 2, 0 );

    TextLabel3 = new TQLabel( this, "TextLabel3" );

    m_ClassDLGLayout->addWidget( TextLabel3, 1, 0 );

    m_dirButton = new TQToolButton( this, "m_dirButton" );
    m_dirButton->setFocusPolicy( TQToolButton::TabFocus );

    m_ClassDLGLayout->addWidget( m_dirButton, 2, 6 );

    m_fileNameEdit = new KLineEdit( this, "m_fileNameEdit" );

    m_ClassDLGLayout->addWidget( m_fileNameEdit, 1, 1 );

    m_dirEdit = new KLineEdit( this, "m_dirEdit" );

    m_ClassDLGLayout->addMultiCellWidget( m_dirEdit, 2, 2, 1, 5 );

    m_classTemplate = new TQTextEdit( this, "m_classTemplate" );

    m_ClassDLGLayout->addMultiCellWidget( m_classTemplate, 4, 4, 0, 6 );
    languageChange();
    resize( TQSize(439, 386).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_okButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( m_cancelButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );

    // tab order
    setTabOrder( m_classNameEdit, m_baseClassEdit );
    setTabOrder( m_baseClassEdit, m_fileNameEdit );
    setTabOrder( m_fileNameEdit, m_dirEdit );
    setTabOrder( m_dirEdit, m_dirButton );
    setTabOrder( m_dirButton, m_classTemplate );
    setTabOrder( m_classTemplate, m_okButton );
    setTabOrder( m_okButton, m_cancelButton );

    // buddies
    TextLabel1->setBuddy( m_classNameEdit );
    TextLabel2->setBuddy( m_baseClassEdit );
    TextLabel4->setBuddy( m_classTemplate );
    TextLabel1_2->setBuddy( m_dirEdit );
    TextLabel3->setBuddy( m_fileNameEdit );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void PHPNewClassDlgBase::languageChange()
{
    setCaption( tr2i18n( "New Class" ) );
    TextLabel1->setText( tr2i18n( "Class &name:" ) );
    m_okButton->setText( tr2i18n( "&OK" ) );
    m_cancelButton->setText( tr2i18n( "&Cancel" ) );
    TextLabel2->setText( tr2i18n( "&Base class:" ) );
    TextLabel4->setText( tr2i18n( "Class &template:" ) );
    TextLabel1_2->setText( tr2i18n( "&Directory:" ) );
    TextLabel3->setText( tr2i18n( "&File name:" ) );
    m_dirButton->setText( tr2i18n( "..." ) );
    m_classTemplate->setText( tr2i18n( "<?php\n"
"if (!defined(\"FILENAME\")){\n"
"define(\"FILENAME\",0);\n"
"/*\n"
"* @author AUTHOR\n"
"*/\n"
"\n"
"class CLASSNAME extends BASECLASS {\n"
"  //constructor\n"
"  function CLASSNAME(){\n"
"   BASECLASS::BASECLASS();\n"
"  }\n"
" }\n"
"}\n"
"?>" ) );
}

/****************************************************************************
** PHPNewClassDlgBase meta object code from reading C++ file 'phpnewclassdlgbase.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 "phpnewclassdlgbase.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 *PHPNewClassDlgBase::className() const
{
    return "PHPNewClassDlgBase";
}

TQMetaObject *PHPNewClassDlgBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_PHPNewClassDlgBase( "PHPNewClassDlgBase", &PHPNewClassDlgBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* PHPNewClassDlgBase::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 TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"PHPNewClassDlgBase", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_PHPNewClassDlgBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool PHPNewClassDlgBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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