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

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

#include "kaccountpagedecl.h"

#include <ntqvariant.h>
#include <kmymoney/kmymoneydateinput.h>
#include <kmymoney/kmymoneyedit.h>
#include <ntqpushbutton.h>
#include <kactivelabel.h>
#include <ntqcheckbox.h>
#include <ntqframe.h>
#include <klineedit.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    kActiveLabel2 = new KActiveLabel( this, "kActiveLabel2" );
    kActiveLabel2->setFocusPolicy( KActiveLabel::NoFocus );
    KAccountPageDeclLayout->addWidget( kActiveLabel2 );

    m_haveCheckingAccountButton = new TQCheckBox( this, "m_haveCheckingAccountButton" );
    KAccountPageDeclLayout->addWidget( m_haveCheckingAccountButton );

    m_accountDataFrame = new TQFrame( this, "m_accountDataFrame" );
    m_accountDataFrame->setFrameShape( TQFrame::NoFrame );
    m_accountDataFrame->setFrameShadow( TQFrame::Plain );
    m_accountDataFrameLayout = new TQGridLayout( m_accountDataFrame, 1, 1, 0, 6, "m_accountDataFrameLayout"); 

    m_institutionNameEdit = new KLineEdit( m_accountDataFrame, "m_institutionNameEdit" );

    m_accountDataFrameLayout->addWidget( m_institutionNameEdit, 5, 1 );

    m_institutionNumberEdit = new KLineEdit( m_accountDataFrame, "m_institutionNumberEdit" );

    m_accountDataFrameLayout->addWidget( m_institutionNumberEdit, 6, 1 );

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

    m_accountDataFrameLayout->addWidget( textLabel3, 5, 0 );

    textLabel4 = new TQLabel( m_accountDataFrame, "textLabel4" );

    m_accountDataFrameLayout->addWidget( textLabel4, 6, 0 );

    m_accountNumberEdit = new KLineEdit( m_accountDataFrame, "m_accountNumberEdit" );

    m_accountDataFrameLayout->addWidget( m_accountNumberEdit, 2, 1 );

    m_accountNameEdit = new KLineEdit( m_accountDataFrame, "m_accountNameEdit" );

    m_accountDataFrameLayout->addWidget( m_accountNameEdit, 1, 1 );

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

    m_accountDataFrameLayout->addWidget( textLabel1_2, 3, 0 );

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

    m_openingDateEdit = new kMyMoneyDateInput( m_accountDataFrame, "m_openingDateEdit" );
    layout3->addWidget( m_openingDateEdit );
    spacer5 = new TQSpacerItem( 81, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout3->addItem( spacer5 );

    m_accountDataFrameLayout->addLayout( layout3, 3, 1 );

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

    m_accountDataFrameLayout->addWidget( textLabel2, 2, 0 );

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

    m_accountDataFrameLayout->addWidget( textLabel1, 1, 0 );

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

    m_accountDataFrameLayout->addWidget( textLabel2_2, 4, 0 );

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

    m_accountCurrencyLabel = new TQLabel( m_accountDataFrame, "m_accountCurrencyLabel" );
    layout5->addWidget( m_accountCurrencyLabel );

    m_openingBalanceEdit = new kMyMoneyEdit( m_accountDataFrame, "m_openingBalanceEdit" );
    m_openingBalanceEdit->setProperty( "resetButtonVisibility", TQVariant( false ) );
    layout5->addWidget( m_openingBalanceEdit );
    spacer6 = new TQSpacerItem( 200, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout5->addItem( spacer6 );

    m_accountDataFrameLayout->addLayout( layout5, 4, 1 );

    kActiveLabel1 = new KActiveLabel( m_accountDataFrame, "kActiveLabel1" );
    kActiveLabel1->setFocusPolicy( KActiveLabel::NoFocus );

    m_accountDataFrameLayout->addMultiCellWidget( kActiveLabel1, 0, 0, 0, 1 );
    KAccountPageDeclLayout->addWidget( m_accountDataFrame );
    spacer1 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    KAccountPageDeclLayout->addItem( spacer1 );
    languageChange();
    resize( TQSize(600, 481).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_haveCheckingAccountButton, TQ_SIGNAL( toggled(bool) ), m_accountDataFrame, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( m_accountNameEdit, m_accountNumberEdit );
    setTabOrder( m_accountNumberEdit, m_openingDateEdit );
    setTabOrder( m_openingDateEdit, m_openingBalanceEdit );
    setTabOrder( m_openingBalanceEdit, m_institutionNameEdit );
    setTabOrder( m_institutionNameEdit, m_institutionNumberEdit );
    setTabOrder( m_institutionNumberEdit, m_haveCheckingAccountButton );
    setTabOrder( m_haveCheckingAccountButton, kActiveLabel2 );
    setTabOrder( kActiveLabel2, kActiveLabel1 );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KAccountPageDecl::languageChange()
{
    kActiveLabel2->setText( tr2i18n( "A typical KMyMoney user maintains a checking a account with some institution and uses it to receive money or pay bills. If this is not the case, please deselect the checkbox below and continue on the next page." ) );
    m_haveCheckingAccountButton->setText( tr2i18n( "I have a checking account that I want to manage with KMyMoney" ) );
    TQWhatsThis::add( m_institutionNameEdit, tr2i18n( "The name of the instititution that issued the account." ) );
    TQWhatsThis::add( m_institutionNumberEdit, tr2i18n( "Each institution has a routing number. Enter it here. If uncertain, leave the field blank. You can modify it later." ) );
    textLabel3->setText( tr2i18n( "Name of the institution" ) );
    textLabel4->setText( tr2i18n( "Routing number" ) );
    TQWhatsThis::add( m_accountNumberEdit, tr2i18n( "In general the institution that issued the account also issued a number for it. Enter it here. If uncertain, you can modify this entry later." ) );
    TQWhatsThis::add( m_accountNameEdit, tr2i18n( "Enter a descriptive name that will be used by KMyMoney to identify your checking account." ) );
    textLabel1_2->setText( tr2i18n( "Opening date" ) );
    TQWhatsThis::add( m_openingDateEdit, tr2i18n( "Enter the date from when on you plan to keep track of the transactions in that account. This is usually the date of the last statement. If uncertain, leave as is." ) );
    textLabel2->setText( tr2i18n( "Number of the account" ) );
    textLabel1->setText( tr2i18n( "Name of the account" ) );
    textLabel2_2->setText( tr2i18n( "Opening balance" ) );
    m_accountCurrencyLabel->setText( tr2i18n( "xxx" ) );
    TQWhatsThis::add( m_openingBalanceEdit, tr2i18n( "Enter the opening balance of the account. This is usually the ending balance of the last statement. If uncertain, leave as is." ) );
    kActiveLabel1->setText( tr2i18n( "The fields below allow you to enter some information about your checking account. Once this wizard finishes, the account will be created for you within KMyMoney." ) );
}

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

TQMetaObject *KAccountPageDecl::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KAccountPageDecl( "KAccountPageDecl", &KAccountPageDecl::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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