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

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

#include "kxetexteditordialogbase.h"

#include <ntqvariant.h>
#include <ktextedit.h>
#include <ntqpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a KXETextEditorDialogBase 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.
 */
KXETextEditorDialogBase::KXETextEditorDialogBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "KXETextEditorDialogBase" );
    setSizeGripEnabled( true );
    KXETextEditorDialogBaseLayout = new TQGridLayout( this, 1, 1, 11, 6, "KXETextEditorDialogBaseLayout"); 

    m_pTextEditor = new KTextEdit( this, "m_pTextEditor" );
    TQFont m_pTextEditor_font(  m_pTextEditor->font() );
    m_pTextEditor_font.setFamily( "Courier" );
    m_pTextEditor->setFont( m_pTextEditor_font ); 
    m_pTextEditor->setVScrollBarMode( KTextEdit::AlwaysOn );
    m_pTextEditor->setHScrollBarMode( KTextEdit::Auto );
    m_pTextEditor->setTextFormat( KTextEdit::PlainText );
    m_pTextEditor->setWordWrap( KTextEdit::NoWrap );
    m_pTextEditor->setAutoFormatting( int( KTextEdit::AutoAll ) );

    KXETextEditorDialogBaseLayout->addMultiCellWidget( m_pTextEditor, 0, 0, 0, 3 );

    m_pButtonOk = new TQPushButton( this, "m_pButtonOk" );
    m_pButtonOk->setEnabled( true );
    m_pButtonOk->setAutoDefault( true );
    m_pButtonOk->setDefault( true );

    KXETextEditorDialogBaseLayout->addWidget( m_pButtonOk, 1, 2 );

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

    KXETextEditorDialogBaseLayout->addWidget( m_pButtonCancel, 1, 3 );

    m_pButtonValidate = new TQPushButton( this, "m_pButtonValidate" );

    KXETextEditorDialogBaseLayout->addWidget( m_pButtonValidate, 1, 0 );
    Horizontal_Spacing2 = new TQSpacerItem( 160, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    KXETextEditorDialogBaseLayout->addItem( Horizontal_Spacing2, 1, 1 );
    languageChange();
    resize( TQSize(511, 318).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_pButtonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( m_pButtonCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( m_pButtonValidate, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotValidate() ) );

    // tab order
    setTabOrder( m_pTextEditor, m_pButtonValidate );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KXETextEditorDialogBase::languageChange()
{
    setCaption( tr2i18n( "Edit XML as raw text" ) );
    TQWhatsThis::add( m_pTextEditor, tr2i18n( "You can edit your XML document as raw text in this editor." ) );
    m_pButtonOk->setText( tr2i18n( "&OK" ) );
    m_pButtonCancel->setText( tr2i18n( "&Cancel" ) );
    m_pButtonValidate->setText( tr2i18n( "&Validate" ) );
    TQWhatsThis::add( m_pButtonValidate, tr2i18n( "<b>Validate</b><br/>\n"
"Press this button, if you want your XML document in the above editor to be validated." ) );
}

void KXETextEditorDialogBase::slotValidate()
{
    tqWarning( "KXETextEditorDialogBase::slotValidate(): Not implemented yet" );
}

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

TQMetaObject *KXETextEditorDialogBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KXETextEditorDialogBase( "KXETextEditorDialogBase", &KXETextEditorDialogBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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