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

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

#include "selecttalkerwidget.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqframe.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a SelectTalkerWidget as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
SelectTalkerWidget::SelectTalkerWidget( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "SelectTalkerWidget" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)3, 0, 0, sizePolicy().hasHeightForWidth() ) );
    SelectTalkerWidgetLayout = new TQVBoxLayout( this, 0, 6, "SelectTalkerWidgetLayout"); 

    buttonGroup1 = new TQButtonGroup( this, "buttonGroup1" );
    buttonGroup1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)3, 0, 0, buttonGroup1->sizePolicy().hasHeightForWidth() ) );
    buttonGroup1->setFrameShape( TQButtonGroup::NoFrame );
    buttonGroup1->setColumnLayout(0, TQt::Vertical );
    buttonGroup1->layout()->setSpacing( 6 );
    buttonGroup1->layout()->setMargin( 0 );
    buttonGroup1Layout = new TQVBoxLayout( buttonGroup1->layout() );
    buttonGroup1Layout->setAlignment( TQt::AlignTop );

    useDefaultRadioButton = new TQRadioButton( buttonGroup1, "useDefaultRadioButton" );
    buttonGroup1Layout->addWidget( useDefaultRadioButton );

    useClosestMatchRadioButton = new TQRadioButton( buttonGroup1, "useClosestMatchRadioButton" );
    buttonGroup1Layout->addWidget( useClosestMatchRadioButton );

    layout6 = new TQHBoxLayout( 0, 0, 6, "layout6"); 
    spacer15 = new TQSpacerItem( 30, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    layout6->addItem( spacer15 );

    closestMatchGroupBox = new TQGroupBox( buttonGroup1, "closestMatchGroupBox" );
    closestMatchGroupBox->setFrameShape( TQGroupBox::NoFrame );
    closestMatchGroupBox->setColumnLayout(0, TQt::Vertical );
    closestMatchGroupBox->layout()->setSpacing( 6 );
    closestMatchGroupBox->layout()->setMargin( 0 );
    closestMatchGroupBoxLayout = new TQGridLayout( closestMatchGroupBox->layout() );
    closestMatchGroupBoxLayout->setAlignment( TQt::AlignTop );

    preferredLabel = new TQLabel( closestMatchGroupBox, "preferredLabel" );

    closestMatchGroupBoxLayout->addMultiCellWidget( preferredLabel, 3, 3, 0, 2 );

    layout11_2 = new TQHBoxLayout( 0, 0, 6, "layout11_2"); 

    synthLabel = new TQLabel( closestMatchGroupBox, "synthLabel" );
    synthLabel->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter | TQLabel::AlignLeft ) );
    layout11_2->addWidget( synthLabel );

    synthComboBox = new KComboBox( false, closestMatchGroupBox, "synthComboBox" );
    layout11_2->addWidget( synthComboBox );

    synthCheckBox = new TQCheckBox( closestMatchGroupBox, "synthCheckBox" );
    synthCheckBox->setEnabled( false );
    synthCheckBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, synthCheckBox->sizePolicy().hasHeightForWidth() ) );
    layout11_2->addWidget( synthCheckBox );

    closestMatchGroupBoxLayout->addLayout( layout11_2, 0, 0 );

    layout12 = new TQHBoxLayout( 0, 0, 6, "layout12"); 

    genderLabel = new TQLabel( closestMatchGroupBox, "genderLabel" );
    layout12->addWidget( genderLabel );

    genderComboBox = new KComboBox( false, closestMatchGroupBox, "genderComboBox" );
    layout12->addWidget( genderComboBox );

    genderCheckBox = new TQCheckBox( closestMatchGroupBox, "genderCheckBox" );
    genderCheckBox->setEnabled( false );
    genderCheckBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, genderCheckBox->sizePolicy().hasHeightForWidth() ) );
    layout12->addWidget( genderCheckBox );

    closestMatchGroupBoxLayout->addLayout( layout12, 0, 2 );

    line1 = new TQFrame( closestMatchGroupBox, "line1" );
    line1->setFrameShape( TQFrame::VLine );
    line1->setFrameShadow( TQFrame::Plain );
    line1->setLineWidth( 2 );
    line1->setFrameShape( TQFrame::VLine );

    closestMatchGroupBoxLayout->addMultiCellWidget( line1, 0, 1, 1, 1 );

    layout14 = new TQHBoxLayout( 0, 0, 6, "layout14"); 

    volumeLabel = new TQLabel( closestMatchGroupBox, "volumeLabel" );
    layout14->addWidget( volumeLabel );

    volumeComboBox = new KComboBox( false, closestMatchGroupBox, "volumeComboBox" );
    layout14->addWidget( volumeComboBox );

    volumeCheckBox = new TQCheckBox( closestMatchGroupBox, "volumeCheckBox" );
    volumeCheckBox->setEnabled( false );
    volumeCheckBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, volumeCheckBox->sizePolicy().hasHeightForWidth() ) );
    layout14->addWidget( volumeCheckBox );

    closestMatchGroupBoxLayout->addLayout( layout14, 1, 0 );

    layout13 = new TQHBoxLayout( 0, 0, 6, "layout13"); 

    rateLabel = new TQLabel( closestMatchGroupBox, "rateLabel" );
    layout13->addWidget( rateLabel );

    rateComboBox = new KComboBox( false, closestMatchGroupBox, "rateComboBox" );
    layout13->addWidget( rateComboBox );

    rateCheckBox = new TQCheckBox( closestMatchGroupBox, "rateCheckBox" );
    rateCheckBox->setEnabled( false );
    rateCheckBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, rateCheckBox->sizePolicy().hasHeightForWidth() ) );
    layout13->addWidget( rateCheckBox );

    closestMatchGroupBoxLayout->addLayout( layout13, 1, 2 );

    layout10 = new TQHBoxLayout( 0, 0, 6, "layout10"); 

    languageLabel = new TQLabel( closestMatchGroupBox, "languageLabel" );
    layout10->addWidget( languageLabel );

    languageLineEdit = new KLineEdit( closestMatchGroupBox, "languageLineEdit" );
    languageLineEdit->setEnabled( false );
    languageLineEdit->setPaletteForegroundColor( TQColor( 0, 0, 0 ) );
    layout10->addWidget( languageLineEdit );

    languageBrowseButton = new KPushButton( closestMatchGroupBox, "languageBrowseButton" );
    layout10->addWidget( languageBrowseButton );

    languageCheckBox = new TQCheckBox( closestMatchGroupBox, "languageCheckBox" );
    languageCheckBox->setEnabled( false );
    languageCheckBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, languageCheckBox->sizePolicy().hasHeightForWidth() ) );
    layout10->addWidget( languageCheckBox );

    closestMatchGroupBoxLayout->addMultiCellLayout( layout10, 2, 2, 0, 2 );
    layout6->addWidget( closestMatchGroupBox );
    buttonGroup1Layout->addLayout( layout6 );

    useSpecificTalkerRadioButton = new TQRadioButton( buttonGroup1, "useSpecificTalkerRadioButton" );
    buttonGroup1Layout->addWidget( useSpecificTalkerRadioButton );

    layout10_2 = new TQHBoxLayout( 0, 0, 6, "layout10_2"); 
    spacer15_2 = new TQSpacerItem( 30, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    layout10_2->addItem( spacer15_2 );

    talkersListView = new TDEListView( buttonGroup1, "talkersListView" );
    talkersListView->addColumn( tr2i18n( "Language" ) );
    talkersListView->addColumn( tr2i18n( "Speech Synthesizer" ) );
    talkersListView->addColumn( tr2i18n( "Voice" ) );
    talkersListView->addColumn( tr2i18n( "Gender" ) );
    talkersListView->addColumn( tr2i18n( "Volume" ) );
    talkersListView->addColumn( tr2i18n( "Rate" ) );
    talkersListView->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)3, 0, 0, talkersListView->sizePolicy().hasHeightForWidth() ) );
    talkersListView->setResizeMode( TDEListView::LastColumn );
    layout10_2->addWidget( talkersListView );
    buttonGroup1Layout->addLayout( layout10_2 );
    SelectTalkerWidgetLayout->addWidget( buttonGroup1 );
    languageChange();
    resize( TQSize(558, 447).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( useDefaultRadioButton, useClosestMatchRadioButton );
    setTabOrder( useClosestMatchRadioButton, synthComboBox );
    setTabOrder( synthComboBox, synthCheckBox );
    setTabOrder( synthCheckBox, genderComboBox );
    setTabOrder( genderComboBox, genderCheckBox );
    setTabOrder( genderCheckBox, volumeComboBox );
    setTabOrder( volumeComboBox, volumeCheckBox );
    setTabOrder( volumeCheckBox, rateComboBox );
    setTabOrder( rateComboBox, rateCheckBox );
    setTabOrder( rateCheckBox, languageLineEdit );
    setTabOrder( languageLineEdit, languageBrowseButton );
    setTabOrder( languageBrowseButton, languageCheckBox );
    setTabOrder( languageCheckBox, useSpecificTalkerRadioButton );
    setTabOrder( useSpecificTalkerRadioButton, talkersListView );

    // buddies
    synthLabel->setBuddy( synthComboBox );
    genderLabel->setBuddy( genderCheckBox );
    volumeLabel->setBuddy( volumeCheckBox );
    rateLabel->setBuddy( rateCheckBox );
    languageLabel->setBuddy( languageLineEdit );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SelectTalkerWidget::languageChange()
{
    setCaption( tr2i18n( "Select Talker" ) );
    buttonGroup1->setTitle( TQString::null );
    useDefaultRadioButton->setText( tr2i18n( "&Use default Talker" ) );
    TQWhatsThis::add( useDefaultRadioButton, tr2i18n( "When checked, will use the default Talker, which is the topmost Talker listed in the Talkers tab." ) );
    useClosestMatchRadioButton->setText( tr2i18n( "Use closest &matching Talker having" ) );
    TQWhatsThis::add( useClosestMatchRadioButton, tr2i18n( "When checked, will use a configured Talker most closely matching the attributes you choose.  Attributes with checks next to them will be preferred over unchecked attributes.  Language is always preferred." ) );
    closestMatchGroupBox->setTitle( TQString::null );
    preferredLabel->setText( tr2i18n( "Checked items are preferred over unchecked items." ) );
    synthLabel->setText( tr2i18n( "&Synthesizer:" ) );
    synthCheckBox->setText( TQString::null );
    genderLabel->setText( tr2i18n( "&Gender:" ) );
    genderCheckBox->setText( TQString::null );
    volumeLabel->setText( tr2i18n( "&Volume:" ) );
    volumeCheckBox->setText( TQString::null );
    rateLabel->setText( tr2i18n( "&Rate:" ) );
    rateCheckBox->setText( TQString::null );
    languageLabel->setText( tr2i18n( "&Language:" ) );
    TQWhatsThis::add( languageLineEdit, tr2i18n( "This filter is applied to text jobs of the specified language.  You may select more than one language by clicking the browse button and Ctrl-clicking on more than one in the list.  If blank, the filter applies to all text jobs of any language." ) );
    languageBrowseButton->setText( tr2i18n( "..." ) );
    TQWhatsThis::add( languageBrowseButton, tr2i18n( "Click to select one or more languages.  This filter will be applied to text jobs of those languages." ) );
    languageCheckBox->setText( TQString::null );
    useSpecificTalkerRadioButton->setText( tr2i18n( "Use specific &Talker" ) );
    TQWhatsThis::add( useSpecificTalkerRadioButton, tr2i18n( "When checked, will use the specific Talker (if it is still configured), otherwise the Talker most closely matching." ) );
    talkersListView->header()->setLabel( 0, tr2i18n( "Language" ) );
    talkersListView->header()->setLabel( 1, tr2i18n( "Speech Synthesizer" ) );
    talkersListView->header()->setLabel( 2, tr2i18n( "Voice" ) );
    talkersListView->header()->setLabel( 3, tr2i18n( "Gender" ) );
    talkersListView->header()->setLabel( 4, tr2i18n( "Volume" ) );
    talkersListView->header()->setLabel( 5, tr2i18n( "Rate" ) );
    TQWhatsThis::add( talkersListView, tr2i18n( "This is a list of all the configured Talkers.  A Talker is a speech synthesizer that has been configured with a language, voice, gender, speaking rate, and volume.  Talkers higher in the list have higher priority.  The topmost Talker will be used when no talker attributes have been specified by an application." ) );
}

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

TQMetaObject *SelectTalkerWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_SelectTalkerWidget( "SelectTalkerWidget", &SelectTalkerWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* SelectTalkerWidget::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 TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"SelectTalkerWidget", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_SelectTalkerWidget.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool SelectTalkerWidget::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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