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

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

#include "kcurrencycalculatordecl.h"

#include <ntqvariant.h>
#include <kmymoney/kmymoneydateinput.h>
#include <kmymoney/kmymoneyedit.h>
#include <ntqpushbutton.h>
#include <ntqframe.h>
#include <ntqlabel.h>
#include <ntqgroupbox.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqcheckbox.h>
#include <kpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    m_amountDateFrame = new TQFrame( this, "m_amountDateFrame" );
    m_amountDateFrame->setFrameShape( TQFrame::NoFrame );
    m_amountDateFrame->setFrameShadow( TQFrame::Plain );
    m_amountDateFrameLayout = new TQVBoxLayout( m_amountDateFrame, 0, 6, "m_amountDateFrameLayout"); 

    layout9 = new TQHBoxLayout( 0, 0, 6, "layout9"); 

    textLabel3 = new TQLabel( m_amountDateFrame, "textLabel3" );
    layout9->addWidget( textLabel3 );

    m_fromAmount = new TQLabel( m_amountDateFrame, "m_fromAmount" );
    layout9->addWidget( m_fromAmount );
    spacer10 = new TQSpacerItem( 80, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout9->addItem( spacer10 );

    textLabel2 = new TQLabel( m_amountDateFrame, "textLabel2" );
    layout9->addWidget( textLabel2 );

    m_dateText = new TQLabel( m_amountDateFrame, "m_dateText" );
    layout9->addWidget( m_dateText );
    spacer4 = new TQSpacerItem( 145, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout9->addItem( spacer4 );
    m_amountDateFrameLayout->addLayout( layout9 );
    KCurrencyCalculatorDeclLayout->addWidget( m_amountDateFrame );

    layout9_2 = new TQHBoxLayout( 0, 0, 6, "layout9_2"); 

    groupBox2_2 = new TQGroupBox( this, "groupBox2_2" );
    groupBox2_2->setColumnLayout(0, TQt::Vertical );
    groupBox2_2->layout()->setSpacing( 0 );
    groupBox2_2->layout()->setMargin( 11 );
    groupBox2_2Layout = new TQHBoxLayout( groupBox2_2->layout() );
    groupBox2_2Layout->setAlignment( TQt::AlignTop );

    m_fromType = new TQLabel( groupBox2_2, "m_fromType" );
    groupBox2_2Layout->addWidget( m_fromType );

    m_fromCurrencyText = new TQLabel( groupBox2_2, "m_fromCurrencyText" );
    m_fromCurrencyText->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    groupBox2_2Layout->addWidget( m_fromCurrencyText );
    layout9_2->addWidget( groupBox2_2 );

    groupBox3 = new TQGroupBox( this, "groupBox3" );
    groupBox3->setColumnLayout(0, TQt::Vertical );
    groupBox3->layout()->setSpacing( 0 );
    groupBox3->layout()->setMargin( 11 );
    groupBox3Layout = new TQHBoxLayout( groupBox3->layout() );
    groupBox3Layout->setAlignment( TQt::AlignTop );

    m_toType = new TQLabel( groupBox3, "m_toType" );
    groupBox3Layout->addWidget( m_toType );

    m_toCurrencyText = new TQLabel( groupBox3, "m_toCurrencyText" );
    m_toCurrencyText->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    groupBox3Layout->addWidget( m_toCurrencyText );
    layout9_2->addWidget( groupBox3 );
    KCurrencyCalculatorDeclLayout->addLayout( layout9_2 );

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

    m_conversionRate = new kMyMoneyEdit( this, "m_conversionRate" );

    layout14->addWidget( m_conversionRate, 1, 1 );

    buttonGroup1 = new TQButtonGroup( this, "buttonGroup1" );
    buttonGroup1->setFrameShape( TQButtonGroup::NoFrame );
    buttonGroup1->setFrameShadow( TQButtonGroup::Plain );
    buttonGroup1->setFlat( true );
    buttonGroup1->setExclusive( true );
    buttonGroup1->setColumnLayout(0, TQt::Vertical );
    buttonGroup1->layout()->setSpacing( 6 );
    buttonGroup1->layout()->setMargin( 0 );
    buttonGroup1Layout = new TQVBoxLayout( buttonGroup1->layout() );
    buttonGroup1Layout->setAlignment( TQt::AlignTop );

    m_amountButton = new TQRadioButton( buttonGroup1, "m_amountButton" );
    buttonGroup1Layout->addWidget( m_amountButton );

    m_rateButton = new TQRadioButton( buttonGroup1, "m_rateButton" );
    buttonGroup1Layout->addWidget( m_rateButton );

    layout14->addMultiCellWidget( buttonGroup1, 0, 2, 0, 0 );

    m_dateFrame = new TQFrame( this, "m_dateFrame" );
    m_dateFrame->setFrameShape( TQFrame::NoFrame );
    m_dateFrame->setFrameShadow( TQFrame::Plain );
    m_dateFrame->setMargin( 0 );
    m_dateFrameLayout = new TQHBoxLayout( m_dateFrame, 0, 6, "m_dateFrameLayout"); 

    textLabel1 = new TQLabel( m_dateFrame, "textLabel1" );
    m_dateFrameLayout->addWidget( textLabel1 );

    m_dateEdit = new kMyMoneyDateInput( m_dateFrame, "m_dateEdit" );
    m_dateFrameLayout->addWidget( m_dateEdit );

    layout14->addMultiCellWidget( m_dateFrame, 3, 3, 0, 1 );

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

    layout14->addWidget( m_conversionExample, 2, 1 );

    m_toAmount = new kMyMoneyEdit( this, "m_toAmount" );

    layout14->addWidget( m_toAmount, 0, 1 );
    KCurrencyCalculatorDeclLayout->addLayout( layout14 );

    m_updateButton = new TQCheckBox( this, "m_updateButton" );
    m_updateButton->setChecked( true );
    KCurrencyCalculatorDeclLayout->addWidget( m_updateButton );
    spacer3 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    KCurrencyCalculatorDeclLayout->addItem( spacer3 );

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

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

    m_okButton = new KPushButton( this, "m_okButton" );
    m_okButton->setAutoDefault( true );
    m_okButton->setDefault( true );
    layout1->addWidget( m_okButton );

    m_cancelButton = new KPushButton( this, "m_cancelButton" );
    layout1->addWidget( m_cancelButton );
    KCurrencyCalculatorDeclLayout->addLayout( layout1 );
    languageChange();
    resize( TQSize(387, 368).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( m_amountButton, m_rateButton );
    setTabOrder( m_rateButton, m_updateButton );
    setTabOrder( m_updateButton, m_okButton );
    setTabOrder( m_okButton, m_cancelButton );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KCurrencyCalculatorDecl::languageChange()
{
    setCaption( tr2i18n( "Exchange Rate/Price  Editor" ) );
    textLabel3->setText( tr2i18n( "Amount" ) );
    m_fromAmount->setText( tr2i18n( "xxx" ) );
    textLabel2->setText( tr2i18n( "Date" ) );
    m_dateText->setText( tr2i18n( "xxx" ) );
    groupBox2_2->setTitle( tr2i18n( "Convert from" ) );
    m_fromType->setText( tr2i18n( "Currency" ) );
    m_fromCurrencyText->setText( tr2i18n( "xxx" ) );
    groupBox3->setTitle( tr2i18n( "Convert to" ) );
    m_toType->setText( tr2i18n( "Currency" ) );
    m_toCurrencyText->setText( tr2i18n( "xxx" ) );
    buttonGroup1->setTitle( TQString::null );
    m_amountButton->setText( tr2i18n( "To amount" ) );
    m_rateButton->setText( tr2i18n( "Exchange rate / Price" ) );
    textLabel1->setText( tr2i18n( "Date" ) );
    m_conversionExample->setText( tr2i18n( "xx\n"
"xx" ) );
    m_updateButton->setText( tr2i18n( "Update price history" ) );
    m_okButton->setText( tr2i18n( "OK" ) );
    m_cancelButton->setText( tr2i18n( "Cancel" ) );
}

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

TQMetaObject *KCurrencyCalculatorDecl::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KCurrencyCalculatorDecl( "KCurrencyCalculatorDecl", &KCurrencyCalculatorDecl::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* KCurrencyCalculatorDecl::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 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"KCurrencyCalculatorDecl", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_KCurrencyCalculatorDecl.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool KCurrencyCalculatorDecl::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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