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

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

#include "highlight_preferencesui.h"

#include <ntqvariant.h>
#include <kcolorbutton.h>
#include <klineedit.h>
#include <kurlrequester.h>
#include <kpushbutton.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqtoolbutton.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

    highlightListView = new TDEListView( groupBox1, "highlightListView" );
    highlightListView->addColumn( tr2i18n( "RegEx" ) );
    highlightListView->addColumn( tr2i18n( "Highlights" ) );
    highlightListView->addColumn( tr2i18n( "Sound" ) );
    highlightListView->addColumn( tr2i18n( "Auto Text" ) );
    highlightListView->setAcceptDrops( true );
    highlightListView->setAllColumnsShowFocus( true );
    highlightListView->setFullWidth( true );
    highlightListView->setDragEnabled( true );

    groupBox1Layout->addMultiCellWidget( highlightListView, 0, 0, 0, 3 );

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

    newButton = new KPushButton( groupBox1, "newButton" );
    newButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, newButton->sizePolicy().hasHeightForWidth() ) );
    layout13->addWidget( newButton );

    removeButton = new KPushButton( groupBox1, "removeButton" );
    removeButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, removeButton->sizePolicy().hasHeightForWidth() ) );
    layout13->addWidget( removeButton );
    spacer27 = new TQSpacerItem( 20, 250, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout13->addItem( spacer27 );

    groupBox1Layout->addMultiCellLayout( layout13, 0, 4, 4, 4 );

    patternButton = new KPushButton( groupBox1, "patternButton" );
    patternButton->setEnabled( false );
    patternButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, patternButton->sizePolicy().hasHeightForWidth() ) );

    groupBox1Layout->addMultiCellWidget( patternButton, 1, 1, 2, 3 );

    patternLabel = new TQLabel( groupBox1, "patternLabel" );
    patternLabel->setEnabled( false );

    groupBox1Layout->addWidget( patternLabel, 1, 0 );

    patternInput = new KLineEdit( groupBox1, "patternInput" );
    patternInput->setEnabled( false );
    patternInput->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 1, 0, patternInput->sizePolicy().hasHeightForWidth() ) );

    groupBox1Layout->addWidget( patternInput, 1, 1 );

    colorLabel = new TQLabel( groupBox1, "colorLabel" );
    colorLabel->setEnabled( false );

    groupBox1Layout->addWidget( colorLabel, 2, 0 );

    patternColor = new KColorButton( groupBox1, "patternColor" );
    patternColor->setEnabled( false );

    groupBox1Layout->addMultiCellWidget( patternColor, 2, 2, 1, 3 );

    soundLabel = new TQLabel( groupBox1, "soundLabel" );
    soundLabel->setEnabled( false );

    groupBox1Layout->addWidget( soundLabel, 3, 0 );

    soundURL = new KURLRequester( groupBox1, "soundURL" );
    soundURL->setEnabled( false );
    soundURL->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, soundURL->sizePolicy().hasHeightForWidth() ) );

    groupBox1Layout->addMultiCellWidget( soundURL, 3, 3, 1, 2 );

    soundPlayBtn = new TQToolButton( groupBox1, "soundPlayBtn" );
    soundPlayBtn->setEnabled( false );
    soundPlayBtn->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, soundPlayBtn->sizePolicy().hasHeightForWidth() ) );

    groupBox1Layout->addWidget( soundPlayBtn, 3, 3 );

    autoTextLabel = new TQLabel( groupBox1, "autoTextLabel" );
    autoTextLabel->setEnabled( false );

    groupBox1Layout->addWidget( autoTextLabel, 4, 0 );

    autoTextInput = new KLineEdit( groupBox1, "autoTextInput" );
    autoTextInput->setEnabled( false );

    groupBox1Layout->addMultiCellWidget( autoTextInput, 4, 4, 1, 3 );

    Highlight_ConfigUILayout->addMultiCellWidget( groupBox1, 0, 0, 0, 2 );

    kcfg_HighlightSoundsEnabled = new TQCheckBox( this, "kcfg_HighlightSoundsEnabled" );

    Highlight_ConfigUILayout->addWidget( kcfg_HighlightSoundsEnabled, 1, 0 );

    kcfg_HighlightNickColor = new KColorButton( this, "kcfg_HighlightNickColor" );
    kcfg_HighlightNickColor->setEnabled( false );

    Highlight_ConfigUILayout->addWidget( kcfg_HighlightNickColor, 2, 1 );

    kcfg_HighlightOwnLinesColor = new KColorButton( this, "kcfg_HighlightOwnLinesColor" );
    kcfg_HighlightOwnLinesColor->setEnabled( false );

    Highlight_ConfigUILayout->addWidget( kcfg_HighlightOwnLinesColor, 3, 1 );

    kcfg_HighlightNick = new TQCheckBox( this, "kcfg_HighlightNick" );

    Highlight_ConfigUILayout->addWidget( kcfg_HighlightNick, 2, 0 );

    kcfg_HighlightOwnLines = new TQCheckBox( this, "kcfg_HighlightOwnLines" );

    Highlight_ConfigUILayout->addWidget( kcfg_HighlightOwnLines, 3, 0 );
    spacer11 = new TQSpacerItem( 120, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Highlight_ConfigUILayout->addMultiCell( spacer11, 1, 1, 1, 2 );
    spacer1 = new TQSpacerItem( 50, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Highlight_ConfigUILayout->addItem( spacer1, 2, 2 );
    spacer2 = new TQSpacerItem( 50, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Highlight_ConfigUILayout->addItem( spacer2, 3, 2 );
    languageChange();
    resize( TQSize(614, 585).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_HighlightNick, TQ_SIGNAL( toggled(bool) ), kcfg_HighlightNickColor, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_HighlightOwnLines, TQ_SIGNAL( toggled(bool) ), kcfg_HighlightOwnLinesColor, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( highlightListView, patternInput );
    setTabOrder( patternInput, patternButton );
    setTabOrder( patternButton, patternColor );
    setTabOrder( patternColor, soundURL );
    setTabOrder( soundURL, soundPlayBtn );
    setTabOrder( soundPlayBtn, autoTextInput );
    setTabOrder( autoTextInput, kcfg_HighlightSoundsEnabled );
    setTabOrder( kcfg_HighlightSoundsEnabled, kcfg_HighlightNick );
    setTabOrder( kcfg_HighlightNick, kcfg_HighlightNickColor );
    setTabOrder( kcfg_HighlightNickColor, kcfg_HighlightOwnLines );
    setTabOrder( kcfg_HighlightOwnLines, kcfg_HighlightOwnLinesColor );
    setTabOrder( kcfg_HighlightOwnLinesColor, newButton );
    setTabOrder( newButton, removeButton );

    // buddies
    patternLabel->setBuddy( patternInput );
    soundLabel->setBuddy( soundURL );
    autoTextLabel->setBuddy( autoTextInput );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void Highlight_ConfigUI::languageChange()
{
    groupBox1->setTitle( tr2i18n( "Highlight List" ) );
    highlightListView->header()->setLabel( 0, tr2i18n( "RegEx" ) );
    highlightListView->header()->setLabel( 1, tr2i18n( "Highlights" ) );
    highlightListView->header()->setLabel( 2, tr2i18n( "Sound" ) );
    highlightListView->header()->setLabel( 3, tr2i18n( "Auto Text" ) );
    newButton->setText( tr2i18n( "&New" ) );
    removeButton->setText( tr2i18n( "&Remove" ) );
    patternButton->setText( tr2i18n( "..." ) );
    TQToolTip::add( patternButton, tr2i18n( "Click to run Regular Expression Editor (KRegExpEditor)" ) );
    patternLabel->setText( tr2i18n( "&Pattern:" ) );
    colorLabel->setText( tr2i18n( "Color:" ) );
    patternColor->setText( TQString::null );
    soundLabel->setText( tr2i18n( "&Sound:" ) );
    soundURL->setFilter( tr2i18n( "audio/x-wav audio/x-mp3 application/ogg audio/x-adpcm" ) );
    soundPlayBtn->setText( TQString::null );
    TQToolTip::add( soundPlayBtn, tr2i18n( "Test sound" ) );
    autoTextLabel->setText( tr2i18n( "&Auto text:" ) );
    kcfg_HighlightSoundsEnabled->setText( tr2i18n( "Ena&ble sound for highlights" ) );
    kcfg_HighlightNickColor->setText( TQString::null );
    kcfg_HighlightOwnLinesColor->setText( TQString::null );
    kcfg_HighlightNick->setText( tr2i18n( "Alwa&ys highlight own current nick:" ) );
    kcfg_HighlightOwnLines->setText( tr2i18n( "Always highlight own &lines:" ) );
}

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

TQMetaObject *Highlight_ConfigUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_Highlight_ConfigUI( "Highlight_ConfigUI", &Highlight_ConfigUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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