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

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

#include "variabledialog.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <ntqpushbutton.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a VariableDialogBase 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.
 */
VariableDialogBase::VariableDialogBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "VariableDialogBase" );
    VariableDialogBaseLayout = new TQGridLayout( this, 1, 1, 11, 6, "VariableDialogBaseLayout"); 

    varView = new TQListView( this, "varView" );
    varView->addColumn( tr2i18n( "Variable" ) );
    varView->addColumn( tr2i18n( "Access" ) );
    varView->setFrameShape( TQListView::StyledPanel );
    varView->setFrameShadow( TQListView::Sunken );
    varView->setAllColumnsShowFocus( true );
    varView->setResizeMode( TQListView::LastColumn );

    VariableDialogBaseLayout->addMultiCellWidget( varView, 0, 0, 0, 3 );

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

    VariableDialogBaseLayout->addWidget( deleteButton, 1, 3 );

    propBox = new TQGroupBox( this, "propBox" );
    propBox->setColumnLayout(0, TQt::Vertical );
    propBox->layout()->setSpacing( 6 );
    propBox->layout()->setMargin( 11 );
    propBoxLayout = new TQGridLayout( propBox->layout() );
    propBoxLayout->setAlignment( TQt::AlignTop );

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

    propBoxLayout->addWidget( TextLabel2, 1, 0 );

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

    propBoxLayout->addWidget( TextLabel1, 0, 0 );

    varName = new KLineEdit( propBox, "varName" );

    propBoxLayout->addWidget( varName, 0, 1 );

    accessCombo = new TQComboBox( false, propBox, "accessCombo" );

    propBoxLayout->addWidget( accessCombo, 1, 1 );

    VariableDialogBaseLayout->addMultiCellWidget( propBox, 2, 2, 0, 3 );

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

    VariableDialogBaseLayout->addWidget( addButton, 1, 2 );
    Spacer2 = new TQSpacerItem( 0, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    VariableDialogBaseLayout->addMultiCell( Spacer2, 1, 1, 0, 1 );

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

    VariableDialogBaseLayout->addWidget( cancelButton, 3, 3 );

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

    VariableDialogBaseLayout->addMultiCellWidget( okButton, 3, 3, 1, 2 );
    Spacer3 = new TQSpacerItem( 0, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    VariableDialogBaseLayout->addItem( Spacer3, 3, 0 );
    languageChange();
    resize( TQSize(276, 320).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( cancelButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( addButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addVariable() ) );
    connect( okButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( okClicked() ) );
    connect( varName, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( nameChanged() ) );
    connect( deleteButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( deleteVariable() ) );
    connect( accessCombo, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( accessChanged() ) );
    connect( varView, TQ_SIGNAL( currentChanged(TQListViewItem*) ), this, TQ_SLOT( currentItemChanged(TQListViewItem*) ) );
    connect( varView, TQ_SIGNAL( selectionChanged(TQListViewItem*) ), this, TQ_SLOT( currentItemChanged(TQListViewItem*) ) );

    // tab order
    setTabOrder( varView, addButton );
    setTabOrder( addButton, deleteButton );
    setTabOrder( deleteButton, varName );
    setTabOrder( varName, accessCombo );
    setTabOrder( accessCombo, okButton );
    setTabOrder( okButton, cancelButton );

    // buddies
    TextLabel2->setBuddy( accessCombo );
    TextLabel1->setBuddy( varName );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void VariableDialogBase::languageChange()
{
    setCaption( tr2i18n( "Edit Variables" ) );
    varView->header()->setLabel( 0, tr2i18n( "Variable" ) );
    varView->header()->setLabel( 1, tr2i18n( "Access" ) );
    deleteButton->setText( tr2i18n( "&Delete" ) );
    propBox->setTitle( tr2i18n( "Variable Properties" ) );
    TextLabel2->setText( tr2i18n( "Acc&ess:" ) );
    TextLabel1->setText( tr2i18n( "&Variable:" ) );
    accessCombo->clear();
    accessCombo->insertItem( tr2i18n( "public" ) );
    accessCombo->insertItem( tr2i18n( "protected" ) );
    accessCombo->insertItem( tr2i18n( "private" ) );
    addButton->setText( tr2i18n( "&Add" ) );
    cancelButton->setText( tr2i18n( "&Cancel" ) );
    okButton->setText( tr2i18n( "&OK" ) );
}

void VariableDialogBase::addVariable()
{
    tqWarning( "VariableDialogBase::addVariable(): Not implemented yet" );
}

void VariableDialogBase::deleteVariable()
{
    tqWarning( "VariableDialogBase::deleteVariable(): Not implemented yet" );
}

void VariableDialogBase::accessChanged()
{
    tqWarning( "VariableDialogBase::accessChanged(): Not implemented yet" );
}

void VariableDialogBase::nameChanged()
{
    tqWarning( "VariableDialogBase::nameChanged(): Not implemented yet" );
}

void VariableDialogBase::okClicked()
{
    tqWarning( "VariableDialogBase::okClicked(): Not implemented yet" );
}

void VariableDialogBase::currentItemChanged(TQListViewItem*)
{
    tqWarning( "VariableDialogBase::currentItemChanged(TQListViewItem*): Not implemented yet" );
}

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

TQMetaObject *VariableDialogBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_VariableDialogBase( "VariableDialogBase", &VariableDialogBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* VariableDialogBase::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 = {"addVariable", 0, 0 };
    static const TQUMethod slot_1 = {"deleteVariable", 0, 0 };
    static const TQUMethod slot_2 = {"accessChanged", 0, 0 };
    static const TQUMethod slot_3 = {"nameChanged", 0, 0 };
    static const TQUMethod slot_4 = {"okClicked", 0, 0 };
    static const TQUParameter param_slot_5[] = {
	{ "i", &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_5 = {"currentItemChanged", 1, param_slot_5 };
    static const TQUMethod slot_6 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "addVariable()", &slot_0, TQMetaData::Public },
	{ "deleteVariable()", &slot_1, TQMetaData::Public },
	{ "accessChanged()", &slot_2, TQMetaData::Public },
	{ "nameChanged()", &slot_3, TQMetaData::Public },
	{ "okClicked()", &slot_4, TQMetaData::Public },
	{ "currentItemChanged(TQListViewItem*)", &slot_5, TQMetaData::Public },
	{ "languageChange()", &slot_6, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"VariableDialogBase", parentObject,
	slot_tbl, 7,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_VariableDialogBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool VariableDialogBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: addVariable(); break;
    case 1: deleteVariable(); break;
    case 2: accessChanged(); break;
    case 3: nameChanged(); break;
    case 4: okClicked(); break;
    case 5: currentItemChanged((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 6: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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