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

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

#include "htmldocumentpropertiesui.h"

#include <ntqvariant.h>
#include <kpushbutton.h>
#include <kurlrequester.h>
#include <klineedit.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqframe.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>

#include "tagattributetree.h"

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

    listView1 = new TQListView( this, "listView1" );
    listView1->addColumn( tr2i18n( "Column 1" ) );
    listView1->setMaximumSize( TQSize( 0, 0 ) );

    htmlDocumentPropertiesuiLayout->addWidget( listView1, 0, 0 );

    line1 = new TQFrame( this, "line1" );
    line1->setFrameShape( TQFrame::HLine );
    line1->setFrameShadow( TQFrame::Sunken );
    line1->setFrameShape( TQFrame::HLine );

    htmlDocumentPropertiesuiLayout->addMultiCellWidget( line1, 9, 10, 0, 6 );

    textLabel1 = new TQLabel( this, "textLabel1" );
    textLabel1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) );

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

    textLabel2 = new TQLabel( this, "textLabel2" );
    textLabel2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, textLabel2->sizePolicy().hasHeightForWidth() ) );

    htmlDocumentPropertiesuiLayout->addWidget( textLabel2, 1, 0 );

    textLabel1_2 = new TQLabel( this, "textLabel1_2" );
    textLabel1_2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, textLabel1_2->sizePolicy().hasHeightForWidth() ) );

    htmlDocumentPropertiesuiLayout->addWidget( textLabel1_2, 8, 0 );

    textLabel3 = new TQLabel( this, "textLabel3" );
    textLabel3->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, textLabel3->sizePolicy().hasHeightForWidth() ) );

    htmlDocumentPropertiesuiLayout->addWidget( textLabel3, 2, 0 );
    spacer7 = new TQSpacerItem( 21, 86, TQSizePolicy::Minimum, TQSizePolicy::Preferred );
    htmlDocumentPropertiesuiLayout->addMultiCell( spacer7, 3, 4, 0, 0 );

    textLabel4 = new TQLabel( this, "textLabel4" );
    textLabel4->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, textLabel4->sizePolicy().hasHeightForWidth() ) );

    htmlDocumentPropertiesuiLayout->addWidget( textLabel4, 5, 0 );
    spacer8 = new TQSpacerItem( 21, 84, TQSizePolicy::Minimum, TQSizePolicy::Preferred );
    htmlDocumentPropertiesuiLayout->addMultiCell( spacer8, 6, 7, 0, 0 );
    spacer10 = new TQSpacerItem( 226, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    htmlDocumentPropertiesuiLayout->addMultiCell( spacer10, 11, 11, 0, 1 );

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

    htmlDocumentPropertiesuiLayout->addMultiCellWidget( ok, 10, 11, 3, 4 );
    spacer11 = new TQSpacerItem( 41, 20, TQSizePolicy::Preferred, TQSizePolicy::Minimum );
    htmlDocumentPropertiesuiLayout->addItem( spacer11, 11, 5 );

    cssRules = new DualEditableTree( this, "cssRules" );
    cssRules->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)7, 0, 0, cssRules->sizePolicy().hasHeightForWidth() ) );

    htmlDocumentPropertiesuiLayout->addMultiCellWidget( cssRules, 5, 6, 1, 6 );

    metaItems = new DualEditableTree( this, "metaItems" );
    metaItems->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)7, 0, 0, metaItems->sizePolicy().hasHeightForWidth() ) );

    htmlDocumentPropertiesuiLayout->addMultiCellWidget( metaItems, 2, 3, 1, 6 );

    cssStylesheet = new KURLRequester( this, "cssStylesheet" );
    cssStylesheet->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, cssStylesheet->sizePolicy().hasHeightForWidth() ) );

    htmlDocumentPropertiesuiLayout->addMultiCellWidget( cssStylesheet, 8, 8, 1, 6 );

    cssRulesAdd = new KPushButton( this, "cssRulesAdd" );
    cssRulesAdd->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)0, 0, 0, cssRulesAdd->sizePolicy().hasHeightForWidth() ) );

    htmlDocumentPropertiesuiLayout->addWidget( cssRulesAdd, 7, 1 );

    metaItemsAdd = new KPushButton( this, "metaItemsAdd" );
    metaItemsAdd->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)0, 0, 0, metaItemsAdd->sizePolicy().hasHeightForWidth() ) );

    htmlDocumentPropertiesuiLayout->addWidget( metaItemsAdd, 4, 1 );

    metaItemsDelete = new KPushButton( this, "metaItemsDelete" );
    metaItemsDelete->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)0, 0, 0, metaItemsDelete->sizePolicy().hasHeightForWidth() ) );

    htmlDocumentPropertiesuiLayout->addMultiCellWidget( metaItemsDelete, 4, 4, 2, 4 );

    cssRulesEdit = new KPushButton( this, "cssRulesEdit" );
    cssRulesEdit->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)0, 0, 0, cssRulesEdit->sizePolicy().hasHeightForWidth() ) );

    htmlDocumentPropertiesuiLayout->addMultiCellWidget( cssRulesEdit, 7, 7, 2, 3 );

    cssRulesDelete = new KPushButton( this, "cssRulesDelete" );
    cssRulesDelete->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)0, 0, 0, cssRulesDelete->sizePolicy().hasHeightForWidth() ) );

    htmlDocumentPropertiesuiLayout->addMultiCellWidget( cssRulesDelete, 7, 7, 4, 6 );

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

    htmlDocumentPropertiesuiLayout->addMultiCellWidget( cancel, 10, 11, 6, 6 );

    title = new KLineEdit( this, "title" );
    title->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, title->sizePolicy().hasHeightForWidth() ) );
    title->setMinimumSize( TQSize( 250, 0 ) );

    htmlDocumentPropertiesuiLayout->addMultiCellWidget( title, 1, 1, 1, 6 );

    currentDTD = new KLineEdit( this, "currentDTD" );
    currentDTD->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, currentDTD->sizePolicy().hasHeightForWidth() ) );
    currentDTD->setMinimumSize( TQSize( 250, 0 ) );
    currentDTD->setReadOnly( true );

    htmlDocumentPropertiesuiLayout->addMultiCellWidget( currentDTD, 0, 0, 1, 6 );
    languageChange();
    resize( TQSize(479, 423).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( currentDTD, title );
    setTabOrder( title, metaItemsAdd );
    setTabOrder( metaItemsAdd, metaItemsDelete );
    setTabOrder( metaItemsDelete, cssRulesAdd );
    setTabOrder( cssRulesAdd, cssRulesEdit );
    setTabOrder( cssRulesEdit, cssRulesDelete );
    setTabOrder( cssRulesDelete, cssStylesheet );
    setTabOrder( cssStylesheet, listView1 );
    setTabOrder( listView1, ok );
    setTabOrder( ok, cancel );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void htmlDocumentPropertiesui::languageChange()
{
    setCaption( tr2i18n( "Document Properties" ) );
    listView1->header()->setLabel( 0, tr2i18n( "Column 1" ) );
    listView1->clear();
    TQListViewItem * item = new TQListViewItem( listView1, 0 );
    item->setText( 0, tr2i18n( "New Item" ) );

    textLabel1->setText( tr2i18n( "Current DTD: " ) );
    textLabel2->setText( tr2i18n( "Title: " ) );
    textLabel1_2->setText( tr2i18n( "Link CSS stylesheet:" ) );
    textLabel3->setText( tr2i18n( "Meta items:" ) );
    textLabel4->setText( tr2i18n( "CSS rules:" ) );
    ok->setText( tr2i18n( "&OK" ) );
    cssRulesAdd->setText( tr2i18n( "Add" ) );
    metaItemsAdd->setText( tr2i18n( "Add" ) );
    metaItemsDelete->setText( tr2i18n( "Remove" ) );
    cssRulesEdit->setText( tr2i18n( "Edit" ) );
    cssRulesDelete->setText( tr2i18n( "Remove" ) );
    cancel->setText( tr2i18n( "&Cancel" ) );
}

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

TQMetaObject *htmlDocumentPropertiesui::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_htmlDocumentPropertiesui( "htmlDocumentPropertiesui", &htmlDocumentPropertiesui::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* htmlDocumentPropertiesui::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 = {"newMetaItem", 0, 0 };
    static const TQUMethod slot_2 = {"deleteCurrentMetaItem", 0, 0 };
    static const TQUMethod slot_3 = {"newCSSRule", 0, 0 };
    static const TQUMethod slot_4 = {"editCSSRule", 0, 0 };
    static const TQUMethod slot_5 = {"deleteCurrentCSSRule", 0, 0 };
    static const TQUParameter param_slot_6[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_6 = {"titleChanged", 1, param_slot_6 };
    static const TQUParameter param_slot_7[] = {
	{ 0, &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_7 = {"metaChanged", 1, param_slot_7 };
    static const TQUParameter param_slot_8[] = {
	{ 0, &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_8 = {"CSSChanged", 1, param_slot_8 };
    static const TQUParameter param_slot_9[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_9 = {"linkChanged", 1, param_slot_9 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "newMetaItem()", &slot_1, TQMetaData::Protected },
	{ "deleteCurrentMetaItem()", &slot_2, TQMetaData::Protected },
	{ "newCSSRule()", &slot_3, TQMetaData::Protected },
	{ "editCSSRule()", &slot_4, TQMetaData::Protected },
	{ "deleteCurrentCSSRule()", &slot_5, TQMetaData::Protected },
	{ "titleChanged(const TQString&)", &slot_6, TQMetaData::Protected },
	{ "metaChanged(TQListViewItem*)", &slot_7, TQMetaData::Protected },
	{ "CSSChanged(TQListViewItem*)", &slot_8, TQMetaData::Protected },
	{ "linkChanged(const TQString&)", &slot_9, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"htmlDocumentPropertiesui", parentObject,
	slot_tbl, 10,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_htmlDocumentPropertiesui.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool htmlDocumentPropertiesui::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: newMetaItem(); break;
    case 2: deleteCurrentMetaItem(); break;
    case 3: newCSSRule(); break;
    case 4: editCSSRule(); break;
    case 5: deleteCurrentCSSRule(); break;
    case 6: titleChanged((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 7: metaChanged((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 8: CSSChanged((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 9: linkChanged((const TQString&)static_QUType_TQString.get(_o+1)); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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