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

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

#include "themes_layout.h"

#include <ntqvariant.h>
#include <kpushbutton.h>
#include <kwidgetlistbox.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "kwidgetlistbox.h"

/*
 *  Constructs a ThemesLayout 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.
 */
ThemesLayout::ThemesLayout( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "ThemesLayout" );
    setMinimumSize( TQSize( 0, 0 ) );
    ThemesLayoutLayout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint(), "ThemesLayoutLayout"); 

    layout2 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout2"); 

    labelSearch = new TQLabel( this, "labelSearch" );
    layout2->addWidget( labelSearch );

    editSearch = new TQLineEdit( this, "editSearch" );
    layout2->addWidget( editSearch );

    labelShow = new TQLabel( this, "labelShow" );
    layout2->addWidget( labelShow );

    comboShow = new TQComboBox( false, this, "comboShow" );
    layout2->addWidget( comboShow );
    ThemesLayoutLayout->addLayout( layout2 );

    tableThemes = new KWidgetListbox( this, "tableThemes" );
    tableThemes->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, tableThemes->sizePolicy().hasHeightForWidth() ) );
    tableThemes->setFocusPolicy( KWidgetListbox::StrongFocus );
    ThemesLayoutLayout->addWidget( tableThemes );

    layoutButtons = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layoutButtons"); 
    spacer = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layoutButtons->addItem( spacer );

    buttonAddToDesktop = new KPushButton( this, "buttonAddToDesktop" );
    buttonAddToDesktop->setMinimumSize( TQSize( 0, 0 ) );
    buttonAddToDesktop->setProperty( "stdItem", 27 );
    layoutButtons->addWidget( buttonAddToDesktop );

    buttonClose = new KPushButton( this, "buttonClose" );
    buttonClose->setMinimumSize( TQSize( 0, 0 ) );
    buttonClose->setProperty( "stdItem", 13 );
    layoutButtons->addWidget( buttonClose );
    ThemesLayoutLayout->addLayout( layoutButtons );
    languageChange();
    resize( TQSize(399, 517).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonClose, TQ_SIGNAL( clicked() ), this, TQ_SLOT( close() ) );
    connect( buttonAddToDesktop, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addToDesktop() ) );
    connect( tableThemes, TQ_SIGNAL( selected(int) ), this, TQ_SLOT( selectionChanged(int) ) );
    connect( editSearch, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( search(const TQString&) ) );
    connect( comboShow, TQ_SIGNAL( activated(const TQString&) ), this, TQ_SLOT( search(const TQString&) ) );
    connect( tableThemes, TQ_SIGNAL( doubleClicked(int,int,int,const TQPoint&) ), this, TQ_SLOT( addToDesktop() ) );

    // tab order
    setTabOrder( editSearch, comboShow );
    setTabOrder( comboShow, tableThemes );
    setTabOrder( tableThemes, buttonAddToDesktop );
    setTabOrder( buttonAddToDesktop, buttonClose );

    // buddies
    labelSearch->setBuddy( editSearch );
    labelShow->setBuddy( comboShow );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ThemesLayout::languageChange()
{
    setCaption( tr2i18n( "SuperKaramba Themes" ) );
    labelSearch->setText( tr2i18n( "&Search:" ) );
    labelShow->setText( tr2i18n( "S&how:" ) );
    comboShow->clear();
    comboShow->insertItem( tr2i18n( "All" ) );
    comboShow->insertItem( tr2i18n( "Running" ) );
    buttonAddToDesktop->setText( tr2i18n( "&Add to Desktop" ) );
    buttonClose->setText( tr2i18n( "&Close" ) );
}

void ThemesLayout::addToDesktop()
{
    tqWarning( "ThemesLayout::addToDesktop(): Not implemented yet" );
}

void ThemesLayout::selectionChanged(int)
{
    tqWarning( "ThemesLayout::selectionChanged(int): Not implemented yet" );
}

void ThemesLayout::search(const TQString&)
{
    tqWarning( "ThemesLayout::search(const TQString&): Not implemented yet" );
}

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

TQMetaObject *ThemesLayout::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ThemesLayout( "ThemesLayout", &ThemesLayout::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ThemesLayout::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 = {"addToDesktop", 0, 0 };
    static const TQUParameter param_slot_2[] = {
	{ 0, &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_2 = {"selectionChanged", 1, param_slot_2 };
    static const TQUParameter param_slot_3[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_3 = {"search", 1, param_slot_3 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "addToDesktop()", &slot_1, TQMetaData::Protected },
	{ "selectionChanged(int)", &slot_2, TQMetaData::Protected },
	{ "search(const TQString&)", &slot_3, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ThemesLayout", parentObject,
	slot_tbl, 4,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ThemesLayout.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool ThemesLayout::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: addToDesktop(); break;
    case 2: selectionChanged((int)static_QUType_int.get(_o+1)); break;
    case 3: search((const TQString&)static_QUType_TQString.get(_o+1)); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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