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

#include "csscustom.h"

#include <qvariant.h>
#include <kdialog.h>
#include <qpushbutton.h>
#include <qgroupbox.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <kcolorbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "kcolorbutton.h"

/*
 *  Constructs a CSSCustomDialog as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
CSSCustomDialog::CSSCustomDialog( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "CSSCustomDialog" );
    CSSCustomDialogLayout = new QGridLayout( this, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "CSSCustomDialogLayout"); 

    GroupBox3 = new QGroupBox( this, "GroupBox3" );
    GroupBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, 0, 0, GroupBox3->sizePolicy().hasHeightForWidth() ) );
    GroupBox3->setColumnLayout(0, Qt::Vertical );
    GroupBox3->layout()->setSpacing( KDialog::spacingHint() );
    GroupBox3->layout()->setMargin( KDialog::marginHint() );
    GroupBox3Layout = new QGridLayout( GroupBox3->layout() );
    GroupBox3Layout->setAlignment( Qt::AlignTop );

    basefontsize = new QComboBox( FALSE, GroupBox3, "basefontsize" );
    basefontsize->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, 0, 0, basefontsize->sizePolicy().hasHeightForWidth() ) );
    basefontsize->setEditable( TRUE );

    GroupBox3Layout->addWidget( basefontsize, 0, 1 );

    txtFontsize = new QLabel( GroupBox3, "txtFontsize" );

    GroupBox3Layout->addWidget( txtFontsize, 0, 0 );

    dontScale = new QCheckBox( GroupBox3, "dontScale" );
    dontScale->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, dontScale->sizePolicy().hasHeightForWidth() ) );

    GroupBox3Layout->addMultiCellWidget( dontScale, 1, 1, 0, 1 );

    CSSCustomDialogLayout->addWidget( GroupBox3, 0, 1 );

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

    hideImages = new QCheckBox( GroupBox3_2, "hideImages" );

    GroupBox3_2Layout->addWidget( hideImages, 0, 0 );

    hideBackground = new QCheckBox( GroupBox3_2, "hideBackground" );
    hideBackground->setChecked( TRUE );

    GroupBox3_2Layout->addWidget( hideBackground, 1, 0 );

    CSSCustomDialogLayout->addMultiCellWidget( GroupBox3_2, 2, 2, 0, 1 );

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

    txtBaseFontFamily = new QLabel( GroupBox7, "txtBaseFontFamily" );

    GroupBox7Layout->addWidget( txtBaseFontFamily, 0, 0 );

    fontFamily = new QComboBox( FALSE, GroupBox7, "fontFamily" );
    fontFamily->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, fontFamily->sizePolicy().hasHeightForWidth() ) );

    GroupBox7Layout->addWidget( fontFamily, 0, 1 );
    Spacer7 = new QSpacerItem( 0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    GroupBox7Layout->addItem( Spacer7, 0, 2 );

    sameFamily = new QCheckBox( GroupBox7, "sameFamily" );

    GroupBox7Layout->addMultiCellWidget( sameFamily, 1, 1, 0, 2 );

    CSSCustomDialogLayout->addWidget( GroupBox7, 0, 0 );
    Spacer5_2 = new QSpacerItem( 20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
    CSSCustomDialogLayout->addItem( Spacer5_2, 4, 1 );

    Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1"); 

    preview = new QPushButton( this, "preview" );
    Layout1->addWidget( preview );
    Spacer1_4 = new QSpacerItem( 0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout1->addItem( Spacer1_4 );

    CSSCustomDialogLayout->addMultiCellLayout( Layout1, 3, 3, 0, 1 );

    ButtonGroup2 = new QButtonGroup( this, "ButtonGroup2" );
    ButtonGroup2->setExclusive( FALSE );
    ButtonGroup2->setRadioButtonExclusive( TRUE );
    ButtonGroup2->setColumnLayout(0, Qt::Vertical );
    ButtonGroup2->layout()->setSpacing( KDialog::spacingHint() );
    ButtonGroup2->layout()->setMargin( KDialog::marginHint() );
    ButtonGroup2Layout = new QVBoxLayout( ButtonGroup2->layout() );
    ButtonGroup2Layout->setAlignment( Qt::AlignTop );

    blackOnWhite = new QRadioButton( ButtonGroup2, "blackOnWhite" );
    blackOnWhite->setChecked( TRUE );
    ButtonGroup2Layout->addWidget( blackOnWhite );

    whiteOnBlack = new QRadioButton( ButtonGroup2, "whiteOnBlack" );
    ButtonGroup2Layout->addWidget( whiteOnBlack );

    customColor = new QRadioButton( ButtonGroup2, "customColor" );
    ButtonGroup2Layout->addWidget( customColor );

    Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2"); 

    foregroundColor = new KColorButton( ButtonGroup2, "foregroundColor" );

    Layout2->addWidget( foregroundColor, 1, 2 );
    Spacer9 = new QSpacerItem( 0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout2->addItem( Spacer9, 1, 3 );
    Spacer1 = new QSpacerItem( 21, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
    Layout2->addItem( Spacer1, 0, 0 );
    Spacer1_2 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
    Layout2->addItem( Spacer1_2, 1, 0 );
    Spacer8 = new QSpacerItem( 0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout2->addItem( Spacer8, 0, 3 );

    txtForeground = new QLabel( ButtonGroup2, "txtForeground" );

    Layout2->addWidget( txtForeground, 1, 1 );

    backgroundColor = new KColorButton( ButtonGroup2, "backgroundColor" );

    Layout2->addWidget( backgroundColor, 0, 2 );

    txtBackground = new QLabel( ButtonGroup2, "txtBackground" );

    Layout2->addWidget( txtBackground, 0, 1 );
    ButtonGroup2Layout->addLayout( Layout2 );

    sameColor = new QCheckBox( ButtonGroup2, "sameColor" );
    ButtonGroup2Layout->addWidget( sameColor );

    CSSCustomDialogLayout->addMultiCellWidget( ButtonGroup2, 1, 1, 0, 1 );
    languageChange();
    resize( QSize(584, 456).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( fontFamily, sameFamily );
    setTabOrder( sameFamily, basefontsize );
    setTabOrder( basefontsize, dontScale );
    setTabOrder( dontScale, blackOnWhite );
    setTabOrder( blackOnWhite, backgroundColor );
    setTabOrder( backgroundColor, foregroundColor );
    setTabOrder( foregroundColor, sameColor );
    setTabOrder( sameColor, hideImages );
    setTabOrder( hideImages, hideBackground );
    setTabOrder( hideBackground, preview );

    // buddies
    txtFontsize->setBuddy( basefontsize );
    txtBaseFontFamily->setBuddy( fontFamily );
    txtForeground->setBuddy( foregroundColor );
    txtBackground->setBuddy( backgroundColor );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void CSSCustomDialog::languageChange()
{
    QWhatsThis::add( this, tr2i18n( "<b>Stylesheets</b><p>See http://www.w3.org/Style/CSS for further information on cascading style sheets.</p>" ) );
    GroupBox3->setTitle( tr2i18n( "Font Size" ) );
    basefontsize->clear();
    basefontsize->insertItem( tr2i18n( "7" ) );
    basefontsize->insertItem( tr2i18n( "8" ) );
    basefontsize->insertItem( tr2i18n( "9" ) );
    basefontsize->insertItem( tr2i18n( "10" ) );
    basefontsize->insertItem( tr2i18n( "11" ) );
    basefontsize->insertItem( tr2i18n( "12" ) );
    basefontsize->insertItem( tr2i18n( "14" ) );
    basefontsize->insertItem( tr2i18n( "16" ) );
    basefontsize->insertItem( tr2i18n( "20" ) );
    basefontsize->insertItem( tr2i18n( "24" ) );
    basefontsize->insertItem( tr2i18n( "32" ) );
    basefontsize->insertItem( tr2i18n( "48" ) );
    basefontsize->insertItem( tr2i18n( "64" ) );
    txtFontsize->setText( tr2i18n( "Base font si&ze:" ) );
    dontScale->setText( tr2i18n( "&Use same size for all elements" ) );
    QWhatsThis::add( dontScale, tr2i18n( "<b>Use same size for all elements</b><p>Select this option to override custom font sizes in favor of the base font size. All fonts will be displayed in the same size.</p>" ) );
    GroupBox3_2->setTitle( tr2i18n( "Images" ) );
    QWhatsThis::add( GroupBox3_2, tr2i18n( "<b>Images</b><p>" ) );
    hideImages->setText( tr2i18n( "&Suppress images" ) );
    QWhatsThis::add( hideImages, tr2i18n( "<b>Suppress images</b><p>Selecting this will prevent Konqueror from loading images.</p>" ) );
    hideBackground->setText( tr2i18n( "Suppress background images" ) );
    QWhatsThis::add( hideBackground, tr2i18n( "<b>Suppress background images</b><p>Selecting this option will prevent Konqueror from loading background images.</p>" ) );
    GroupBox7->setTitle( tr2i18n( "Font Family" ) );
    QWhatsThis::add( GroupBox7, tr2i18n( "<b>Font family</b><p>A font family is a group of fonts that resemble one another, with family members that are e.g. bold, italic, or any number of the above.</p>" ) );
    txtBaseFontFamily->setText( tr2i18n( "Base fa&mily:" ) );
    QWhatsThis::add( fontFamily, tr2i18n( "<p>This is the currently selected font family</p>" ) );
    sameFamily->setText( tr2i18n( "Use same family for all text" ) );
    QWhatsThis::add( sameFamily, tr2i18n( "<b>Use same family for all text</b><p>Select this option to override custom fonts everywhere in favor of the base font.</p>" ) );
    preview->setText( tr2i18n( "&Preview" ) );
    QWhatsThis::add( preview, tr2i18n( "<b>Preview</b><p>Click on this button to see what your selections look like in action.</p>" ) );
    ButtonGroup2->setTitle( tr2i18n( "Colors" ) );
    blackOnWhite->setText( tr2i18n( "&Black on white" ) );
    QWhatsThis::add( blackOnWhite, tr2i18n( "<b>Black on White</b><p>This is what you normally see.</p>" ) );
    whiteOnBlack->setText( tr2i18n( "&White on black" ) );
    QWhatsThis::add( whiteOnBlack, tr2i18n( "<b>White on Black</b><p>This is your classic inverse color scheme.</p>" ) );
    customColor->setText( tr2i18n( "Cus&tom" ) );
    QWhatsThis::add( customColor, tr2i18n( "<b>Custom</b><p>Select this option to define a custom color for the default font.</p>" ) );
    foregroundColor->setText( QString::null );
    QWhatsThis::add( foregroundColor, tr2i18n( "<b>Foreground color</b><p>The foreground color is the color that the text is drawn in.</p>" ) );
    txtForeground->setText( tr2i18n( "&Foreground:" ) );
    QWhatsThis::add( txtForeground, tr2i18n( "<b>Foreground color</b><p>The foreground color is the color that the text is drawn in.</p>" ) );
    backgroundColor->setText( QString::null );
    QWhatsThis::add( backgroundColor, tr2i18n( "<b>Background</b><p>Behind this door lays the ability to choose a custom default background.</p>" ) );
    txtBackground->setText( tr2i18n( "Bac&kground:" ) );
    QWhatsThis::add( txtBackground, tr2i18n( "<b>Background</b><p>This background color is the one displayed behind the text by default. A background image will override this.</p>" ) );
    sameColor->setText( tr2i18n( "Use same color for all text" ) );
    QWhatsThis::add( sameColor, tr2i18n( "<b>Use same color for all text</b><p>Select this option to apply your chosen color to the default font as well as any custom fonts as specified in a stylesheet.</p>" ) );
}

#include "csscustom.moc"
