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

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

#include "kschedulepagedecl.h"

#include <ntqvariant.h>
#include <kmymoney/kmymoneydateinput.h>
#include <kmymoney/kmymoneyedit.h>
#include <kmymoney/kmymoneycategory.h>
#include <kmymoney/kmymoneycombo.h>
#include <kactivelabel.h>
#include <ntqcheckbox.h>
#include <ntqframe.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    kActiveLabel16 = new KActiveLabel( this, "kActiveLabel16" );
    KSchedulePageDeclLayout->addWidget( kActiveLabel16 );

    m_reminderCheckBox = new TQCheckBox( this, "m_reminderCheckBox" );
    m_reminderCheckBox->setFocusPolicy( TQCheckBox::StrongFocus );
    KSchedulePageDeclLayout->addWidget( m_reminderCheckBox );

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

    textLabel2 = new TQLabel( m_paymentFrame, "textLabel2" );
    textLabel2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 0, 0, textLabel2->sizePolicy().hasHeightForWidth() ) );
    textLabel2->setMinimumSize( TQSize( 180, 0 ) );

    m_paymentFrameLayout->addWidget( textLabel2, 0, 0 );

    m_name = new TQLineEdit( m_paymentFrame, "m_name" );

    m_paymentFrameLayout->addWidget( m_name, 0, 1 );

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

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

    m_payee = new KMyMoneyPayeeCombo( m_paymentFrame, "m_payee" );

    m_paymentFrameLayout->addWidget( m_payee, 1, 1 );

    TextLabel2_2 = new TQLabel( m_paymentFrame, "TextLabel2_2" );

    m_paymentFrameLayout->addWidget( TextLabel2_2, 2, 0 );

    m_amount = new kMyMoneyEdit( m_paymentFrame, "m_amount" );
    m_amount->setFocusPolicy( kMyMoneyEdit::StrongFocus );

    m_paymentFrameLayout->addWidget( m_amount, 2, 1 );

    TextLabel4_3 = new TQLabel( m_paymentFrame, "TextLabel4_3" );

    m_paymentFrameLayout->addWidget( TextLabel4_3, 3, 0 );

    m_date = new kMyMoneyDateInput( m_paymentFrame, "m_date" );
    m_date->setFocusPolicy( kMyMoneyDateInput::StrongFocus );

    m_paymentFrameLayout->addWidget( m_date, 3, 1 );

    TextLabel3_3 = new TQLabel( m_paymentFrame, "TextLabel3_3" );
    TextLabel3_3->setAlignment( int( TQLabel::AlignTop ) );

    m_paymentFrameLayout->addWidget( TextLabel3_3, 4, 0 );

    m_paymentAccount = new KMyMoneyCategory( m_paymentFrame, "m_paymentAccount" );

    m_paymentFrameLayout->addWidget( m_paymentAccount, 4, 1 );

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

    m_paymentFrameLayout->addWidget( textLabel4, 5, 0 );

    m_method = new KMyMoneyGeneralCombo( m_paymentFrame, "m_method" );

    m_paymentFrameLayout->addWidget( m_method, 5, 1 );
    KSchedulePageDeclLayout->addWidget( m_paymentFrame );
    spacer23 = new TQSpacerItem( 20, 31, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    KSchedulePageDeclLayout->addItem( spacer23 );
    languageChange();
    resize( TQSize(544, 391).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_reminderCheckBox, TQ_SIGNAL( toggled(bool) ), m_paymentFrame, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KSchedulePageDecl::languageChange()
{
    kActiveLabel16->setText( tr2i18n( "For credit card accounts you can create a monthly schedule which will automatically remind you about the payment. Please fill in the details about this payment here." ) );
    m_reminderCheckBox->setText( tr2i18n( "Yes, remind me when the payment is due" ) );
    textLabel2->setText( tr2i18n( "Name of schedule" ) );
    textLabel3->setText( tr2i18n( "Payee" ) );
    TextLabel2_2->setText( tr2i18n( "Estimated monthly payment" ) );
    TextLabel4_3->setText( tr2i18n( "Due date of next payment" ) );
    TextLabel3_3->setText( tr2i18n( "Payment should be made\n"
"from account" ) );
    textLabel4->setText( tr2i18n( "Payment method" ) );
}

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

TQMetaObject *KSchedulePageDecl::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KSchedulePageDecl( "KSchedulePageDecl", &KSchedulePageDecl::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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