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

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

#include "commandconfwidget.h"

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

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

    confiurationBox = new TQGroupBox( this, "confiurationBox" );
    confiurationBox->setColumnLayout(0, TQt::Vertical );
    confiurationBox->layout()->setSpacing( 6 );
    confiurationBox->layout()->setMargin( 11 );
    confiurationBoxLayout = new TQGridLayout( confiurationBox->layout() );
    confiurationBoxLayout->setAlignment( TQt::AlignTop );

    line = new TQFrame( confiurationBox, "line" );
    line->setFrameShape( TQFrame::HLine );
    line->setFrameShadow( TQFrame::Sunken );
    line->setFrameShape( TQFrame::HLine );

    confiurationBoxLayout->addWidget( line, 1, 0 );

    urlLabel = new TQLabel( confiurationBox, "urlLabel" );

    confiurationBoxLayout->addWidget( urlLabel, 2, 0 );

    urlReq = new KURLRequester( confiurationBox, "urlReq" );

    confiurationBoxLayout->addWidget( urlReq, 3, 0 );

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

    stdInButton = new TQCheckBox( confiurationBox, "stdInButton" );
    layout1->addWidget( stdInButton );
    spacer1 = new TQSpacerItem( 201, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout1->addItem( spacer1 );

    commandTestButton = new TQPushButton( confiurationBox, "commandTestButton" );
    layout1->addWidget( commandTestButton );

    confiurationBoxLayout->addLayout( layout1, 5, 0 );

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

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

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

    confiurationBoxLayout->addLayout( layout5, 4, 0 );

    explanationLabel = new TQLabel( confiurationBox, "explanationLabel" );

    confiurationBoxLayout->addWidget( explanationLabel, 0, 0 );

    CommandConfWidgetLayout->addWidget( confiurationBox, 0, 0 );
    spacer2 = new TQSpacerItem( 20, 30, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    CommandConfWidgetLayout->addItem( spacer2, 1, 0 );
    languageChange();
    resize( TQSize(582, 322).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( urlReq, characterCodingBox );
    setTabOrder( characterCodingBox, stdInButton );
    setTabOrder( stdInButton, commandTestButton );

    // buddies
    urlLabel->setBuddy( urlReq );
    characterCodingLabel->setBuddy( characterCodingBox );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void CommandConfWidget::languageChange()
{
    confiurationBox->setTitle( tr2i18n( "Co&mmand Configuration" ) );
    urlLabel->setText( tr2i18n( "Command &for speaking texts:" ) );
    TQWhatsThis::add( urlReq, tr2i18n( "This field specifies both the command used for speaking texts and its parameters. If you want to pass the text as a parameter, write %t at the place where the text should be inserted.  To pass a file of the text, write %f.  To synthesize only and let KTTSD play the synthesized text, write %w for the generated audio file." ) );
    stdInButton->setText( tr2i18n( "&Send the data as standard input" ) );
    TQWhatsThis::add( stdInButton, tr2i18n( "This check box specifies whether the text is sent as standard input (stdin) to the speech synthesizer." ) );
    commandTestButton->setText( tr2i18n( "&Test" ) );
    characterCodingLabel->setText( tr2i18n( "Character &encoding:" ) );
    TQWhatsThis::add( characterCodingBox, tr2i18n( "This combo box specifies which character encoding is used for passing the text." ) );
    explanationLabel->setText( tr2i18n( "Parameters:\n"
"  %t: Text to be spoken\n"
"  %f: Filename of a temporary file containing the text\n"
"  %l: Language (two letter code)\n"
"  %w: Filename of a temporary file for generated audio" ) );
}

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

TQMetaObject *CommandConfWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_CommandConfWidget( "CommandConfWidget", &CommandConfWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* CommandConfWidget::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 }
    };
    static const TQUMethod signal_0 = {"configurationChanged", 0, 0 };
    static const TQMetaData signal_tbl[] = {
	{ "configurationChanged()", &signal_0, TQMetaData::Public }
    };
    metaObj = TQMetaObject::new_metaobject(
	"CommandConfWidget", parentObject,
	slot_tbl, 1,
	signal_tbl, 1,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_CommandConfWidget.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

// TQ_SIGNAL configurationChanged
void CommandConfWidget::configurationChanged()
{
    activate_signal( staticMetaObject()->signalOffset() + 0 );
}

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

bool CommandConfWidget::tqt_emit( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: configurationChanged(); break;
    default:
	return TQWidget::tqt_emit(_id,_o);
    }
    return true;
}
#ifndef TQT_NO_PROPERTIES

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

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