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

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

#include "listeditor.h"

#include <ntqvariant.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>

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

    listview = new TQListView( this, "listview" );
    listview->addColumn( tr2i18n( "Column 1" ) );
    listview->setSelectionMode( TQListView::Extended );
    listview->setResizeMode( TQListView::AllColumns );

    ListEditorLayout->addMultiCellWidget( listview, 0, 4, 0, 0 );

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

    ListEditorLayout->addWidget( PushButton1, 0, 1 );

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

    ListEditorLayout->addWidget( PushButton2, 1, 1 );

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

    ListEditorLayout->addWidget( PushButton3, 2, 1 );

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

    ListEditorLayout->addWidget( PushButton4, 4, 1 );
    Spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    ListEditorLayout->addItem( Spacer1, 3, 1 );
    languageChange();
    resize( TQSize(331, 301).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( PushButton1, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addItem() ) );
    connect( PushButton2, TQ_SIGNAL( clicked() ), this, TQ_SLOT( removeItems() ) );
    connect( PushButton4, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( listview, TQ_SIGNAL( itemRenamed(TQListViewItem*,int) ), this, TQ_SLOT( renamed(TQListViewItem*) ) );
    connect( PushButton3, TQ_SIGNAL( clicked() ), this, TQ_SLOT( renameItem() ) );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ListEditor::languageChange()
{
    setCaption( tr2i18n( "Edit" ) );
    listview->header()->setLabel( 0, tr2i18n( "Column 1" ) );
    PushButton1->setText( tr2i18n( "&Add" ) );
    PushButton2->setText( tr2i18n( "&Remove" ) );
    PushButton3->setText( tr2i18n( "Re&name" ) );
    PushButton4->setText( tr2i18n( "&Close" ) );
}

void ListEditor::init()
{
}

void ListEditor::setList(const TQStringList&)
{
    tqWarning( "ListEditor::setList(const TQStringList&): Not implemented yet" );
}

void ListEditor::addItem()
{
    tqWarning( "ListEditor::addItem(): Not implemented yet" );
}

void ListEditor::renamed(TQListViewItem*)
{
    tqWarning( "ListEditor::renamed(TQListViewItem*): Not implemented yet" );
}

void ListEditor::removeItems()
{
    tqWarning( "ListEditor::removeItems(): Not implemented yet" );
}

TQStringList ListEditor::items()
{
    tqWarning( "ListEditor::items(): Not implemented yet" );
    return TQStringList();
}

void ListEditor::renameItem()
{
    tqWarning( "ListEditor::renameItem(): Not implemented yet" );
}

/****************************************************************************
** ListEditor meta object code from reading C++ file 'listeditor.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 "listeditor.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

#include <ntqvariant.h>
const char *ListEditor::className() const
{
    return "ListEditor";
}

TQMetaObject *ListEditor::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ListEditor( "ListEditor", &ListEditor::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ListEditor::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 = {"init", 0, 0 };
    static const TQUParameter param_slot_1[] = {
	{ "l", &static_QUType_varptr, "\x04", TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"setList", 1, param_slot_1 };
    static const TQUMethod slot_2 = {"addItem", 0, 0 };
    static const TQUParameter param_slot_3[] = {
	{ "i", &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_3 = {"renamed", 1, param_slot_3 };
    static const TQUMethod slot_4 = {"removeItems", 0, 0 };
    static const TQUParameter param_slot_5[] = {
	{ 0, &static_QUType_TQVariant, "\x04", TQUParameter::Out }
    };
    static const TQUMethod slot_5 = {"items", 1, param_slot_5 };
    static const TQUMethod slot_6 = {"renameItem", 0, 0 };
    static const TQUMethod slot_7 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "init()", &slot_0, TQMetaData::Public },
	{ "setList(const TQStringList&)", &slot_1, TQMetaData::Public },
	{ "addItem()", &slot_2, TQMetaData::Public },
	{ "renamed(TQListViewItem*)", &slot_3, TQMetaData::Public },
	{ "removeItems()", &slot_4, TQMetaData::Public },
	{ "items()", &slot_5, TQMetaData::Public },
	{ "renameItem()", &slot_6, TQMetaData::Public },
	{ "languageChange()", &slot_7, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ListEditor", parentObject,
	slot_tbl, 8,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ListEditor.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool ListEditor::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: init(); break;
    case 1: setList((const TQStringList&)*((const TQStringList*)static_QUType_ptr.get(_o+1))); break;
    case 2: addItem(); break;
    case 3: renamed((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 4: removeItems(); break;
    case 5: static_QUType_TQVariant.set(_o,TQVariant(items())); break;
    case 6: renameItem(); break;
    case 7: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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