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

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

#include "knewinvestmentwizarddecl.h"

#include <ntqvariant.h>
#include <kmymoney/kmymoneydateinput.h>
#include <kmymoney/kmymoneyedit.h>
#include <kmymoney/kmymoneycategory.h>
#include <kmymoney/kmymoneycombo.h>
#include <kmymoney/kmymoneycurrencyselector.h>
#include <ntqpushbutton.h>
#include <ntqwidget.h>
#include <ntqlabel.h>
#include <kcombobox.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "../widgets/kmymoneylineedit.h"

/*
 *  Constructs a KNewInvestmentWizardDecl as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qwizard will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qwizard.
 */
KNewInvestmentWizardDecl::KNewInvestmentWizardDecl( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : KWizard( parent, name, modal, fl )
{
    if ( !name )
	setName( "KNewInvestmentWizardDecl" );

    m_investmentTypePage = new TQWidget( this, "m_investmentTypePage" );
    m_investmentTypePageLayout = new TQVBoxLayout( m_investmentTypePage, 11, 6, "m_investmentTypePageLayout"); 

    m_introLabel = new TQLabel( m_investmentTypePage, "m_introLabel" );
    m_introLabel->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignTop ) );
    m_investmentTypePageLayout->addWidget( m_introLabel );
    spacer8 = new TQSpacerItem( 20, 10, TQSizePolicy::Minimum, TQSizePolicy::Fixed );
    m_investmentTypePageLayout->addItem( spacer8 );

    textLabel1 = new TQLabel( m_investmentTypePage, "textLabel1" );
    textLabel1->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignTop ) );
    m_investmentTypePageLayout->addWidget( textLabel1 );
    spacer3 = new TQSpacerItem( 20, 30, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    m_investmentTypePageLayout->addItem( spacer3 );

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

    textLabel2 = new TQLabel( m_investmentTypePage, "textLabel2" );
    layout1->addWidget( textLabel2 );

    m_securityType = new KComboBox( false, m_investmentTypePage, "m_securityType" );
    layout1->addWidget( m_securityType );
    spacer1 = new TQSpacerItem( 61, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout1->addItem( spacer1 );
    m_investmentTypePageLayout->addLayout( layout1 );
    spacer2 = new TQSpacerItem( 20, 60, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    m_investmentTypePageLayout->addItem( spacer2 );
    addPage( m_investmentTypePage, TQString("") );

    m_investmentDetailsPage = new TQWidget( this, "m_investmentDetailsPage" );
    m_investmentDetailsPageLayout = new TQVBoxLayout( m_investmentDetailsPage, 11, 6, "m_investmentDetailsPageLayout"); 

    textLabel3_2 = new TQLabel( m_investmentDetailsPage, "textLabel3_2" );
    textLabel3_2->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignTop ) );
    m_investmentDetailsPageLayout->addWidget( textLabel3_2 );
    spacer6 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    m_investmentDetailsPageLayout->addItem( spacer6 );

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

    m_investmentName = new kMyMoneyLineEdit( m_investmentDetailsPage, "m_investmentName" );

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

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

    textLabel1_5 = new TQLabel( m_investmentDetailsPage, "textLabel1_5" );
    textLabel1_5->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, textLabel1_5->sizePolicy().hasHeightForWidth() ) );
    textLabel1_5->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    layout4->addWidget( textLabel1_5 );

    m_fraction = new kMyMoneyEdit( m_investmentDetailsPage, "m_fraction" );
    layout4->addWidget( m_fraction );

    layout9->addLayout( layout4, 2, 1 );

    textLabel2_5 = new TQLabel( m_investmentDetailsPage, "textLabel2_5" );

    layout9->addWidget( textLabel2_5, 6, 0 );

    textLabel2_2_2 = new TQLabel( m_investmentDetailsPage, "textLabel2_2_2" );

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

    textLabel1_4 = new TQLabel( m_investmentDetailsPage, "textLabel1_4" );

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

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

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

    m_priceMode = new KMyMoneyGeneralCombo( m_investmentDetailsPage, "m_priceMode" );

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

    m_tradingMarket = new KComboBox( false, m_investmentDetailsPage, "m_tradingMarket" );
    m_tradingMarket->setEditable( true );

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

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

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

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

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

    m_tradingCurrencyEdit = new KMyMoneySecuritySelector( m_investmentDetailsPage, "m_tradingCurrencyEdit" );

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

    m_investmentSymbol = new kMyMoneyLineEdit( m_investmentDetailsPage, "m_investmentSymbol" );

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

    m_investmentIdentification = new kMyMoneyLineEdit( m_investmentDetailsPage, "m_investmentIdentification" );

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

    textLabel1_3 = new TQLabel( m_investmentDetailsPage, "textLabel1_3" );

    layout9->addWidget( textLabel1_3, 3, 0 );
    m_investmentDetailsPageLayout->addLayout( layout9 );
    spacer5 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    m_investmentDetailsPageLayout->addItem( spacer5 );
    addPage( m_investmentDetailsPage, TQString("") );

    m_onlineUpdatePage = new TQWidget( this, "m_onlineUpdatePage" );
    m_onlineUpdatePageLayout = new TQVBoxLayout( m_onlineUpdatePage, 11, 6, "m_onlineUpdatePageLayout"); 

    textLabel6 = new TQLabel( m_onlineUpdatePage, "textLabel6" );
    textLabel6->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignTop ) );
    m_onlineUpdatePageLayout->addWidget( textLabel6 );

    layout25 = new TQHBoxLayout( 0, 0, 0, "layout25"); 

    layout24 = new TQVBoxLayout( 0, 0, 6, "layout24"); 

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

    textLabel2_4 = new TQLabel( m_onlineUpdatePage, "textLabel2_4" );
    layout21->addWidget( textLabel2_4 );

    m_useFinanceQuote = new TQCheckBox( m_onlineUpdatePage, "m_useFinanceQuote" );
    layout21->addWidget( m_useFinanceQuote );
    layout24->addLayout( layout21 );

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

    textLabel2_3 = new TQLabel( m_onlineUpdatePage, "textLabel2_3" );
    layout23->addWidget( textLabel2_3 );

    m_onlineSourceCombo = new KComboBox( false, m_onlineUpdatePage, "m_onlineSourceCombo" );
    m_onlineSourceCombo->setMinimumSize( TQSize( 180, 0 ) );
    layout23->addWidget( m_onlineSourceCombo );
    layout24->addLayout( layout23 );

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

    textLabel1_6 = new TQLabel( m_onlineUpdatePage, "textLabel1_6" );
    layout22->addWidget( textLabel1_6 );

    m_onlineFactor = new kMyMoneyEdit( m_onlineUpdatePage, "m_onlineFactor" );
    layout22->addWidget( m_onlineFactor );
    layout24->addLayout( layout22 );
    layout25->addLayout( layout24 );
    spacer29 = new TQSpacerItem( 371, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout25->addItem( spacer29 );
    m_onlineUpdatePageLayout->addLayout( layout25 );
    spacer30 = new TQSpacerItem( 20, 181, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    m_onlineUpdatePageLayout->addItem( spacer30 );
    addPage( m_onlineUpdatePage, TQString("") );
    languageChange();
    resize( TQSize(584, 385).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( m_securityType, m_investmentSymbol );
    setTabOrder( m_investmentSymbol, m_investmentName );
    setTabOrder( m_investmentName, m_fraction );
    setTabOrder( m_fraction, m_tradingMarket );
    setTabOrder( m_tradingMarket, m_investmentIdentification );
    setTabOrder( m_investmentIdentification, m_tradingCurrencyEdit );
    setTabOrder( m_tradingCurrencyEdit, m_priceMode );
    setTabOrder( m_priceMode, m_useFinanceQuote );
    setTabOrder( m_useFinanceQuote, m_onlineSourceCombo );
    setTabOrder( m_onlineSourceCombo, m_onlineFactor );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KNewInvestmentWizardDecl::languageChange()
{
    setCaption( tr2i18n( "New Investment wizard" ) );
    m_introLabel->setText( tr2i18n( "This wizard allows you to create a new investment." ) );
    textLabel1->setText( tr2i18n( "The first step in this process requires to select the type of investment. The following steps collect more details about the investment from you." ) );
    textLabel2->setText( tr2i18n( "Type of investment" ) );
    m_securityType->clear();
    m_securityType->insertItem( tr2i18n( "Stock" ) );
    m_securityType->insertItem( tr2i18n( "Mutual Fund" ) );
    m_securityType->insertItem( tr2i18n( "Bond" ) );
    setTitle( m_investmentTypePage, tr2i18n( "Investment Type" ) );
    textLabel3_2->setText( tr2i18n( "Enter the details below and click <b>Next</b> to continue entering the online update details." ) );
    textLabel1_5->setText( tr2i18n( "1 /" ) );
    textLabel2_5->setText( tr2i18n( "Price entry" ) );
    textLabel2_2_2->setText( tr2i18n( "Fraction" ) );
    textLabel1_4->setText( tr2i18n( "Trading Currency" ) );
    textLabel3->setText( tr2i18n( "Full name" ) );
    m_tradingMarket->clear();
    m_tradingMarket->insertItem( tr2i18n( "AMEX" ) );
    m_tradingMarket->insertItem( tr2i18n( "EUREX" ) );
    m_tradingMarket->insertItem( tr2i18n( "FUND" ) );
    m_tradingMarket->insertItem( tr2i18n( "NASDAQ" ) );
    m_tradingMarket->insertItem( tr2i18n( "NYSE" ) );
    m_tradingMarket->insertItem( tr2i18n( "XETRA" ) );
    textLabel2_2->setText( tr2i18n( "Trading symbol" ) );
    textLabel1_2->setText( tr2i18n( "Identification" ) );
    TQToolTip::add( m_investmentSymbol, tr2i18n( "Enter the ticker symbol (e.g. RHAT)." ) );
    TQToolTip::add( m_investmentIdentification, tr2i18n( "Enter the CUSIP/ISIN/WKN identification number here" ) );
    textLabel1_3->setText( tr2i18n( "Trading market" ) );
    setTitle( m_investmentDetailsPage, tr2i18n( "Investment details" ) );
    textLabel6->setText( tr2i18n( "Select an online source and click <b>Finish</b> to store the investment data. If you don't want to use online updates, just leave the data as is." ) );
    textLabel2_4->setText( tr2i18n( "Use Finance::Quote" ) );
    m_useFinanceQuote->setText( TQString::null );
    textLabel2_3->setText( tr2i18n( "Online Source" ) );
    m_onlineSourceCombo->clear();
    m_onlineSourceCombo->insertItem( TQString::null );
    textLabel1_6->setText( tr2i18n( "Factor" ) );
    setTitle( m_onlineUpdatePage, tr2i18n( "Online Update" ) );
}

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

TQMetaObject *KNewInvestmentWizardDecl::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KNewInvestmentWizardDecl( "KNewInvestmentWizardDecl", &KNewInvestmentWizardDecl::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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