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

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

#include "subclassesdlgbase.h"

#include <ntqvariant.h>
#include <kdialog.h>
#include <kurlrequester.h>
#include <ntqpushbutton.h>
#include <ntqlistbox.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    add_button = new TQPushButton( this, "add_button" );
    add_button->setAutoDefault( false );

    SubclassesDlgBaseLayout->addWidget( add_button, 1, 0 );

    remove_button = new TQPushButton( this, "remove_button" );
    remove_button->setAutoDefault( false );

    SubclassesDlgBaseLayout->addWidget( remove_button, 2, 0 );

    subclasses_box = new TQListBox( this, "subclasses_box" );

    SubclassesDlgBaseLayout->addMultiCellWidget( subclasses_box, 1, 3, 1, 1 );

    subclass_url = new KURLRequester( this, "subclass_url" );
    subclass_url->setMinimumSize( TQSize( 0, 24 ) );
    subclass_url->setFocusPolicy( KURLRequester::WheelFocus );

    SubclassesDlgBaseLayout->addWidget( subclass_url, 0, 1 );
    spacer2 = new TQSpacerItem( 20, 90, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    SubclassesDlgBaseLayout->addItem( spacer2, 3, 0 );

    textLabel2 = new TQLabel( this, "textLabel2" );
    textLabel2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, textLabel2->sizePolicy().hasHeightForWidth() ) );
    textLabel2->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );

    SubclassesDlgBaseLayout->addWidget( textLabel2, 0, 0 );

    layout3 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout3"); 
    Horizontal_Spacing2 = new TQSpacerItem( 310, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout3->addItem( Horizontal_Spacing2 );

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

    buttonCancel = new TQPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( true );
    buttonCancel->setDefault( false );
    layout3->addWidget( buttonCancel );

    SubclassesDlgBaseLayout->addMultiCellLayout( layout3, 4, 4, 0, 1 );
    languageChange();
    resize( TQSize(514, 278).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( subclass_url, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( changeCurrentURL(const TQString&) ) );
    connect( remove_button, TQ_SIGNAL( clicked() ), this, TQ_SLOT( removeRelation() ) );
    connect( buttonCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( add_button, TQ_SIGNAL( clicked() ), this, TQ_SLOT( newRelation() ) );
    connect( subclasses_box, TQ_SIGNAL( clicked(TQListBoxItem*) ), this, TQ_SLOT( currentRelationChanged(TQListBoxItem*) ) );

    // tab order
    setTabOrder( subclasses_box, add_button );
    setTabOrder( add_button, subclass_url );
    setTabOrder( subclass_url, remove_button );
    setTabOrder( remove_button, buttonOk );
    setTabOrder( buttonOk, buttonCancel );

    // buddies
    textLabel2->setBuddy( subclass_url );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SubclassesDlgBase::languageChange()
{
    setCaption( tr2i18n( "Related Subclasses" ) );
    add_button->setText( tr2i18n( "&Add Relation" ) );
    remove_button->setText( tr2i18n( "&Remove Relation" ) );
    textLabel2->setText( tr2i18n( "Related subclass &location:" ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    buttonCancel->setText( tr2i18n( "&Cancel" ) );
}

void SubclassesDlgBase::changeCurrentURL(const TQString&)
{
    tqWarning( "SubclassesDlgBase::changeCurrentURL(const TQString&): Not implemented yet" );
}

void SubclassesDlgBase::removeRelation()
{
    tqWarning( "SubclassesDlgBase::removeRelation(): Not implemented yet" );
}

void SubclassesDlgBase::newRelation()
{
    tqWarning( "SubclassesDlgBase::newRelation(): Not implemented yet" );
}

void SubclassesDlgBase::currentRelationChanged(TQListBoxItem*)
{
    tqWarning( "SubclassesDlgBase::currentRelationChanged(TQListBoxItem*): Not implemented yet" );
}

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

TQMetaObject *SubclassesDlgBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_SubclassesDlgBase( "SubclassesDlgBase", &SubclassesDlgBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* SubclassesDlgBase::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[] = {
	{ "str", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"changeCurrentURL", 1, param_slot_1 };
    static const TQUMethod slot_2 = {"removeRelation", 0, 0 };
    static const TQUMethod slot_3 = {"newRelation", 0, 0 };
    static const TQUParameter param_slot_4[] = {
	{ "item", &static_QUType_ptr, "TQListBoxItem", TQUParameter::In }
    };
    static const TQUMethod slot_4 = {"currentRelationChanged", 1, param_slot_4 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "changeCurrentURL(const TQString&)", &slot_1, TQMetaData::Protected },
	{ "removeRelation()", &slot_2, TQMetaData::Protected },
	{ "newRelation()", &slot_3, TQMetaData::Protected },
	{ "currentRelationChanged(TQListBoxItem*)", &slot_4, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"SubclassesDlgBase", parentObject,
	slot_tbl, 5,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_SubclassesDlgBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool SubclassesDlgBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: changeCurrentURL((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 2: removeRelation(); break;
    case 3: newRelation(); break;
    case 4: currentRelationChanged((TQListBoxItem*)static_QUType_ptr.get(_o+1)); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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