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

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

#include "creategettersetter.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a CreateGetterSetterDialogBase 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.
 */
CreateGetterSetterDialogBase::CreateGetterSetterDialogBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "CreateGetterSetterDialogBase" );
    setModal( true );
    CreateGetterSetterDialogBaseLayout = new TQGridLayout( this, 1, 1, 11, 6, "CreateGetterSetterDialogBaseLayout"); 
    spacer1 = new TQSpacerItem( 61, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    CreateGetterSetterDialogBaseLayout->addItem( spacer1, 2, 1 );

    m_chkInlineGet = new TQCheckBox( this, "m_chkInlineGet" );
    m_chkInlineGet->setChecked( true );

    CreateGetterSetterDialogBaseLayout->addWidget( m_chkInlineGet, 0, 5 );

    m_chkGet = new TQCheckBox( this, "m_chkGet" );
    m_chkGet->setChecked( true );

    CreateGetterSetterDialogBaseLayout->addWidget( m_chkGet, 0, 0 );

    m_chkSet = new TQCheckBox( this, "m_chkSet" );
    m_chkSet->setChecked( true );

    CreateGetterSetterDialogBaseLayout->addWidget( m_chkSet, 1, 0 );

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

    CreateGetterSetterDialogBaseLayout->addMultiCellWidget( m_edtGet, 0, 0, 1, 4 );

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

    CreateGetterSetterDialogBaseLayout->addMultiCellWidget( m_edtSet, 1, 1, 1, 4 );

    m_chkInlineSet = new TQCheckBox( this, "m_chkInlineSet" );
    m_chkInlineSet->setChecked( true );

    CreateGetterSetterDialogBaseLayout->addWidget( m_chkInlineSet, 1, 5 );
    spacer2 = new TQSpacerItem( 21, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    CreateGetterSetterDialogBaseLayout->addItem( spacer2, 2, 2 );

    m_btnCancel = new KPushButton( this, "m_btnCancel" );

    CreateGetterSetterDialogBaseLayout->addMultiCellWidget( m_btnCancel, 2, 2, 4, 5 );

    m_btnOk = new KPushButton( this, "m_btnOk" );

    CreateGetterSetterDialogBaseLayout->addWidget( m_btnOk, 2, 3 );
    languageChange();
    resize( TQSize(428, 105).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_chkGet, TQ_SIGNAL( toggled(bool) ), m_edtGet, TQ_SLOT( setEnabled(bool) ) );
    connect( m_chkSet, TQ_SIGNAL( toggled(bool) ), m_edtSet, TQ_SLOT( setEnabled(bool) ) );
    connect( m_btnOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( m_btnCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( m_chkGet, TQ_SIGNAL( toggled(bool) ), m_chkInlineGet, TQ_SLOT( setEnabled(bool) ) );
    connect( m_chkSet, TQ_SIGNAL( toggled(bool) ), m_chkInlineSet, TQ_SLOT( setEnabled(bool) ) );
    connect( m_chkInlineGet, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( slotInlineChanged() ) );
    connect( m_chkInlineSet, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( slotInlineChanged() ) );

    // tab order
    setTabOrder( m_chkGet, m_edtGet );
    setTabOrder( m_edtGet, m_chkSet );
    setTabOrder( m_chkSet, m_edtSet );
    setTabOrder( m_edtSet, m_btnCancel );
    setTabOrder( m_btnCancel, m_btnOk );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void CreateGetterSetterDialogBase::languageChange()
{
    m_chkInlineGet->setText( tr2i18n( "&inline" ) );
    TQToolTip::add( m_chkInlineGet, tr2i18n( "create an inline get method" ) );
    TQWhatsThis::add( m_chkInlineGet, tr2i18n( "If this is checked the get method will be created inline; otherwise, it will not." ) );
    m_chkGet->setText( tr2i18n( "&get method" ) );
    TQToolTip::add( m_chkGet, tr2i18n( "create get method" ) );
    TQWhatsThis::add( m_chkGet, tr2i18n( "If this is checked a getter method will be created." ) );
    m_chkSet->setText( tr2i18n( "&set method" ) );
    TQToolTip::add( m_chkSet, tr2i18n( "create set method" ) );
    TQWhatsThis::add( m_chkSet, tr2i18n( "If this is checked a set method will be created" ) );
    TQToolTip::add( m_edtGet, tr2i18n( "name of the get method" ) );
    TQWhatsThis::add( m_edtGet, tr2i18n( "The name of the created get method" ) );
    TQToolTip::add( m_edtSet, tr2i18n( "name of the set method" ) );
    TQWhatsThis::add( m_edtSet, tr2i18n( "The name of the created set method" ) );
    m_chkInlineSet->setText( tr2i18n( "i&nline" ) );
    TQToolTip::add( m_chkInlineSet, tr2i18n( "create an inline set method" ) );
    TQWhatsThis::add( m_chkInlineSet, tr2i18n( "If this is checked the set method will be created inline; otherwise, it will not." ) );
    m_btnCancel->setText( tr2i18n( "&Cancel" ) );
    m_btnOk->setText( tr2i18n( "&OK" ) );
}

void CreateGetterSetterDialogBase::slotInlineChanged()
{
    tqWarning( "CreateGetterSetterDialogBase::slotInlineChanged(): Not implemented yet" );
}

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

TQMetaObject *CreateGetterSetterDialogBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_CreateGetterSetterDialogBase( "CreateGetterSetterDialogBase", &CreateGetterSetterDialogBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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