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

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

#include "kloandetailspagedecl.h"

#include <ntqvariant.h>
#include <kmymoney/kmymoneydateinput.h>
#include <kmymoney/kmymoneyedit.h>
#include <kmymoney/kmymoneycategory.h>
#include <ntqpushbutton.h>
#include <kactivelabel.h>
#include <ntqlabel.h>
#include <kcombobox.h>
#include <knuminput.h>
#include <kpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    kActiveLabel2 = new KActiveLabel( this, "kActiveLabel2" );
    kActiveLabel2->setFocusPolicy( KActiveLabel::NoFocus );
    KLoanDetailsPageDeclLayout->addWidget( kActiveLabel2 );
    spacer89 = new TQSpacerItem( 20, 70, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    KLoanDetailsPageDeclLayout->addItem( spacer89 );

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

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

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

    layout9->addWidget( textLabel7, 0, 0 );

    m_paymentDue = new KComboBox( false, this, "m_paymentDue" );

    layout9->addMultiCellWidget( m_paymentDue, 0, 0, 1, 3 );

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

    layout9->addWidget( textLabel8, 1, 0 );

    m_loanAmount = new kMyMoneyEdit( this, "m_loanAmount" );
    m_loanAmount->setProperty( "resetButtonVisibility", TQVariant( true ) );

    layout9->addMultiCellWidget( m_loanAmount, 1, 1, 1, 3 );

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

    layout9->addWidget( textLabel9, 2, 0 );

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

    layout9->addMultiCellWidget( m_interestRate, 2, 2, 1, 3 );

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

    layout9->addWidget( textLabel10, 3, 0 );

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

    m_termAmount = new KIntSpinBox( this, "m_termAmount" );
    m_termAmount->setMaxValue( 999 );
    layout8->addWidget( m_termAmount );

    m_termUnit = new KMyMoneyFrequencyCombo( this, "m_termUnit" );
    layout8->addWidget( m_termUnit );

    layout9->addMultiCellLayout( layout8, 3, 3, 1, 3 );

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

    layout9->addWidget( textLabel11, 4, 0 );

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

    layout9->addMultiCellWidget( m_paymentAmount, 4, 4, 1, 3 );

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

    layout9->addWidget( textLabel12, 5, 0 );

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

    layout9->addMultiCellWidget( m_balloonAmount, 5, 5, 1, 3 );

    layout53 = new TQHBoxLayout( 0, 0, 6, "layout53"); 
    spacer86 = new TQSpacerItem( 71, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout53->addItem( spacer86 );

    m_calculateButton = new KPushButton( this, "m_calculateButton" );
    layout53->addWidget( m_calculateButton );

    layout9->addLayout( layout53, 6, 1 );
    spacer88_2 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout9->addItem( spacer88_2, 6, 2 );
    layout10->addLayout( layout9 );
    spacer87 = new TQSpacerItem( 27, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout10->addItem( spacer87 );
    KLoanDetailsPageDeclLayout->addLayout( layout10 );
    spacer88 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    KLoanDetailsPageDeclLayout->addItem( spacer88 );
    languageChange();
    resize( TQSize(592, 434).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KLoanDetailsPageDecl::languageChange()
{
    kActiveLabel2->setText( tr2i18n( "Now enter the details for your loan. You can leave one of the fields empty and KMyMoney will calculate it when you press the <b>Calculate</b> button. Before you can continue with the next page you also need to press <b>Calculate</b> so that KMyMoney can check the logical correctness of the values you have supplied." ) );
    textLabel7->setText( tr2i18n( "The interest rate gets calculated" ) );
    m_paymentDue->clear();
    m_paymentDue->insertItem( tr2i18n( "when the payment is received" ) );
    m_paymentDue->insertItem( tr2i18n( "when the payment is due" ) );
    textLabel8->setText( tr2i18n( "Loan amount" ) );
    TQWhatsThis::add( m_loanAmount, tr2i18n( "Enter the amount of the loan in this field. If you want to calculate this field out of the other parameters, please leave it empty. If the field is marked as required (colored background) you have informed KMyMoney about the fact that there were already some payments towards the loan. In this case, please enter the ending balance of your last statement." ) );
    textLabel9->setText( tr2i18n( "Interest rate" ) );
    TQWhatsThis::add( m_interestRate, tr2i18n( "Please enter the interest rate in percent or leave the field empty to calculate it." ) );
    textLabel10->setText( tr2i18n( "Term" ) );
    TQWhatsThis::add( m_termAmount, tr2i18n( "Please enter the term of this loan or enter 0 to calculate it. The term is the time that is required to fully repay the loan. This time might be different from the time your loan contract is signed for." ) );
    textLabel11->setText( tr2i18n( "Payment (principal and interest)" ) );
    TQWhatsThis::add( m_paymentAmount, tr2i18n( "Please enter the amount you pay for principal and interest or leave the field empty to calculate it." ) );
    textLabel12->setText( tr2i18n( "Balloon payment" ) );
    TQWhatsThis::add( m_balloonAmount, tr2i18n( "Please enter the amount of a final amortization payment or leave the field empty to calculate it." ) );
    m_calculateButton->setText( tr2i18n( "Calculate" ) );
    TQToolTip::add( m_calculateButton, tr2i18n( "Press this button to calculate/verify your loan details." ) );
    TQWhatsThis::add( m_calculateButton, tr2i18n( "Pressing this button calculates a possibly missing parameter for your loan or verifies that the values entered match. If something is not correct you will receive information about it." ) );
}

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

TQMetaObject *KLoanDetailsPageDecl::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KLoanDetailsPageDecl( "KLoanDetailsPageDecl", &KLoanDetailsPageDecl::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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