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

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

#include "lookandfeelconfig.h"

#include <ntqvariant.h>
#include <kcolorbutton.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqframe.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
/*
 *  Constructs a LookAndFeel as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
LookAndFeel::LookAndFeel( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "LookAndFeel" );
    LookAndFeelLayout = new TQVBoxLayout( this, 0, 0, "LookAndFeelLayout"); 

    mFontBox = new TQGroupBox( this, "mFontBox" );
    mFontBox->setColumnLayout(0, TQt::Vertical );
    mFontBox->layout()->setSpacing( 6 );
    mFontBox->layout()->setMargin( 11 );
    mFontBoxLayout = new TQVBoxLayout( mFontBox->layout() );
    mFontBoxLayout->setAlignment( TQt::AlignTop );

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

    mChooseNumberFont = new TQPushButton( mFontBox, "mChooseNumberFont" );

    mTopLayout->addWidget( mChooseNumberFont, 1, 2 );

    mServiceFontPreview = new TQLabel( mFontBox, "mServiceFontPreview" );
    mServiceFontPreview->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)1, 0, 0, mServiceFontPreview->sizePolicy().hasHeightForWidth() ) );
    mServiceFontPreview->setMinimumSize( TQSize( 200, 0 ) );
    mServiceFontPreview->setFrameShape( TQLabel::StyledPanel );
    mServiceFontPreview->setFrameShadow( TQLabel::Sunken );

    mTopLayout->addWidget( mServiceFontPreview, 0, 1 );

    mNumberFontPreview = new TQLabel( mFontBox, "mNumberFontPreview" );
    mNumberFontPreview->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)1, 0, 0, mNumberFontPreview->sizePolicy().hasHeightForWidth() ) );
    mNumberFontPreview->setMinimumSize( TQSize( 200, 0 ) );
    mNumberFontPreview->setFrameShape( TQLabel::StyledPanel );
    mNumberFontPreview->setFrameShadow( TQLabel::Sunken );

    mTopLayout->addWidget( mNumberFontPreview, 1, 1 );

    mServiceFontLabel = new TQLabel( mFontBox, "mServiceFontLabel" );
    mServiceFontLabel->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    mTopLayout->addWidget( mServiceFontLabel, 0, 0 );

    mNumberFontLabel = new TQLabel( mFontBox, "mNumberFontLabel" );
    mNumberFontLabel->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    mTopLayout->addWidget( mNumberFontLabel, 1, 0 );

    mChooseServiceFont = new TQPushButton( mFontBox, "mChooseServiceFont" );

    mTopLayout->addWidget( mChooseServiceFont, 0, 2 );
    mFontBoxLayout->addLayout( mTopLayout );
    LookAndFeelLayout->addWidget( mFontBox );

    mSpacer = new TQFrame( this, "mSpacer" );
    mSpacer->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, mSpacer->sizePolicy().hasHeightForWidth() ) );
    mSpacer->setMinimumSize( TQSize( 0, 10 ) );
    mSpacer->setFrameShape( TQFrame::NoFrame );
    mSpacer->setFrameShadow( TQFrame::Plain );
    LookAndFeelLayout->addWidget( mSpacer );

    mColorBox = new TQGroupBox( this, "mColorBox" );
    mColorBox->setColumnLayout(0, TQt::Vertical );
    mColorBox->layout()->setSpacing( 6 );
    mColorBox->layout()->setMargin( 11 );
    mColorBoxLayout = new TQVBoxLayout( mColorBox->layout() );
    mColorBoxLayout->setAlignment( TQt::AlignTop );

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

    mChangedNormal = new KColorButton( mColorBox, "mChangedNormal" );
    mChangedNormal->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, mChangedNormal->sizePolicy().hasHeightForWidth() ) );
    mChangedNormal->setMinimumSize( TQSize( 80, 0 ) );
    mChangedNormal->setFocusPolicy( KColorButton::StrongFocus );

    mColorGrid->addWidget( mChangedNormal, 2, 1 );

    mChangedNormalLabel = new TQLabel( mColorBox, "mChangedNormalLabel" );
    mChangedNormalLabel->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    mColorGrid->addWidget( mChangedNormalLabel, 2, 0 );

    mNewNormal = new KColorButton( mColorBox, "mNewNormal" );
    mNewNormal->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, mNewNormal->sizePolicy().hasHeightForWidth() ) );
    mNewNormal->setMinimumSize( TQSize( 80, 0 ) );
    mNewNormal->setFocusPolicy( KColorButton::StrongFocus );

    mColorGrid->addWidget( mNewNormal, 0, 1 );

    mNewNormalLabel = new TQLabel( mColorBox, "mNewNormalLabel" );
    mNewNormalLabel->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    mColorGrid->addWidget( mNewNormalLabel, 0, 0 );

    mChangedSelected = new KColorButton( mColorBox, "mChangedSelected" );
    mChangedSelected->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, mChangedSelected->sizePolicy().hasHeightForWidth() ) );
    mChangedSelected->setMinimumSize( TQSize( 80, 0 ) );
    mChangedSelected->setFocusPolicy( KColorButton::StrongFocus );

    mColorGrid->addWidget( mChangedSelected, 3, 1 );

    mNewSelected = new KColorButton( mColorBox, "mNewSelected" );
    mNewSelected->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, mNewSelected->sizePolicy().hasHeightForWidth() ) );
    mNewSelected->setMinimumSize( TQSize( 80, 0 ) );
    mNewSelected->setFocusPolicy( KColorButton::StrongFocus );

    mColorGrid->addWidget( mNewSelected, 1, 1 );

    mNewSelectedLabel = new TQLabel( mColorBox, "mNewSelectedLabel" );
    mNewSelectedLabel->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    mColorGrid->addWidget( mNewSelectedLabel, 1, 0 );

    mChangedSelectedLabel = new TQLabel( mColorBox, "mChangedSelectedLabel" );
    mChangedSelectedLabel->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    mColorGrid->addWidget( mChangedSelectedLabel, 3, 0 );
    mColorBoxLayout->addLayout( mColorGrid );
    LookAndFeelLayout->addWidget( mColorBox );
    Spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    LookAndFeelLayout->addItem( Spacer1 );
    languageChange();
    resize( TQSize(532, 303).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( mChooseServiceFont, TQ_SIGNAL( clicked() ), this, TQ_SLOT( chooseServiceFont() ) );
    connect( mChooseNumberFont, TQ_SIGNAL( clicked() ), this, TQ_SLOT( chooseNumberFont() ) );
    connect( mNewNormal, TQ_SIGNAL( changed(const TQColor&) ), this, TQ_SLOT( slotChanged() ) );
    connect( mNewSelected, TQ_SIGNAL( changed(const TQColor&) ), this, TQ_SLOT( slotChanged() ) );
    connect( mChangedNormal, TQ_SIGNAL( changed(const TQColor&) ), this, TQ_SLOT( slotChanged() ) );
    connect( mChangedSelected, TQ_SIGNAL( changed(const TQColor&) ), this, TQ_SLOT( slotChanged() ) );

    // tab order
    setTabOrder( mChooseServiceFont, mChooseNumberFont );
    setTabOrder( mChooseNumberFont, mNewNormal );
    setTabOrder( mNewNormal, mNewSelected );
    setTabOrder( mNewSelected, mChangedNormal );
    setTabOrder( mChangedNormal, mChangedSelected );

    // buddies
    mServiceFontLabel->setBuddy( mChooseServiceFont );
    mNumberFontLabel->setBuddy( mChooseNumberFont );
    mChangedNormalLabel->setBuddy( mChangedNormal );
    mNewNormalLabel->setBuddy( mNewNormal );
    mNewSelectedLabel->setBuddy( mNewSelected );
    mChangedSelectedLabel->setBuddy( mChangedSelected );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void LookAndFeel::languageChange()
{
    setCaption( tr2i18n( "Look & Feel" ) );
    mFontBox->setTitle( tr2i18n( "Fonts" ) );
    mChooseNumberFont->setText( tr2i18n( "C&hoose..." ) );
    mServiceFontPreview->setText( tr2i18n( "dummy-font" ) );
    mNumberFontPreview->setText( tr2i18n( "dummy-font" ) );
    mServiceFontLabel->setText( tr2i18n( "Services:" ) );
    mNumberFontLabel->setText( tr2i18n( "Sorting numbers:" ) );
    mChooseServiceFont->setText( tr2i18n( "&Choose..." ) );
    mColorBox->setTitle( tr2i18n( "Colors" ) );
    mChangedNormal->setText( tr2i18n( "Dummy" ) );
    TQToolTip::add( mChangedNormal, tr2i18n( "Choose a color for changed services" ) );
    TQWhatsThis::add( mChangedNormal, tr2i18n( "<p>Use the <strong>Select Color dialog box</strong> to pick a text color for <em>services that have been changed</em> (either order/sorting number or name).</p>\n"
"<p>Changed service entries will be distinguished by this color.</p>" ) );
    mChangedNormalLabel->setText( tr2i18n( "&Changed:" ) );
    mNewNormal->setText( tr2i18n( "Dummy" ) );
    TQToolTip::add( mNewNormal, tr2i18n( "Choose a color for service new to a runlevel" ) );
    TQWhatsThis::add( mNewNormal, tr2i18n( "<p>Use the <strong>Select Color dialog box</strong> to pick a text color for <em>services new to a runlevel</em>.</p>\n"
"<p>New service entries will be distinguished by this color.</p>" ) );
    mNewNormalLabel->setText( tr2i18n( "&New:" ) );
    mChangedSelected->setText( tr2i18n( "Dummy" ) );
    TQToolTip::add( mChangedSelected, tr2i18n( "Choose a color for changed services that are selected" ) );
    TQWhatsThis::add( mChangedSelected, tr2i18n( "<p>Use the <strong>Select Color dialog box</strong> to pick a selected text color for <em>services that have been changed</em> (either order/sorting number or name).</p>\n"
"<p>Changed service entries will be distinguished by this color while they are selected.</p>" ) );
    mNewSelected->setText( tr2i18n( "Dummy" ) );
    TQToolTip::add( mNewSelected, tr2i18n( "Choose a color for services new to a runlevel that are selected" ) );
    TQWhatsThis::add( mNewSelected, tr2i18n( "<p>Use the <strong>Select Color dialog box</strong> to pick a selected text color for <em>services new to a runlevel</em>.</p>\n"
"<p>New service entries will be distinguished by this color while they are selected.</p>" ) );
    mNewSelectedLabel->setText( tr2i18n( "New && &selected:" ) );
    mChangedSelectedLabel->setText( tr2i18n( "Changed && s&elected:" ) );
}

void LookAndFeel::chooseNumberFont()
{
    tqWarning( "LookAndFeel::chooseNumberFont(): Not implemented yet" );
}

void LookAndFeel::chooseServiceFont()
{
    tqWarning( "LookAndFeel::chooseServiceFont(): Not implemented yet" );
}

void LookAndFeel::slotChanged()
{
    tqWarning( "LookAndFeel::slotChanged(): Not implemented yet" );
}

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

TQMetaObject *LookAndFeel::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_LookAndFeel( "LookAndFeel", &LookAndFeel::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

bool LookAndFeel::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: chooseNumberFont(); break;
    case 2: chooseServiceFont(); break;
    case 3: slotChanged(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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