#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/usr/src/ports/kdelibs3/kdelibs3-3.5.10-11.i686/src/kdelibs-3.5.10/khtml/htmlpageinfo.ui'
**
** Created by User Interface Compiler
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "htmlpageinfo.h"

#include <qvariant.h>
#include <kdialog.h>
#include <qpushbutton.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qheader.h>
#include <qlistview.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "kactivelabel.h"
#include "kpushbutton.h"

/*
 *  Constructs a KHTMLInfoDlg as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
KHTMLInfoDlg::KHTMLInfoDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "HTMLPageInfo" );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
    HTMLPageInfoLayout = new QGridLayout( this, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "HTMLPageInfoLayout"); 

    groupBox2 = new QGroupBox( this, "groupBox2" );
    groupBox2->setColumnLayout(0, Qt::Vertical );
    groupBox2->layout()->setSpacing( KDialog::spacingHint() );
    groupBox2->layout()->setMargin( KDialog::marginHint() );
    groupBox2Layout = new QHBoxLayout( groupBox2->layout() );
    groupBox2Layout->setAlignment( Qt::AlignTop );

    layout1 = new QGridLayout( 0, 1, 1, 0, KDialog::spacingHint(), "layout1"); 

    urlLabel = new QLabel( groupBox2, "urlLabel" );
    urlLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, urlLabel->sizePolicy().hasHeightForWidth() ) );

    layout1->addWidget( urlLabel, 1, 0 );

    _title = new KActiveLabel( groupBox2, "_title" );
    _title->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 1, 0, _title->sizePolicy().hasHeightForWidth() ) );

    layout1->addWidget( _title, 0, 1 );

    _url = new KActiveLabel( groupBox2, "_url" );
    _url->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 1, 0, _url->sizePolicy().hasHeightForWidth() ) );

    layout1->addWidget( _url, 1, 1 );

    _lastModified = new QLabel( groupBox2, "_lastModified" );
    _lastModified->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 1, 0, _lastModified->sizePolicy().hasHeightForWidth() ) );

    layout1->addWidget( _lastModified, 2, 1 );

    titleLabel = new QLabel( groupBox2, "titleLabel" );
    titleLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, titleLabel->sizePolicy().hasHeightForWidth() ) );

    layout1->addWidget( titleLabel, 0, 0 );

    _lmLabel = new QLabel( groupBox2, "_lmLabel" );
    _lmLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, _lmLabel->sizePolicy().hasHeightForWidth() ) );

    layout1->addWidget( _lmLabel, 2, 0 );

    _eLabel = new QLabel( groupBox2, "_eLabel" );
    _eLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, _eLabel->sizePolicy().hasHeightForWidth() ) );

    layout1->addWidget( _eLabel, 3, 0 );

    _encoding = new KActiveLabel( groupBox2, "_encoding" );
    _encoding->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 1, 0, _encoding->sizePolicy().hasHeightForWidth() ) );

    layout1->addWidget( _encoding, 3, 1 );
    groupBox2Layout->addLayout( layout1 );

    HTMLPageInfoLayout->addMultiCellWidget( groupBox2, 0, 0, 0, 1 );

    groupBox1 = new QGroupBox( this, "groupBox1" );
    groupBox1->setColumnLayout(0, Qt::Vertical );
    groupBox1->layout()->setSpacing( KDialog::spacingHint() );
    groupBox1->layout()->setMargin( KDialog::marginHint() );
    groupBox1Layout = new QVBoxLayout( groupBox1->layout() );
    groupBox1Layout->setAlignment( Qt::AlignTop );

    _headers = new QListView( groupBox1, "_headers" );
    _headers->addColumn( tr2i18n( "Property" ) );
    _headers->addColumn( tr2i18n( "Value" ) );
    _headers->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 1, 1, _headers->sizePolicy().hasHeightForWidth() ) );
    _headers->setSelectionMode( QListView::NoSelection );
    _headers->setResizeMode( QListView::LastColumn );
    groupBox1Layout->addWidget( _headers );

    HTMLPageInfoLayout->addMultiCellWidget( groupBox1, 1, 1, 0, 1 );

    _close = new KPushButton( this, "_close" );
    _close->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, _close->sizePolicy().hasHeightForWidth() ) );
    _close->setDefault( TRUE );

    HTMLPageInfoLayout->addWidget( _close, 2, 1 );
    Spacer3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    HTMLPageInfoLayout->addItem( Spacer3, 2, 0 );
    languageChange();
    resize( QSize(550, 519).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( _close, SIGNAL( clicked() ), this, SLOT( close() ) );

    // tab order
    setTabOrder( _close, _url );
    setTabOrder( _url, _headers );

    // buddies
    urlLabel->setBuddy( _url );
    titleLabel->setBuddy( _title );
    _lmLabel->setBuddy( _lastModified );
    _eLabel->setBuddy( _encoding );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KHTMLInfoDlg::languageChange()
{
    setCaption( tr2i18n( "Document Information" ) );
    groupBox2->setTitle( tr2i18n( "General" ) );
    urlLabel->setText( tr2i18n( "URL:" ) );
    titleLabel->setText( tr2i18n( "Title:" ) );
    _lmLabel->setText( tr2i18n( "Last modified:" ) );
    _eLabel->setText( tr2i18n( "Document encoding:" ) );
    groupBox1->setTitle( tr2i18n( "HTTP Headers" ) );
    _headers->header()->setLabel( 0, tr2i18n( "Property" ) );
    _headers->header()->setLabel( 1, tr2i18n( "Value" ) );
    _close->setText( tr2i18n( "&Close" ) );
}

#include "htmlpageinfo.moc"
