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

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

#include "kaccounttypepagedecl.h"

#include <ntqvariant.h>
#include <kmymoney/kmymoneydateinput.h>
#include <kmymoney/kmymoneyedit.h>
#include <kmymoney/kmymoneycombo.h>
#include <kmymoney/kmymoneycurrencyselector.h>
#include <kactivelabel.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    kActiveLabel4 = new KActiveLabel( this, "kActiveLabel4" );
    kActiveLabel4->setFocusPolicy( KActiveLabel::NoFocus );
    KAccountTypePageDeclLayout->addWidget( kActiveLabel4 );

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

    m_currencyComboBox = new KMyMoneySecuritySelector( this, "m_currencyComboBox" );
    m_currencyComboBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, m_currencyComboBox->sizePolicy().hasHeightForWidth() ) );

    layout9->addWidget( m_currencyComboBox, 2, 1 );

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

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

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

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

    m_openingBalance = new kMyMoneyEdit( this, "m_openingBalance" );
    m_openingBalance->setMinimumSize( TQSize( 150, 0 ) );
    m_openingBalance->setFocusPolicy( kMyMoneyEdit::StrongFocus );
    m_openingBalance->setProperty( "resetButtonVisibility", TQVariant( false ) );

    layout9->addWidget( m_openingBalance, 4, 1 );

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

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

    m_openingDate = new kMyMoneyDateInput( this, "m_openingDate" );
    m_openingDate->setFocusPolicy( kMyMoneyDateInput::StrongFocus );

    layout9->addWidget( m_openingDate, 3, 1 );

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

    layout9->addWidget( m_conversionExample, 6, 1 );

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

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

    m_conversionRate = new kMyMoneyEdit( this, "m_conversionRate" );
    m_conversionRate->setProperty( "resetButtonVisibility", TQVariant( false ) );

    layout9->addWidget( m_conversionRate, 5, 1 );

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

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

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

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

    m_typeSelection = new KMyMoneyGeneralCombo( this, "m_typeSelection" );
    m_typeSelection->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, m_typeSelection->sizePolicy().hasHeightForWidth() ) );

    layout9->addWidget( m_typeSelection, 1, 1 );

    m_preferredAccount = new TQCheckBox( this, "m_preferredAccount" );

    layout9->addMultiCellWidget( m_preferredAccount, 7, 7, 0, 1 );
    spacer6 = new TQSpacerItem( 231, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout9->addMultiCell( spacer6, 2, 2, 2, 3 );

    m_accountName = new KLineEdit( this, "m_accountName" );
    m_accountName->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, m_accountName->sizePolicy().hasHeightForWidth() ) );

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

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

    layout9->addWidget( m_onlineQuote, 5, 2 );
    spacer3 = new TQSpacerItem( 61, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout9->addItem( spacer3, 5, 3 );
    KAccountTypePageDeclLayout->addLayout( layout9 );
    spacer18 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    KAccountTypePageDeclLayout->addItem( spacer18 );
    languageChange();
    resize( TQSize(555, 404).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KAccountTypePageDecl::languageChange()
{
    kActiveLabel4->setText( tr2i18n( "Enter the name of the account under which it is known within KMyMoney.\n"
"Select the type for the new account. Use the <b>What's this?</b> feature to see more details about the various account types.\n"
"Enter the date the account was opened and its currency." ) );
    TQWhatsThis::add( m_currencyComboBox, tr2i18n( "Select the currency in which this account is denominated." ) );
    textLabel3->setText( tr2i18n( "Currency" ) );
    textLabel2->setText( tr2i18n( "Opening date" ) );
    TQWhatsThis::add( m_openingBalance, tr2i18n( "The opening balance is the balance of the account when you start using it with KMyMoney. For new accounts this is usually 0 but for existing accounts this may well differ. Please consult the account statements to figure out this value. The opening balance is to be provided in the currency of the account as selected with the currency button." ) );
    m_conversionLabel->setText( tr2i18n( "Conversion rate" ) );
    TQWhatsThis::add( m_openingDate, tr2i18n( "The opening date would be the date of the last statement. In case you want to keep track of transactions prior to this date, enter the ending balance and statement date of a prior statement and add all following transactions into KMyMoney.\n"
"<br>\n"
"<i>Note</i>: If you do not know the exact amount of the opening balance, enter an estimate. You can change this value later before you reconcile this account for the first time." ) );
    m_conversionExample->setText( tr2i18n( "xxx" ) );
    textLabel2_2->setText( tr2i18n( "Account type" ) );
    TQWhatsThis::add( m_conversionRate, tr2i18n( "For foreign currencies an initial conversion rate needs to be provided. This should be the price of the foreign currency in the base currency on the opening date of the account." ) );
    textLabel1->setText( tr2i18n( "Account name" ) );
    textLabel1_2->setText( tr2i18n( "Opening balance" ) );
    TQWhatsThis::add( m_typeSelection, tr2i18n( "<p><b>Checking</b>\n"
"Use the checking account type to manage activities on your checking account e.g. payments, checks and cash card purchases.</p>\n"
"\n"
"<p><b>Savings</b>\n"
"Use the savings account type to manage activities on your savings account.</p>\n"
"\n"
"<p><b>Credit Card</b>\n"
"Use the credit card account type to manage activities on your credit card.</p>\n"
"\n"
"<p><b>Cash</b>\n"
"\n"
"Use the cash account type to manage activities in your wallet.</p>\n"
"\n"
"<p><b>Loan</b>\n"
"Use the loan account type to manage amortization loans (e.g. mortgages, car loan, money you lend, private loans etc.).</p>\n"
"\n"
"<p><b>Investment</b>\n"
"Use the investment account to manage your stock, mutual fund and other investments.</p>\n"
"\n"
"<p><b>Asset</b>\n"
"Use the asset account type to manage assets (e.g. your house, car or art collection).</p>\n"
"\n"
"<p><b>Liability</b>\n"
"Use the liability account type to manage any type of liability except amortization loans. Use it for taxes you owe or money you borrowed from friends. For amortization loans like mortgages you should create a loan account.</p>" ) );
    m_preferredAccount->setText( tr2i18n( "Preferred account" ) );
    TQToolTip::add( m_preferredAccount, tr2i18n( "Mark this checkbox if the account should be maintained as preferred account" ) );
    TQWhatsThis::add( m_preferredAccount, tr2i18n( "Selecting the <b>Preferred Account</b> checkbox will allow preferred access in some dialogs and views of KMyMoney." ) );
    TQWhatsThis::add( m_accountName, tr2i18n( "Enter a name under which this account is known within KMyMoney." ) );
    m_onlineQuote->setText( tr2i18n( "Online quote" ) );
}

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

TQMetaObject *KAccountTypePageDecl::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KAccountTypePageDecl( "KAccountTypePageDecl", &KAccountTypePageDecl::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* KAccountTypePageDecl::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(
	"KAccountTypePageDecl", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_KAccountTypePageDecl.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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