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

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

#include "richtextfontdialog.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqcombobox.h>
#include <ntqlabel.h>
#include <ntqtoolbutton.h>
#include <ntqframe.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "richtextfontdialog.ui.h"

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

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

    fontCombo = new TQComboBox( false, this, "fontCombo" );

    Layout6->addMultiCellWidget( fontCombo, 0, 0, 1, 2 );

    TextLabel1_2 = new TQLabel( this, "TextLabel1_2" );

    Layout6->addWidget( TextLabel1_2, 0, 0 );

    TextLabel2 = new TQLabel( this, "TextLabel2" );

    Layout6->addWidget( TextLabel2, 1, 0 );
    Spacer13 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout6->addItem( Spacer13, 2, 2 );

    TextLabel1 = new TQLabel( this, "TextLabel1" );

    Layout6->addWidget( TextLabel1, 2, 0 );

    fontSizeCombo = new TQComboBox( false, this, "fontSizeCombo" );
    fontSizeCombo->setEditable( true );
    fontSizeCombo->setInsertionPolicy( TQComboBox::AtTop );

    Layout6->addMultiCellWidget( fontSizeCombo, 1, 1, 1, 2 );

    colorButton = new TQToolButton( this, "colorButton" );
    colorButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, colorButton->sizePolicy().hasHeightForWidth() ) );
    colorButton->setMinimumSize( TQSize( 40, 20 ) );
    colorButton->setPaletteBackgroundColor( TQColor( 0, 0, 0 ) );
    colorButton->setFocusPolicy( TQToolButton::TabFocus );

    Layout6->addWidget( colorButton, 2, 1 );

    RichTextFontDialogLayout->addLayout( Layout6, 0, 0 );
    Spacer14 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    RichTextFontDialogLayout->addItem( Spacer14, 1, 0 );

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

    RichTextFontDialogLayout->addWidget( Line1, 2, 0 );

    Layout15 = new TQHBoxLayout( 0, 0, 6, "Layout15"); 
    Spacer12 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout15->addItem( Spacer12 );

    okButton = new TQPushButton( this, "okButton" );
    Layout15->addWidget( okButton );

    cancelButton = new TQPushButton( this, "cancelButton" );
    Layout15->addWidget( cancelButton );

    RichTextFontDialogLayout->addLayout( Layout15, 3, 0 );
    languageChange();
    resize( TQSize(255, 158).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( colorButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( selectColor() ) );
    connect( okButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( cancelButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );

    // tab order
    setTabOrder( fontCombo, fontSizeCombo );
    setTabOrder( fontSizeCombo, colorButton );
    setTabOrder( colorButton, okButton );
    setTabOrder( okButton, cancelButton );

    // buddies
    TextLabel1_2->setBuddy( fontCombo );
    TextLabel2->setBuddy( fontSizeCombo );
    TextLabel1->setBuddy( colorButton );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void RichTextFontDialog::languageChange()
{
    setCaption( tr2i18n( "Font Properties" ) );
    fontCombo->clear();
    fontCombo->insertItem( tr2i18n( "default" ) );
    TextLabel1_2->setText( tr2i18n( "&Font:" ) );
    TextLabel2->setText( tr2i18n( "Rel. &size:" ) );
    TextLabel1->setText( tr2i18n( "C&olor:" ) );
    fontSizeCombo->clear();
    fontSizeCombo->insertItem( tr2i18n( "0" ) );
    fontSizeCombo->insertItem( tr2i18n( "-4" ) );
    fontSizeCombo->insertItem( tr2i18n( "-3" ) );
    fontSizeCombo->insertItem( tr2i18n( "-2" ) );
    fontSizeCombo->insertItem( tr2i18n( "-1" ) );
    fontSizeCombo->insertItem( tr2i18n( "+1" ) );
    fontSizeCombo->insertItem( tr2i18n( "+2" ) );
    fontSizeCombo->insertItem( tr2i18n( "+3" ) );
    fontSizeCombo->insertItem( tr2i18n( "+4" ) );
    colorButton->setText( TQString::null );
    okButton->setText( tr2i18n( "&OK" ) );
    cancelButton->setText( tr2i18n( "&Cancel" ) );
}

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

TQMetaObject *RichTextFontDialog::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_RichTextFontDialog( "RichTextFontDialog", &RichTextFontDialog::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* RichTextFontDialog::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 = {"init", 0, 0 };
    static const TQUMethod slot_1 = {"selectColor", 0, 0 };
    static const TQUMethod slot_2 = {"accept", 0, 0 };
    static const TQUMethod slot_3 = {"reject", 0, 0 };
    static const TQUParameter param_slot_4[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::Out }
    };
    static const TQUMethod slot_4 = {"getSize", 1, param_slot_4 };
    static const TQUParameter param_slot_5[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::Out }
    };
    static const TQUMethod slot_5 = {"getColor", 1, param_slot_5 };
    static const TQUParameter param_slot_6[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::Out }
    };
    static const TQUMethod slot_6 = {"getFont", 1, param_slot_6 };
    static const TQUMethod slot_7 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "init()", &slot_0, TQMetaData::Public },
	{ "selectColor()", &slot_1, TQMetaData::Public },
	{ "accept()", &slot_2, TQMetaData::Public },
	{ "reject()", &slot_3, TQMetaData::Public },
	{ "getSize()", &slot_4, TQMetaData::Public },
	{ "getColor()", &slot_5, TQMetaData::Public },
	{ "getFont()", &slot_6, TQMetaData::Public },
	{ "languageChange()", &slot_7, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"RichTextFontDialog", parentObject,
	slot_tbl, 8,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_RichTextFontDialog.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool RichTextFontDialog::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: init(); break;
    case 1: selectColor(); break;
    case 2: accept(); break;
    case 3: reject(); break;
    case 4: static_QUType_TQString.set(_o,getSize()); break;
    case 5: static_QUType_TQString.set(_o,getColor()); break;
    case 6: static_QUType_TQString.set(_o,getFont()); break;
    case 7: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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