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

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

#include "regexptestdlgbase.h"

#include <ntqvariant.h>
#include <kdialog.h>
#include <klineedit.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a RegexpTestDialogBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
RegexpTestDialogBase::RegexpTestDialogBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "regexp_test_dialog" );
    setSizeGripEnabled( false );
    regexp_test_dialogLayout = new TQGridLayout( this, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "regexp_test_dialogLayout"); 

    pattern_label = new TQLabel( this, "pattern_label" );

    regexp_test_dialogLayout->addWidget( pattern_label, 0, 0 );

    teststring_label = new TQLabel( this, "teststring_label" );

    regexp_test_dialogLayout->addWidget( teststring_label, 2, 0 );

    teststring_edit = new KLineEdit( this, "teststring_edit" );

    regexp_test_dialogLayout->addMultiCellWidget( teststring_edit, 2, 2, 1, 2 );

    success_label = new TQLabel( this, "success_label" );
    success_label->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, success_label->sizePolicy().hasHeightForWidth() ) );

    regexp_test_dialogLayout->addMultiCellWidget( success_label, 3, 3, 1, 2 );

    Layout4 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "Layout4"); 

    insertbutton = new TQPushButton( this, "insertbutton" );
    insertbutton->setDefault( true );
    Layout4->addWidget( insertbutton );
    Horizontal_Spacing2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout4->addItem( Horizontal_Spacing2 );

    cancelbutton = new TQPushButton( this, "cancelbutton" );
    cancelbutton->setAutoDefault( true );
    Layout4->addWidget( cancelbutton );

    regexp_test_dialogLayout->addMultiCellLayout( Layout4, 5, 5, 0, 2 );

    pattern_edit = new KLineEdit( this, "pattern_edit" );

    regexp_test_dialogLayout->addWidget( pattern_edit, 0, 1 );

    flavor_group = new TQButtonGroup( this, "flavor_group" );
    flavor_group->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)4, 0, 0, flavor_group->sizePolicy().hasHeightForWidth() ) );
    flavor_group->setColumnLayout(0, TQt::Vertical );
    flavor_group->layout()->setSpacing( KDialog::spacingHint() );
    flavor_group->layout()->setMargin( KDialog::marginHint() );
    flavor_groupLayout = new TQVBoxLayout( flavor_group->layout() );
    flavor_groupLayout->setAlignment( TQt::AlignTop );

    basicposix_button = new TQRadioButton( flavor_group, "basicposix_button" );
    basicposix_button->setChecked( true );
    flavor_groupLayout->addWidget( basicposix_button );

    extendedposix_button = new TQRadioButton( flavor_group, "extendedposix_button" );
    flavor_groupLayout->addWidget( extendedposix_button );

    qregexp_button = new TQRadioButton( flavor_group, "qregexp_button" );
    flavor_groupLayout->addWidget( qregexp_button );

    qregexp_min_button = new TQRadioButton( flavor_group, "qregexp_min_button" );
    flavor_groupLayout->addWidget( qregexp_min_button );

    kregexp_button = new TQRadioButton( flavor_group, "kregexp_button" );
    flavor_groupLayout->addWidget( kregexp_button );

    regexp_test_dialogLayout->addMultiCellWidget( flavor_group, 1, 1, 0, 2 );

    rxedit_button = new TQPushButton( this, "rxedit_button" );
    rxedit_button->setAutoDefault( true );

    regexp_test_dialogLayout->addWidget( rxedit_button, 0, 2 );

    layout2 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout2"); 

    subgroups_label = new TQLabel( this, "subgroups_label" );
    layout2->addWidget( subgroups_label );

    subgroups_listview = new TQListView( this, "subgroups_listview" );
    subgroups_listview->addColumn( tr2i18n( "Group" ) );
    subgroups_listview->addColumn( tr2i18n( "Value" ) );
    subgroups_listview->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, subgroups_listview->sizePolicy().hasHeightForWidth() ) );
    subgroups_listview->setAllColumnsShowFocus( true );
    subgroups_listview->setResizeMode( TQListView::AllColumns );
    layout2->addWidget( subgroups_listview );

    regexp_test_dialogLayout->addMultiCellLayout( layout2, 4, 4, 0, 2 );
    languageChange();
    resize( TQSize(541, 367).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( cancelbutton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( flavor_group, TQ_SIGNAL( clicked(int) ), this, TQ_SLOT( somethingChanged() ) );
    connect( pattern_edit, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( somethingChanged() ) );
    connect( teststring_edit, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( somethingChanged() ) );
    connect( insertbutton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( insertQuoted() ) );
    connect( rxedit_button, TQ_SIGNAL( clicked() ), this, TQ_SLOT( showRegExpEditor() ) );

    // tab order
    setTabOrder( pattern_edit, rxedit_button );
    setTabOrder( rxedit_button, basicposix_button );
    setTabOrder( basicposix_button, teststring_edit );
    setTabOrder( teststring_edit, subgroups_listview );
    setTabOrder( subgroups_listview, insertbutton );
    setTabOrder( insertbutton, cancelbutton );
    setTabOrder( cancelbutton, extendedposix_button );

    // buddies
    pattern_label->setBuddy( pattern_edit );
    teststring_label->setBuddy( teststring_edit );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void RegexpTestDialogBase::languageChange()
{
    setCaption( tr2i18n( "Test Regular Expression" ) );
    pattern_label->setText( tr2i18n( "&Regular expression:" ) );
    teststring_label->setText( tr2i18n( "&Test string:" ) );
    TQWhatsThis::add( teststring_edit, tr2i18n( "Enter a string which will be matched against the regular expression" ) );
    success_label->setText( TQString::null );
    insertbutton->setText( tr2i18n( "&Insert Quoted" ) );
    TQWhatsThis::add( insertbutton, tr2i18n( "Inserts the regular expression into the currently opened source code file. Escapes any special characters like backslash." ) );
    cancelbutton->setText( tr2i18n( "&Close" ) );
    TQWhatsThis::add( cancelbutton, tr2i18n( "Closes the dialog" ) );
    TQWhatsThis::add( pattern_edit, tr2i18n( "enter a regular expression, for example <tt>KD.*</tt>, which matches all strings beginning with \"KD\"" ) );
    flavor_group->setTitle( tr2i18n( "Regular Expression T&ype" ) );
    basicposix_button->setText( tr2i18n( "&Basic POSIX syntax (used by grep)" ) );
    TQWhatsThis::add( basicposix_button, tr2i18n( "A description of this syntax can be found in the grep manpage" ) );
    extendedposix_button->setText( tr2i18n( "E&xtended POSIX syntax (used by egrep)" ) );
    TQWhatsThis::add( extendedposix_button, tr2i18n( "A description of this syntax can be found in the grep manpage" ) );
    qregexp_button->setText( tr2i18n( "&QRegExp syntax" ) );
    TQWhatsThis::add( qregexp_button, tr2i18n( "A description of this syntax can be found in the documentation of the QRegExp class" ) );
    qregexp_min_button->setText( tr2i18n( "QRegExp syntax (&minimal)" ) );
    TQWhatsThis::add( qregexp_min_button, tr2i18n( "Matches a QRegExp non-greedy. Please read the QRegExp::setMinimal documentation for more details." ) );
    kregexp_button->setText( tr2i18n( "&KRegExp syntax" ) );
    TQWhatsThis::add( kregexp_button, tr2i18n( "A description of this syntax can be found in the TDE API documentation." ) );
    rxedit_button->setText( tr2i18n( "&Edit..." ) );
    subgroups_label->setText( tr2i18n( "Matched subgroups:" ) );
    subgroups_listview->header()->setLabel( 0, tr2i18n( "Group" ) );
    subgroups_listview->header()->setLabel( 1, tr2i18n( "Value" ) );
    TQWhatsThis::add( subgroups_listview, tr2i18n( "Shows which groups were matched. See the corresponding documentation for how groups are matched." ) );
}

void RegexpTestDialogBase::insertQuoted()
{
    tqWarning( "RegexpTestDialogBase::insertQuoted(): Not implemented yet" );
}

void RegexpTestDialogBase::somethingChanged()
{
    tqWarning( "RegexpTestDialogBase::somethingChanged(): Not implemented yet" );
}

void RegexpTestDialogBase::showRegExpEditor()
{
    tqWarning( "RegexpTestDialogBase::showRegExpEditor(): Not implemented yet" );
}

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

TQMetaObject *RegexpTestDialogBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_RegexpTestDialogBase( "RegexpTestDialogBase", &RegexpTestDialogBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* RegexpTestDialogBase::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 = TQDialog::staticMetaObject();
    static const TQUMethod slot_0 = {"somethingChanged", 0, 0 };
    static const TQUMethod slot_1 = {"languageChange", 0, 0 };
    static const TQUMethod slot_2 = {"insertQuoted", 0, 0 };
    static const TQUMethod slot_3 = {"showRegExpEditor", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "somethingChanged()", &slot_0, TQMetaData::Public },
	{ "languageChange()", &slot_1, TQMetaData::Protected },
	{ "insertQuoted()", &slot_2, TQMetaData::Protected },
	{ "showRegExpEditor()", &slot_3, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"RegexpTestDialogBase", parentObject,
	slot_tbl, 4,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_RegexpTestDialogBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool RegexpTestDialogBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: somethingChanged(); break;
    case 1: languageChange(); break;
    case 2: insertQuoted(); break;
    case 3: showRegExpEditor(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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