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

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

#include "festivalintconfwidget.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <knuminput.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <kurlrequester.h>
#include <ntqslider.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    festivalConfigurationBox = new TQGroupBox( this, "festivalConfigurationBox" );
    festivalConfigurationBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, festivalConfigurationBox->sizePolicy().hasHeightForWidth() ) );
    festivalConfigurationBox->setFrameShape( TQGroupBox::GroupBoxPanel );
    festivalConfigurationBox->setFrameShadow( TQGroupBox::Sunken );
    festivalConfigurationBox->setColumnLayout(0, TQt::Vertical );
    festivalConfigurationBox->layout()->setSpacing( 6 );
    festivalConfigurationBox->layout()->setMargin( 11 );
    festivalConfigurationBoxLayout = new TQGridLayout( festivalConfigurationBox->layout() );
    festivalConfigurationBoxLayout->setAlignment( TQt::AlignTop );

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

    festivalPathLabel = new TQLabel( festivalConfigurationBox, "festivalPathLabel" );
    festivalPathLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)1, 0, 0, festivalPathLabel->sizePolicy().hasHeightForWidth() ) );
    festivalPathLabel->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    voicesPathBox->addWidget( festivalPathLabel );

    festivalPath = new KURLRequester( festivalConfigurationBox, "festivalPath" );
    festivalPath->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)1, 0, 0, festivalPath->sizePolicy().hasHeightForWidth() ) );
    voicesPathBox->addWidget( festivalPath );

    festivalConfigurationBoxLayout->addLayout( voicesPathBox, 0, 0 );

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

    selectVoiceLabel = new TQLabel( festivalConfigurationBox, "selectVoiceLabel" );
    selectVoiceLabel->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    selectVoiceBox->addWidget( selectVoiceLabel );

    selectVoiceCombo = new KComboBox( false, festivalConfigurationBox, "selectVoiceCombo" );
    selectVoiceCombo->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, selectVoiceCombo->sizePolicy().hasHeightForWidth() ) );
    selectVoiceBox->addWidget( selectVoiceCombo );

    rescan = new KPushButton( festivalConfigurationBox, "rescan" );
    selectVoiceBox->addWidget( rescan );

    festivalConfigurationBoxLayout->addLayout( selectVoiceBox, 1, 0 );

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

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

    volumeLabel = new TQLabel( festivalConfigurationBox, "volumeLabel" );
    volumeLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 0, 0, volumeLabel->sizePolicy().hasHeightForWidth() ) );
    layout8->addWidget( volumeLabel );

    timeLabel = new TQLabel( festivalConfigurationBox, "timeLabel" );
    timeLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 0, 0, timeLabel->sizePolicy().hasHeightForWidth() ) );
    layout8->addWidget( timeLabel );

    frequencyLabel = new TQLabel( festivalConfigurationBox, "frequencyLabel" );
    frequencyLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 0, 0, frequencyLabel->sizePolicy().hasHeightForWidth() ) );
    layout8->addWidget( frequencyLabel );
    layout11->addLayout( layout8 );

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

    volumeBox = new KIntSpinBox( festivalConfigurationBox, "volumeBox" );
    volumeBox->setEnabled( true );
    volumeBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, volumeBox->sizePolicy().hasHeightForWidth() ) );
    volumeBox->setMaxValue( 200 );
    volumeBox->setMinValue( 50 );
    volumeBox->setValue( 100 );
    layout9->addWidget( volumeBox );

    timeBox = new KIntSpinBox( festivalConfigurationBox, "timeBox" );
    timeBox->setEnabled( true );
    timeBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, timeBox->sizePolicy().hasHeightForWidth() ) );
    timeBox->setMaxValue( 200 );
    timeBox->setMinValue( 50 );
    timeBox->setValue( 100 );
    layout9->addWidget( timeBox );

    frequencyBox = new KIntSpinBox( festivalConfigurationBox, "frequencyBox" );
    frequencyBox->setEnabled( true );
    frequencyBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, frequencyBox->sizePolicy().hasHeightForWidth() ) );
    frequencyBox->setMaxValue( 200 );
    frequencyBox->setMinValue( 50 );
    frequencyBox->setValue( 100 );
    layout9->addWidget( frequencyBox );
    layout11->addLayout( layout9 );

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

    volumeSlider = new TQSlider( festivalConfigurationBox, "volumeSlider" );
    volumeSlider->setEnabled( true );
    volumeSlider->setFocusPolicy( TQSlider::NoFocus );
    volumeSlider->setMinValue( 0 );
    volumeSlider->setMaxValue( 1000 );
    volumeSlider->setLineStep( 10 );
    volumeSlider->setPageStep( 100 );
    volumeSlider->setValue( 500 );
    volumeSlider->setOrientation( TQSlider::Horizontal );
    layout10->addWidget( volumeSlider );

    timeSlider = new TQSlider( festivalConfigurationBox, "timeSlider" );
    timeSlider->setEnabled( true );
    timeSlider->setFocusPolicy( TQSlider::NoFocus );
    timeSlider->setMaxValue( 1000 );
    timeSlider->setLineStep( 10 );
    timeSlider->setPageStep( 100 );
    timeSlider->setValue( 500 );
    timeSlider->setOrientation( TQSlider::Horizontal );
    layout10->addWidget( timeSlider );

    frequencySlider = new TQSlider( festivalConfigurationBox, "frequencySlider" );
    frequencySlider->setEnabled( true );
    frequencySlider->setFocusPolicy( TQSlider::NoFocus );
    frequencySlider->setMaxValue( 1000 );
    frequencySlider->setLineStep( 10 );
    frequencySlider->setPageStep( 100 );
    frequencySlider->setValue( 500 );
    frequencySlider->setOrientation( TQSlider::Horizontal );
    layout10->addWidget( frequencySlider );
    layout11->addLayout( layout10 );

    festivalConfigurationBoxLayout->addLayout( layout11, 2, 0 );

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

    preloadCheckBox = new TQCheckBox( festivalConfigurationBox, "preloadCheckBox" );
    layout6->addWidget( preloadCheckBox );
    spacer3 = new TQSpacerItem( 101, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout6->addItem( spacer3 );

    testButton = new TQPushButton( festivalConfigurationBox, "testButton" );
    layout6->addWidget( testButton );

    festivalConfigurationBoxLayout->addLayout( layout6, 4, 0 );

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

    characterCodingLabel = new TQLabel( festivalConfigurationBox, "characterCodingLabel" );
    characterCodingLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, characterCodingLabel->sizePolicy().hasHeightForWidth() ) );
    layout5->addWidget( characterCodingLabel );

    characterCodingBox = new KComboBox( false, festivalConfigurationBox, "characterCodingBox" );
    characterCodingBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, characterCodingBox->sizePolicy().hasHeightForWidth() ) );
    layout5->addWidget( characterCodingBox );

    festivalConfigurationBoxLayout->addLayout( layout5, 3, 0 );

    FestivalIntConfWidgetLayout->addWidget( festivalConfigurationBox, 0, 0 );
    languageChange();
    resize( TQSize(559, 318).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( festivalPath, selectVoiceCombo );
    setTabOrder( selectVoiceCombo, rescan );
    setTabOrder( rescan, volumeBox );
    setTabOrder( volumeBox, timeBox );
    setTabOrder( timeBox, frequencyBox );
    setTabOrder( frequencyBox, preloadCheckBox );
    setTabOrder( preloadCheckBox, testButton );

    // buddies
    festivalPathLabel->setBuddy( festivalPath );
    selectVoiceLabel->setBuddy( selectVoiceCombo );
    volumeLabel->setBuddy( volumeBox );
    timeLabel->setBuddy( timeBox );
    frequencyLabel->setBuddy( frequencyBox );
    characterCodingLabel->setBuddy( characterCodingBox );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void FestivalIntConfWidget::languageChange()
{
    setCaption( tr2i18n( "Festival Config UI" ) );
    TQWhatsThis::add( this, tr2i18n( "This is the dialog for configuring the Festival speech synthesizer in interactive mode." ) );
    festivalConfigurationBox->setTitle( tr2i18n( "Festival &Interactive Configuration" ) );
    TQWhatsThis::add( festivalConfigurationBox, tr2i18n( "This is the dialog for configuring the Festival speech synthesizer in interactive mode." ) );
    festivalPathLabel->setText( tr2i18n( "&Festival executable:" ) );
    TQWhatsThis::add( festivalPathLabel, tr2i18n( "If Festival is in your PATH environment variable, just enter \"festival\", otherwise specify the full path to the Festival executable program." ) );
    TQWhatsThis::add( festivalPath, tr2i18n( "If Festival is in your PATH environment variable, just enter \"festival\", otherwise specify the full path to the Festival executable program." ) );
    selectVoiceLabel->setText( tr2i18n( "&Select voice:" ) );
    TQWhatsThis::add( selectVoiceLabel, tr2i18n( "Select a voice to speak text with.  MultiSyn voices are high quality but are slow to load.  If no voices are shown, check the Festival executable path.  You must install at least one Festival voice.  If you have installed a voice and still none are shown, check your Festival configuration.  (See the README that comes with Festival.)" ) );
    TQWhatsThis::add( selectVoiceCombo, tr2i18n( "Select a voice to speak text with.  MultiSyn voices are high quality but are slow to load.  If no voices are shown, check the Festival executable path.  You must install at least one Festival voice.  If you have installed a voice and still none are shown, check your Festival configuration.  (See the README that comes with Festival.)" ) );
    rescan->setText( tr2i18n( "&Rescan", "Rescan for voices" ) );
    volumeLabel->setText( tr2i18n( "&Volume:" ) );
    TQWhatsThis::add( volumeLabel, tr2i18n( "Sets the volume (loudness) of speech.  Slide the slider to the left to lower the volume; to the right to increase volume.  Anything less than 75 percent is considered \"soft\", and anything greater than 125 percent is considered \"loud\"." ) );
    timeLabel->setText( tr2i18n( "Sp&eed:" ) );
    TQWhatsThis::add( timeLabel, tr2i18n( "Sets the speed of speech.  Slide the slider to the left to slow speech down; to the right to increase talking speed.  Anything less than 75 percent is considered \"slow\", and anything greater than 125 percent is considered \"fast\".  You cannot change the speed of MultiSyn voices." ) );
    frequencyLabel->setText( tr2i18n( "&Pitch:" ) );
    TQWhatsThis::add( frequencyLabel, tr2i18n( "Sets the tone (frequency) of speech.  Slide the slider to the left to lower the voice tone; to the right to increase tone.  Anything less than 75 percent is considered \"low\", and anything greater than 125 percent is considered \"high\".  You cannot change the pitch of MultiSyn voices." ) );
    volumeBox->setSuffix( tr2i18n( " %" ) );
    TQWhatsThis::add( volumeBox, tr2i18n( "Sets the volume (loudness) of speech.  Slide the slider to the left to lower the volume; to the right to increase volume.  Anything less than 75 percent is considered \"soft\", and anything greater than 125 percent is considered \"loud\"." ) );
    timeBox->setSuffix( tr2i18n( " %" ) );
    TQWhatsThis::add( timeBox, tr2i18n( "Sets the speed of speech.  Slide the slider to the left to slow speech down; to the right to increase talking speed.  Anything less than 75 percent is considered \"slow\", and anything greater than 125 percent is considered \"fast\".  You cannot change the speed of MultiSyn voices." ) );
    frequencyBox->setSuffix( tr2i18n( " %" ) );
    TQWhatsThis::add( frequencyBox, tr2i18n( "Sets the tone (frequency) of speech.  Slide the slider to the left to lower the voice tone; to the right to increase tone.  Anything less than 75 percent is considered \"low\", and anything greater than 125 percent is considered \"high\".  You cannot change the pitch of MultiSyn voices." ) );
    TQWhatsThis::add( volumeSlider, tr2i18n( "Sets the volume (loudness) of speech.  Slide the slider to the left to lower the volume; to the right to increase volume.  Anything less than 75 percent is considered \"soft\", and anything greater than 125 percent is considered \"loud\"." ) );
    TQWhatsThis::add( timeSlider, tr2i18n( "Sets the speed of speech.  Slide the slider to the left to slow speech down; to the right to increase talking speed.  Anything less than 75 percent is considered \"slow\", and anything greater than 125 percent is considered \"fast\".  You cannot change the speed of MultiSyn voices." ) );
    TQWhatsThis::add( frequencySlider, tr2i18n( "Sets the tone (frequency) of speech.  Slide the slider to the left to lower the voice tone; to the right to increase tone.  Anything less than 75 percent is considered \"low\", and anything greater than 125 percent is considered \"high\".  You cannot change the pitch of MultiSyn voices." ) );
    preloadCheckBox->setText( tr2i18n( "&Load this voice when starting KTTSD" ) );
    TQWhatsThis::add( preloadCheckBox, tr2i18n( "If checked, Festival will be started and this voice will be loaded when the Text-to-Speech Deamon (KTTSD) is started.  Check when a voice requires a long time to load in Festival (for example, multisyn voices), otherwise, leave unchecked." ) );
    testButton->setText( tr2i18n( "&Test" ) );
    TQWhatsThis::add( testButton, tr2i18n( "Click to test the configuration.  Festival will be started and a test sentence will be spoken." ) );
    characterCodingLabel->setText( tr2i18n( "Character e&ncoding:" ) );
    TQWhatsThis::add( characterCodingBox, tr2i18n( "This combo box specifies which character encoding is used for passing the text." ) );
}

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

TQMetaObject *FestivalIntConfWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_FestivalIntConfWidget( "FestivalIntConfWidget", &FestivalIntConfWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* FestivalIntConfWidget::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(
	"FestivalIntConfWidget", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_FestivalIntConfWidget.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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