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

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

#include "prefcardappearancebase.h"

#include <ntqvariant.h>
#include <kpushbutton.h>
#include <tdefontrequester.h>
#include <kcolorbutton.h>
#include <ntqpushbutton.h>
#include <ntqframe.h>
#include <ntqlabel.h>
#include <ntqwidgetstack.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a PrefCardAppearanceBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
PrefCardAppearanceBase::PrefCardAppearanceBase( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "PrefCardAppearanceBase" );
    PrefCardAppearanceBaseLayout = new TQGridLayout( this, 1, 1, 0, 6, "PrefCardAppearanceBaseLayout"); 

    cardFrame = new TQFrame( this, "cardFrame" );
    cardFrame->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, cardFrame->sizePolicy().hasHeightForWidth() ) );
    cardFrame->setMinimumSize( TQSize( 175, 100 ) );
    cardFrame->setMaximumSize( TQSize( 175, 100 ) );
    cardFrame->setPaletteBackgroundColor( TQColor( 255, 255, 255 ) );
    cardFrame->setFrameShape( TQFrame::Box );
    cardFrame->setFrameShadow( TQFrame::Plain );

    textLabel = new TQLabel( cardFrame, "textLabel" );
    textLabel->setGeometry( TQRect( 11, 42, 153, 47 ) );
    textLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, textLabel->sizePolicy().hasHeightForWidth() ) );
    textLabel->setPaletteBackgroundColor( TQColor( 255, 255, 255 ) );
    textLabel->setTextFormat( TQLabel::AutoText );
    textLabel->setScaledContents( false );
    textLabel->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignCenter ) );

    line = new TQFrame( cardFrame, "line" );
    line->setGeometry( TQRect( 11, 33, 153, 16 ) );
    line->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, line->sizePolicy().hasHeightForWidth() ) );
    line->setPaletteForegroundColor( TQColor( 255, 0, 0 ) );
    line->setPaletteBackgroundColor( TQColor( 255, 255, 255 ) );
    line->setFrameShape( TQFrame::HLine );
    line->setFrameShadow( TQFrame::Plain );
    line->setFrameShape( TQFrame::HLine );

    titleLabel = new TQLabel( cardFrame, "titleLabel" );
    titleLabel->setGeometry( TQRect( 11, 11, 153, 16 ) );
    titleLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, titleLabel->sizePolicy().hasHeightForWidth() ) );
    titleLabel->setPaletteBackgroundColor( TQColor( 255, 255, 255 ) );
    TQFont titleLabel_font(  titleLabel->font() );
    titleLabel_font.setBold( true );
    titleLabel->setFont( titleLabel_font ); 
    titleLabel->setAlignment( int( TQLabel::AlignTop ) );

    PrefCardAppearanceBaseLayout->addMultiCellWidget( cardFrame, 0, 2, 0, 0 );

    flipButton = new KPushButton( this, "flipButton" );

    PrefCardAppearanceBaseLayout->addWidget( flipButton, 3, 0 );

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

    PrefCardAppearanceBaseLayout->addWidget( textColorLabel, 1, 1 );

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

    PrefCardAppearanceBaseLayout->addWidget( frameColorLabel, 3, 1 );

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

    PrefCardAppearanceBaseLayout->addWidget( fontLabel, 0, 1 );

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

    PrefCardAppearanceBaseLayout->addWidget( cardColorLabel, 2, 1 );

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

    backStackPage = new TQWidget( widgetStack, "backStackPage" );
    backStackPageLayout = new TQGridLayout( backStackPage, 1, 1, 0, 6, "backStackPageLayout"); 

    kcfg_BackFont = new TDEFontRequester( backStackPage, "kcfg_BackFont" );
    kcfg_BackFont->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, kcfg_BackFont->sizePolicy().hasHeightForWidth() ) );
    kcfg_BackFont->setFocusPolicy( TDEFontRequester::TabFocus );

    backStackPageLayout->addWidget( kcfg_BackFont, 0, 0 );

    kcfg_BackTextColor = new KColorButton( backStackPage, "kcfg_BackTextColor" );

    backStackPageLayout->addWidget( kcfg_BackTextColor, 1, 0 );

    kcfg_BackFrameColor = new KColorButton( backStackPage, "kcfg_BackFrameColor" );

    backStackPageLayout->addWidget( kcfg_BackFrameColor, 3, 0 );

    kcfg_BackCardColor = new KColorButton( backStackPage, "kcfg_BackCardColor" );

    backStackPageLayout->addWidget( kcfg_BackCardColor, 2, 0 );
    widgetStack->addWidget( backStackPage, 0 );

    frontStackPage = new TQWidget( widgetStack, "frontStackPage" );
    frontStackPageLayout = new TQGridLayout( frontStackPage, 1, 1, 0, 6, "frontStackPageLayout"); 

    kcfg_FrontFont = new TDEFontRequester( frontStackPage, "kcfg_FrontFont" );
    kcfg_FrontFont->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, kcfg_FrontFont->sizePolicy().hasHeightForWidth() ) );
    kcfg_FrontFont->setFocusPolicy( TDEFontRequester::TabFocus );

    frontStackPageLayout->addWidget( kcfg_FrontFont, 0, 0 );

    kcfg_FrontTextColor = new KColorButton( frontStackPage, "kcfg_FrontTextColor" );

    frontStackPageLayout->addWidget( kcfg_FrontTextColor, 1, 0 );

    kcfg_FrontFrameColor = new KColorButton( frontStackPage, "kcfg_FrontFrameColor" );

    frontStackPageLayout->addWidget( kcfg_FrontFrameColor, 3, 0 );

    kcfg_FrontCardColor = new KColorButton( frontStackPage, "kcfg_FrontCardColor" );

    frontStackPageLayout->addWidget( kcfg_FrontCardColor, 2, 0 );
    widgetStack->addWidget( frontStackPage, 0 );

    PrefCardAppearanceBaseLayout->addMultiCellWidget( widgetStack, 0, 3, 2, 2 );
    spacer = new TQSpacerItem( 400, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    PrefCardAppearanceBaseLayout->addMultiCell( spacer, 4, 4, 0, 2 );
    languageChange();
    resize( TQSize(606, 181).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( flipButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotFlipButtonClicked() ) );
    connect( kcfg_FrontFont, TQ_SIGNAL( fontSelected(const TQFont&) ), this, TQ_SLOT( slotFontChanged(const TQFont&) ) );
    connect( kcfg_FrontTextColor, TQ_SIGNAL( changed(const TQColor&) ), this, TQ_SLOT( slotTextColorChanged(const TQColor&) ) );
    connect( kcfg_FrontCardColor, TQ_SIGNAL( changed(const TQColor&) ), this, TQ_SLOT( slotCardColorChanged(const TQColor&) ) );
    connect( kcfg_FrontFrameColor, TQ_SIGNAL( changed(const TQColor&) ), this, TQ_SLOT( slotFrameColorChanged(const TQColor&) ) );
    connect( widgetStack, TQ_SIGNAL( aboutToShow(TQWidget*) ), this, TQ_SLOT( slotAboutToShowWidget(TQWidget*) ) );

    // tab order
    setTabOrder( flipButton, kcfg_FrontFont );
    setTabOrder( kcfg_FrontFont, kcfg_FrontTextColor );
    setTabOrder( kcfg_FrontTextColor, kcfg_FrontCardColor );
    setTabOrder( kcfg_FrontCardColor, kcfg_FrontFrameColor );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void PrefCardAppearanceBase::languageChange()
{
    setCaption( tr2i18n( "Card Appearance" ) );
    TQToolTip::add( cardFrame, tr2i18n( "The flashcard" ) );
    textLabel->setText( tr2i18n( "This is the question" ) );
    TQToolTip::add( textLabel, tr2i18n( "The flashcard" ) );
    TQWhatsThis::add( textLabel, tr2i18n( "The flashcard. Select Quiz -> Check to see the other side." ) );
    TQToolTip::add( line, tr2i18n( "The flashcard" ) );
    titleLabel->setText( tr2i18n( "Front" ) );
    TQToolTip::add( titleLabel, tr2i18n( "The flashcard" ) );
    TQWhatsThis::add( titleLabel, tr2i18n( "Language or other identifier for this card" ) );
    flipButton->setText( tr2i18n( "&Flip" ) );
    TQToolTip::add( flipButton, tr2i18n( "Flip card" ) );
    TQWhatsThis::add( flipButton, tr2i18n( "Use to show the other side of the card" ) );
    textColorLabel->setText( tr2i18n( "Text color:" ) );
    frameColorLabel->setText( tr2i18n( "Frame color:" ) );
    fontLabel->setText( tr2i18n( "Font:" ) );
    cardColorLabel->setText( tr2i18n( "Card color:" ) );
    kcfg_BackFont->setTitle( tr2i18n( "Font:" ) );
    TQToolTip::add( kcfg_BackFont, tr2i18n( "Font for back of card" ) );
    TQWhatsThis::add( kcfg_BackFont, tr2i18n( "Use to select the font for displaying text on the back of the card" ) );
    kcfg_BackTextColor->setText( TQString::null );
    TQToolTip::add( kcfg_BackTextColor, tr2i18n( "Select text color" ) );
    TQWhatsThis::add( kcfg_BackTextColor, tr2i18n( "Use to select the color for text shown on the card" ) );
    kcfg_BackFrameColor->setText( TQString::null );
    TQToolTip::add( kcfg_BackFrameColor, tr2i18n( "Select card frame color" ) );
    TQWhatsThis::add( kcfg_BackFrameColor, tr2i18n( "Use to select the color for drawing the frame of the card" ) );
    kcfg_BackCardColor->setText( TQString::null );
    TQToolTip::add( kcfg_BackCardColor, tr2i18n( "Select card color" ) );
    TQWhatsThis::add( kcfg_BackCardColor, tr2i18n( "Select color used to draw the card" ) );
    kcfg_FrontFont->setTitle( tr2i18n( "Font:" ) );
    TQToolTip::add( kcfg_FrontFont, tr2i18n( "Font for front of card" ) );
    TQWhatsThis::add( kcfg_FrontFont, tr2i18n( "Use to select the font for displaying text on the front of the card" ) );
    kcfg_FrontTextColor->setText( TQString::null );
    TQToolTip::add( kcfg_FrontTextColor, tr2i18n( "Select text color" ) );
    TQWhatsThis::add( kcfg_FrontTextColor, tr2i18n( "Use to select the color for text shown on the card" ) );
    kcfg_FrontFrameColor->setText( TQString::null );
    TQToolTip::add( kcfg_FrontFrameColor, tr2i18n( "Select card frame color" ) );
    TQWhatsThis::add( kcfg_FrontFrameColor, tr2i18n( "Use to select the color for drawing the frame of the card" ) );
    kcfg_FrontCardColor->setText( TQString::null );
    TQToolTip::add( kcfg_FrontCardColor, tr2i18n( "Select card color" ) );
    TQWhatsThis::add( kcfg_FrontCardColor, tr2i18n( "Select color used to draw the card" ) );
}

void PrefCardAppearanceBase::slotFlipButtonClicked()
{
    tqWarning( "PrefCardAppearanceBase::slotFlipButtonClicked(): Not implemented yet" );
}

void PrefCardAppearanceBase::slotFontChanged(const TQFont&)
{
    tqWarning( "PrefCardAppearanceBase::slotFontChanged(const TQFont&): Not implemented yet" );
}

void PrefCardAppearanceBase::slotTextColorChanged(const TQColor&)
{
    tqWarning( "PrefCardAppearanceBase::slotTextColorChanged(const TQColor&): Not implemented yet" );
}

void PrefCardAppearanceBase::slotAboutToShowWidget(TQWidget*)
{
    tqWarning( "PrefCardAppearanceBase::slotAboutToShowWidget(TQWidget*): Not implemented yet" );
}

void PrefCardAppearanceBase::slotFrameColorChanged(const TQColor&)
{
    tqWarning( "PrefCardAppearanceBase::slotFrameColorChanged(const TQColor&): Not implemented yet" );
}

void PrefCardAppearanceBase::slotCardColorChanged(const TQColor&)
{
    tqWarning( "PrefCardAppearanceBase::slotCardColorChanged(const TQColor&): Not implemented yet" );
}

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

TQMetaObject *PrefCardAppearanceBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_PrefCardAppearanceBase( "PrefCardAppearanceBase", &PrefCardAppearanceBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* PrefCardAppearanceBase::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 = {"slotFlipButtonClicked", 0, 0 };
    static const TQUParameter param_slot_1[] = {
	{ 0, &static_QUType_varptr, "\x05", TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"slotFontChanged", 1, param_slot_1 };
    static const TQUParameter param_slot_2[] = {
	{ 0, &static_QUType_varptr, "\x0a", TQUParameter::In }
    };
    static const TQUMethod slot_2 = {"slotTextColorChanged", 1, param_slot_2 };
    static const TQUParameter param_slot_3[] = {
	{ 0, &static_QUType_ptr, "TQWidget", TQUParameter::In }
    };
    static const TQUMethod slot_3 = {"slotAboutToShowWidget", 1, param_slot_3 };
    static const TQUParameter param_slot_4[] = {
	{ 0, &static_QUType_varptr, "\x0a", TQUParameter::In }
    };
    static const TQUMethod slot_4 = {"slotFrameColorChanged", 1, param_slot_4 };
    static const TQUParameter param_slot_5[] = {
	{ 0, &static_QUType_varptr, "\x0a", TQUParameter::In }
    };
    static const TQUMethod slot_5 = {"slotCardColorChanged", 1, param_slot_5 };
    static const TQUMethod slot_6 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "slotFlipButtonClicked()", &slot_0, TQMetaData::Public },
	{ "slotFontChanged(const TQFont&)", &slot_1, TQMetaData::Public },
	{ "slotTextColorChanged(const TQColor&)", &slot_2, TQMetaData::Public },
	{ "slotAboutToShowWidget(TQWidget*)", &slot_3, TQMetaData::Public },
	{ "slotFrameColorChanged(const TQColor&)", &slot_4, TQMetaData::Public },
	{ "slotCardColorChanged(const TQColor&)", &slot_5, TQMetaData::Public },
	{ "languageChange()", &slot_6, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"PrefCardAppearanceBase", parentObject,
	slot_tbl, 7,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_PrefCardAppearanceBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool PrefCardAppearanceBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: slotFlipButtonClicked(); break;
    case 1: slotFontChanged((const TQFont&)*((const TQFont*)static_QUType_ptr.get(_o+1))); break;
    case 2: slotTextColorChanged((const TQColor&)*((const TQColor*)static_QUType_ptr.get(_o+1))); break;
    case 3: slotAboutToShowWidget((TQWidget*)static_QUType_ptr.get(_o+1)); break;
    case 4: slotFrameColorChanged((const TQColor&)*((const TQColor*)static_QUType_ptr.get(_o+1))); break;
    case 5: slotCardColorChanged((const TQColor&)*((const TQColor*)static_QUType_ptr.get(_o+1))); break;
    case 6: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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