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

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

#include "wordcompletionui.h"

#include <ntqvariant.h>
#include <kinputdialog.h>
#include <kurlrequester.h>
#include <kpushbutton.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <klineedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "klanguagebutton.h"
#include "klanguagebuttonhelper.h"
#include "klineedit.h"
#include "wordcompletionui.ui.h"

/*
 *  Constructs a WordCompletionUI as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
WordCompletionUI::WordCompletionUI( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "WordCompletionUI" );
    WordCompletionUILayout = new TQGridLayout( this, 1, 1, 11, 6, "WordCompletionUILayout"); 

    layout1 = new TQVBoxLayout( 0, 0, 6, "layout1"); 

    addButton = new KPushButton( this, "addButton" );
    addButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, addButton->sizePolicy().hasHeightForWidth() ) );
    layout1->addWidget( addButton );

    deleteButton = new KPushButton( this, "deleteButton" );
    deleteButton->setEnabled( false );
    deleteButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, deleteButton->sizePolicy().hasHeightForWidth() ) );
    layout1->addWidget( deleteButton );

    moveUpButton = new KPushButton( this, "moveUpButton" );
    moveUpButton->setEnabled( false );
    moveUpButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, moveUpButton->sizePolicy().hasHeightForWidth() ) );
    layout1->addWidget( moveUpButton );

    moveDownButton = new KPushButton( this, "moveDownButton" );
    moveDownButton->setEnabled( false );
    moveDownButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, moveDownButton->sizePolicy().hasHeightForWidth() ) );
    layout1->addWidget( moveDownButton );

    exportButton = new KPushButton( this, "exportButton" );
    exportButton->setEnabled( false );
    exportButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, exportButton->sizePolicy().hasHeightForWidth() ) );
    layout1->addWidget( exportButton );
    spacer1 = new TQSpacerItem( 20, 240, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout1->addItem( spacer1 );

    WordCompletionUILayout->addLayout( layout1, 0, 1 );

    layout2 = new TQVBoxLayout( 0, 0, 6, "layout2"); 

    dictionaryList = new TDEListView( this, "dictionaryList" );
    dictionaryList->addColumn( tr2i18n( "Dictionary" ) );
    dictionaryList->addColumn( tr2i18n( "Language" ) );
    dictionaryList->setAllColumnsShowFocus( true );
    layout2->addWidget( dictionaryList );

    selectedDictionaryDetails = new TQGroupBox( this, "selectedDictionaryDetails" );
    selectedDictionaryDetails->setEnabled( false );
    selectedDictionaryDetails->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, selectedDictionaryDetails->sizePolicy().hasHeightForWidth() ) );
    selectedDictionaryDetails->setColumnLayout(0, TQt::Vertical );
    selectedDictionaryDetails->layout()->setSpacing( 6 );
    selectedDictionaryDetails->layout()->setMargin( 11 );
    selectedDictionaryDetailsLayout = new TQGridLayout( selectedDictionaryDetails->layout() );
    selectedDictionaryDetailsLayout->setAlignment( TQt::AlignTop );

    languageLabel = new TQLabel( selectedDictionaryDetails, "languageLabel" );

    selectedDictionaryDetailsLayout->addWidget( languageLabel, 1, 0 );

    dictionaryNameLabel = new TQLabel( selectedDictionaryDetails, "dictionaryNameLabel" );

    selectedDictionaryDetailsLayout->addWidget( dictionaryNameLabel, 0, 0 );

    dictionaryName = new KLineEdit( selectedDictionaryDetails, "dictionaryName" );

    selectedDictionaryDetailsLayout->addWidget( dictionaryName, 0, 1 );
    layout2->addWidget( selectedDictionaryDetails );

    WordCompletionUILayout->addLayout( layout2, 0, 0 );
    languageChange();
    resize( TQSize(552, 252).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( dictionaryList, addButton );
    setTabOrder( addButton, deleteButton );
    setTabOrder( deleteButton, moveUpButton );
    setTabOrder( moveUpButton, moveDownButton );
    setTabOrder( moveDownButton, exportButton );
    setTabOrder( exportButton, selectedDictionaryDetails );

    // buddies
    dictionaryNameLabel->setBuddy( dictionaryName );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void WordCompletionUI::languageChange()
{
    addButton->setText( tr2i18n( "Add D&ictionary..." ) );
    TQWhatsThis::add( addButton, tr2i18n( "With this button you can add a new dictionary to the list of available dictionaries." ) );
    deleteButton->setText( tr2i18n( "&Delete Dictionary" ) );
    TQWhatsThis::add( deleteButton, tr2i18n( "With this button you delete the selected dictionary." ) );
    moveUpButton->setText( tr2i18n( "Move &Up" ) );
    TQWhatsThis::add( moveUpButton, tr2i18n( "With this button you move the selected dictionary up." ) );
    moveDownButton->setText( tr2i18n( "&Move Down" ) );
    TQWhatsThis::add( moveDownButton, tr2i18n( "With this button you move the selected dictionary down." ) );
    exportButton->setText( tr2i18n( "&Export Dictionary..." ) );
    TQWhatsThis::add( exportButton, tr2i18n( "With this button you export the selected dictionary to a file." ) );
    dictionaryList->header()->setLabel( 0, tr2i18n( "Dictionary" ) );
    dictionaryList->header()->setLabel( 1, tr2i18n( "Language" ) );
    TQWhatsThis::add( dictionaryList, tr2i18n( "This list contains all available dictionaries for the word completion. KMouth will display a combo box next to the edit field in the main window if this list contains more than one dictionary. You can use this combo box in order to select the dictionary that actually gets used for the word completion." ) );
    selectedDictionaryDetails->setTitle( tr2i18n( "&Selected Dictionary" ) );
    languageLabel->setText( tr2i18n( "&Language:" ) );
    TQWhatsThis::add( languageLabel, tr2i18n( "With this combo box you select the language associated with the selected dictionary." ) );
    dictionaryNameLabel->setText( tr2i18n( "&Name:" ) );
    TQWhatsThis::add( dictionaryNameLabel, tr2i18n( "With this input field you specify the name of the selected dictionary." ) );
    TQWhatsThis::add( dictionaryName, tr2i18n( "With this input field you specify the name of the selected dictionary." ) );
}

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

TQMetaObject *WordCompletionUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_WordCompletionUI( "WordCompletionUI", &WordCompletionUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* WordCompletionUI::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 = TQWidget::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQUParameter param_slot_1[] = {
	{ "index", &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"languageButton_activated", 1, param_slot_1 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "languageButton_activated(int)", &slot_1, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"WordCompletionUI", parentObject,
	slot_tbl, 2,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_WordCompletionUI.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool WordCompletionUI::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: languageButton_activated((int)static_QUType_int.get(_o+1)); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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