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

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

#include "domtreeviewbase.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <ktextedit.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqframe.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqwidgetstack.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a DOMTreeViewBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
DOMTreeViewBase::DOMTreeViewBase( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "DOMTreeViewBase" );
    setMinimumSize( TQSize( 600, 380 ) );
    DOMTreeViewBaseLayout = new TQVBoxLayout( this, 11, 6, "DOMTreeViewBaseLayout"); 

    messageLinePane = new TQFrame( this, "messageLinePane" );
    messageLinePane->setPaletteBackgroundColor( TQColor( 170, 0, 127 ) );
    messageLinePane->setFrameShape( TQFrame::Panel );
    messageLinePane->setFrameShadow( TQFrame::Plain );
    messageLinePaneLayout = new TQHBoxLayout( messageLinePane, 1, 0, "messageLinePaneLayout"); 

    messageLine = new KLineEdit( messageLinePane, "messageLine" );
    messageLine->setPaletteForegroundColor( TQColor( 255, 255, 127 ) );
    messageLine->setPaletteBackgroundColor( TQColor( 170, 0, 127 ) );
    TQFont messageLine_font(  messageLine->font() );
    messageLine_font.setBold( true );
    messageLine->setFont( messageLine_font ); 
    messageLine->setFrame( false );
    messageLine->setReadOnly( true );
    messageLinePaneLayout->addWidget( messageLine );

    messageListBtn = new KPushButton( messageLinePane, "messageListBtn" );
    TQFont messageListBtn_font(  messageListBtn->font() );
    messageListBtn_font.setPointSize( 10 );
    messageListBtn->setFont( messageListBtn_font ); 
    messageListBtn->setFlat( true );
    messageLinePaneLayout->addWidget( messageListBtn );
    spacer5 = new TQSpacerItem( 10, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    messageLinePaneLayout->addItem( spacer5 );

    messageHideBtn = new KPushButton( messageLinePane, "messageHideBtn" );
    TQFont messageHideBtn_font(  messageHideBtn->font() );
    messageHideBtn_font.setPointSize( 10 );
    messageHideBtn->setFont( messageHideBtn_font ); 
    messageHideBtn->setFlat( true );
    messageLinePaneLayout->addWidget( messageHideBtn );
    DOMTreeViewBaseLayout->addWidget( messageLinePane );

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

    m_listView = new TDEListView( this, "m_listView" );
    m_listView->addColumn( tr2i18n( "DOM Tree" ) );
    m_listView->setAcceptDrops( true );
    m_listView->setProperty( "selectionMode", "Extended" );
    m_listView->setRootIsDecorated( true );
    m_listView->setDragEnabled( true );
    layout7->addWidget( m_listView );

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

    layout4 = new TQGridLayout( 0, 1, 1, 0, 6, "layout4"); 

    textLabel1_2_3 = new TQLabel( groupBox1, "textLabel1_2_3" );

    layout4->addWidget( textLabel1_2_3, 3, 0 );

    textLabel1_2_2 = new TQLabel( groupBox1, "textLabel1_2_2" );

    layout4->addWidget( textLabel1_2_2, 2, 0 );

    textLabel1_2 = new TQLabel( groupBox1, "textLabel1_2" );

    layout4->addWidget( textLabel1_2, 1, 0 );

    textLabel1 = new TQLabel( groupBox1, "textLabel1" );

    layout4->addWidget( textLabel1, 0, 0 );

    nodeNamespace = new KLineEdit( groupBox1, "nodeNamespace" );
    nodeNamespace->setEnabled( true );
    nodeNamespace->setFrameShape( KLineEdit::NoFrame );
    nodeNamespace->setLineWidth( 0 );
    nodeNamespace->setReadOnly( true );

    layout4->addWidget( nodeNamespace, 1, 1 );

    nodeValue = new KLineEdit( groupBox1, "nodeValue" );
    nodeValue->setEnabled( true );
    nodeValue->setFrameShape( KLineEdit::NoFrame );
    nodeValue->setLineWidth( 0 );
    nodeValue->setReadOnly( true );

    layout4->addWidget( nodeValue, 3, 1 );

    nodeType = new KLineEdit( groupBox1, "nodeType" );
    nodeType->setEnabled( true );
    nodeType->setFrameShape( KLineEdit::NoFrame );
    nodeType->setLineWidth( 0 );
    nodeType->setReadOnly( true );

    layout4->addWidget( nodeType, 2, 1 );

    nodeName = new KLineEdit( groupBox1, "nodeName" );
    nodeName->setEnabled( true );
    nodeName->setFrameShape( KLineEdit::NoFrame );
    nodeName->setLineWidth( 0 );
    nodeName->setReadOnly( true );

    layout4->addWidget( nodeName, 0, 1 );
    groupBox1Layout->addLayout( layout4 );

    nodeInfoStack = new TQWidgetStack( groupBox1, "nodeInfoStack" );

    ElementInfo = new TQWidget( nodeInfoStack, "ElementInfo" );
    ElementInfoLayout = new TQVBoxLayout( ElementInfo, 0, 6, "ElementInfoLayout"); 

    nodeAttributes = new TDEListView( ElementInfo, "nodeAttributes" );
    nodeAttributes->addColumn( tr2i18n( "Name" ) );
    nodeAttributes->addColumn( tr2i18n( "Value" ) );
    nodeAttributes->setFocusPolicy( TDEListView::StrongFocus );
    nodeAttributes->setProperty( "selectionMode", "Extended" );
    nodeAttributes->setAllColumnsShowFocus( true );
    nodeAttributes->setShowSortIndicator( true );
    nodeAttributes->setItemsMovable( false );
    ElementInfoLayout->addWidget( nodeAttributes );
    nodeInfoStack->addWidget( ElementInfo, 0 );

    CharacterData = new TQWidget( nodeInfoStack, "CharacterData" );
    CharacterDataLayout = new TQVBoxLayout( CharacterData, 0, 0, "CharacterDataLayout"); 

    contentEditor = new KTextEdit( CharacterData, "contentEditor" );
    contentEditor->setTextFormat( KTextEdit::PlainText );
    contentEditor->setTabChangesFocus( false );
    CharacterDataLayout->addWidget( contentEditor );

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

    applyContent = new TQPushButton( CharacterData, "applyContent" );
    layout3->addWidget( applyContent );
    spacer1 = new TQSpacerItem( 81, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout3->addItem( spacer1 );
    CharacterDataLayout->addLayout( layout3 );
    nodeInfoStack->addWidget( CharacterData, 1 );

    Empty = new TQWidget( nodeInfoStack, "Empty" );
    nodeInfoStack->addWidget( Empty, 2 );
    groupBox1Layout->addWidget( nodeInfoStack );
    layout7->addWidget( groupBox1 );
    DOMTreeViewBaseLayout->addLayout( layout7 );

    groupBox2 = new TQGroupBox( this, "groupBox2" );
    groupBox2->setColumnLayout(0, TQt::Vertical );
    groupBox2->layout()->setSpacing( 6 );
    groupBox2->layout()->setMargin( 11 );
    groupBox2Layout = new TQHBoxLayout( groupBox2->layout() );
    groupBox2Layout->setAlignment( TQt::AlignTop );

    m_pureCheckBox = new TQCheckBox( groupBox2, "m_pureCheckBox" );
    m_pureCheckBox->setChecked( true );
    groupBox2Layout->addWidget( m_pureCheckBox );

    m_showAttributesCheckBox = new TQCheckBox( groupBox2, "m_showAttributesCheckBox" );
    m_showAttributesCheckBox->setChecked( true );
    groupBox2Layout->addWidget( m_showAttributesCheckBox );

    m_highlightHTMLCheckBox = new TQCheckBox( groupBox2, "m_highlightHTMLCheckBox" );
    m_highlightHTMLCheckBox->setChecked( true );
    groupBox2Layout->addWidget( m_highlightHTMLCheckBox );
    DOMTreeViewBaseLayout->addWidget( groupBox2 );
    languageChange();
    resize( TQSize(600, 508).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( m_listView, nodeName );
    setTabOrder( nodeName, nodeNamespace );
    setTabOrder( nodeNamespace, nodeType );
    setTabOrder( nodeType, nodeValue );
    setTabOrder( nodeValue, contentEditor );
    setTabOrder( contentEditor, applyContent );
    setTabOrder( applyContent, m_pureCheckBox );
    setTabOrder( m_pureCheckBox, m_showAttributesCheckBox );
    setTabOrder( m_showAttributesCheckBox, m_highlightHTMLCheckBox );
    setTabOrder( m_highlightHTMLCheckBox, nodeAttributes );

    // buddies
    textLabel1_2_3->setBuddy( nodeValue );
    textLabel1_2_2->setBuddy( nodeType );
    textLabel1_2->setBuddy( nodeNamespace );
    textLabel1->setBuddy( nodeName );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void DOMTreeViewBase::languageChange()
{
    setCaption( tr2i18n( "DOM Tree Viewer" ) );
    messageListBtn->setText( tr2i18n( "&List" ) );
    messageHideBtn->setText( tr2i18n( "H&ide" ) );
    m_listView->header()->setLabel( 0, tr2i18n( "DOM Tree" ) );
    groupBox1->setTitle( tr2i18n( "DOM Node Info" ) );
    textLabel1_2_3->setText( tr2i18n( "Node &value:" ) );
    textLabel1_2_2->setText( tr2i18n( "Node &type:" ) );
    textLabel1_2->setText( tr2i18n( "Namespace &URI:" ) );
    textLabel1->setText( tr2i18n( "Node &name:" ) );
    nodeAttributes->header()->setLabel( 0, tr2i18n( "Name" ) );
    nodeAttributes->header()->setLabel( 1, tr2i18n( "Value" ) );
    applyContent->setText( tr2i18n( "Appl&y" ) );
    groupBox2->setTitle( tr2i18n( "DOM Tree Options" ) );
    m_pureCheckBox->setText( tr2i18n( "&Pure" ) );
    m_showAttributesCheckBox->setText( tr2i18n( "Show &attributes" ) );
    m_highlightHTMLCheckBox->setText( tr2i18n( "Highlight &HTML" ) );
}

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

TQMetaObject *DOMTreeViewBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_DOMTreeViewBase( "DOMTreeViewBase", &DOMTreeViewBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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