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

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

#include "kforecastviewdecl.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqspinbox.h>
#include <ntqcombobox.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <kpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqtextedit.h>
#include <tdelistview.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>

#include "../widgets/kmymoneyaccounttreeforecast.h"

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

    groupBox3 = new TQGroupBox( this, "groupBox3" );
    groupBox3->setColumnLayout(0, TQt::Vertical );
    groupBox3->layout()->setSpacing( 6 );
    groupBox3->layout()->setMargin( 11 );
    groupBox3Layout = new TQHBoxLayout( groupBox3->layout() );
    groupBox3Layout->setAlignment( TQt::AlignTop );

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

    textLabel1 = new TQLabel( groupBox3, "textLabel1" );
    textLabel1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 1, 0, textLabel1->sizePolicy().hasHeightForWidth() ) );

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

    m_forecastDays = new TQSpinBox( groupBox3, "m_forecastDays" );
    m_forecastDays->setMaxValue( 999 );
    m_forecastDays->setMinValue( 1 );

    layout16->addWidget( m_forecastDays, 0, 1 );

    textLabel3 = new TQLabel( groupBox3, "textLabel3" );
    textLabel3->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 1, 0, textLabel3->sizePolicy().hasHeightForWidth() ) );

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

    m_accountsCycle = new TQSpinBox( groupBox3, "m_accountsCycle" );
    m_accountsCycle->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, m_accountsCycle->sizePolicy().hasHeightForWidth() ) );
    m_accountsCycle->setMaxValue( 999 );
    m_accountsCycle->setMinValue( 1 );

    layout16->addWidget( m_accountsCycle, 1, 1 );

    textLabel5 = new TQLabel( groupBox3, "textLabel5" );

    layout16->addWidget( textLabel5, 2, 0 );

    m_beginDay = new TQSpinBox( groupBox3, "m_beginDay" );
    m_beginDay->setMaxValue( 31 );
    m_beginDay->setMinValue( 0 );

    layout16->addWidget( m_beginDay, 2, 1 );

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

    layout16->addWidget( textLabel4, 3, 0 );

    m_forecastCycles = new TQSpinBox( groupBox3, "m_forecastCycles" );
    m_forecastCycles->setMaxValue( 999 );
    m_forecastCycles->setMinValue( 1 );

    layout16->addWidget( m_forecastCycles, 3, 1 );

    textLabel6 = new TQLabel( groupBox3, "textLabel6" );

    layout16->addWidget( textLabel6, 4, 0 );

    m_comboDetail = new TQComboBox( false, groupBox3, "m_comboDetail" );

    layout16->addWidget( m_comboDetail, 4, 1 );
    groupBox3Layout->addLayout( layout16 );
    spacer23 = new TQSpacerItem( 16, 31, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    groupBox3Layout->addItem( spacer23 );

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

    layout17 = new TQVBoxLayout( 0, 0, 6, "layout17"); 
    unnamedLayout = new TQHBoxLayout( 0, 0, 6, "unnamedLayout"); 

    textLabel2 = new TQLabel( groupBox3, "textLabel2" );
    textLabel2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 1, 0, textLabel2->sizePolicy().hasHeightForWidth() ) );
    unnamedLayout->addWidget( textLabel2 );

    m_forecastMethod = new TQLabel( groupBox3, "m_forecastMethod" );
    m_forecastMethod->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 2, 0, m_forecastMethod->sizePolicy().hasHeightForWidth() ) );
    TQFont m_forecastMethod_font(  m_forecastMethod->font() );
    m_forecastMethod_font.setBold( true );
    m_forecastMethod->setFont( m_forecastMethod_font ); 
    unnamedLayout->addWidget( m_forecastMethod );
    layout17->addLayout( unnamedLayout );

    m_historyMethod = new TQButtonGroup( groupBox3, "m_historyMethod" );
    m_historyMethod->setColumnLayout(0, TQt::Vertical );
    m_historyMethod->layout()->setSpacing( 6 );
    m_historyMethod->layout()->setMargin( 11 );
    m_historyMethodLayout = new TQVBoxLayout( m_historyMethod->layout() );
    m_historyMethodLayout->setAlignment( TQt::AlignTop );

    radioButton11 = new TQRadioButton( m_historyMethod, "radioButton11" );
    m_historyMethod->insert( radioButton11, 0 );
    m_historyMethodLayout->addWidget( radioButton11 );

    radioButton12 = new TQRadioButton( m_historyMethod, "radioButton12" );
    m_historyMethod->insert( radioButton12, 1 );
    m_historyMethodLayout->addWidget( radioButton12 );

    radioButton12_2 = new TQRadioButton( m_historyMethod, "radioButton12_2" );
    m_historyMethod->insert( radioButton12_2, 2 );
    m_historyMethodLayout->addWidget( radioButton12_2 );
    layout17->addWidget( m_historyMethod );
    layout76->addLayout( layout17 );
    spacer7 = new TQSpacerItem( 21, 6, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout76->addItem( spacer7 );

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

    m_forecastButton = new KPushButton( groupBox3, "m_forecastButton" );
    layout75->addWidget( m_forecastButton );
    spacer22 = new TQSpacerItem( 31, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout75->addItem( spacer22 );

    m_saveButton = new KPushButton( groupBox3, "m_saveButton" );
    m_saveButton->setEnabled( false );
    layout75->addWidget( m_saveButton );
    layout76->addLayout( layout75 );
    groupBox3Layout->addLayout( layout76 );
    KForecastViewDeclLayout->addWidget( groupBox3 );

    m_tab = new TQTabWidget( this, "m_tab" );
    m_tab->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 1, m_tab->sizePolicy().hasHeightForWidth() ) );

    summary = new TQWidget( m_tab, "summary" );
    summaryLayout = new TQVBoxLayout( summary, 11, 6, "summaryLayout"); 
    unnamedLayout_2 = new TQHBoxLayout( 0, 0, 6, "unnamedLayout_2"); 

    m_summaryList = new KMyMoneyAccountTreeForecast( summary, "m_summaryList" );
    m_summaryList->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 2, 1, m_summaryList->sizePolicy().hasHeightForWidth() ) );
    m_summaryList->setMidLineWidth( 1 );
    m_summaryList->setResizePolicy( KMyMoneyAccountTreeForecast::AutoOneFit );
    unnamedLayout_2->addWidget( m_summaryList );

    m_adviceText = new TQTextEdit( summary, "m_adviceText" );
    m_adviceText->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 1, 1, m_adviceText->sizePolicy().hasHeightForWidth() ) );
    m_adviceText->setResizePolicy( TQTextEdit::AutoOneFit );
    unnamedLayout_2->addWidget( m_adviceText );
    summaryLayout->addLayout( unnamedLayout_2 );
    unnamedLayout_3 = new TQHBoxLayout( 0, 0, 6, "unnamedLayout_3"); 
    summaryLayout->addLayout( unnamedLayout_3 );
    m_tab->insertTab( summary, TQString::fromLatin1("") );

    detail = new TQWidget( m_tab, "detail" );
    detailLayout = new TQVBoxLayout( detail, 0, 6, "detailLayout"); 

    m_forecastList = new KMyMoneyAccountTreeForecast( detail, "m_forecastList" );
    m_forecastList->setResizePolicy( KMyMoneyAccountTreeForecast::AutoOneFit );
    detailLayout->addWidget( m_forecastList );
    m_tab->insertTab( detail, TQString::fromLatin1("") );

    advanced = new TQWidget( m_tab, "advanced" );
    advancedLayout = new TQVBoxLayout( advanced, 0, 6, "advancedLayout"); 

    m_advancedList = new TDEListView( advanced, "m_advancedList" );
    m_advancedList->setResizePolicy( TDEListView::AutoOneFit );
    advancedLayout->addWidget( m_advancedList );
    m_tab->insertTab( advanced, TQString::fromLatin1("") );

    budget = new TQWidget( m_tab, "budget" );
    budgetLayout = new TQVBoxLayout( budget, 0, 6, "budgetLayout"); 

    m_budgetList = new KMyMoneyAccountTreeForecast( budget, "m_budgetList" );
    m_budgetList->setResizePolicy( KMyMoneyAccountTreeForecast::AutoOneFit );
    budgetLayout->addWidget( m_budgetList );
    m_tab->insertTab( budget, TQString::fromLatin1("") );

    m_tabChart = new TQWidget( m_tab, "m_tabChart" );
    m_tabChartLayout = new TQVBoxLayout( m_tabChart, 0, 6, "m_tabChartLayout"); 
    m_tab->insertTab( m_tabChart, TQString::fromLatin1("") );
    KForecastViewDeclLayout->addWidget( m_tab );
    languageChange();
    resize( TQSize(909, 771).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KForecastViewDecl::languageChange()
{
    groupBox3->setTitle( tr2i18n( "Forecast Settings" ) );
    textLabel1->setText( tr2i18n( "Days to Forecast:" ) );
    textLabel3->setText( tr2i18n( "Days of Accounts Cycle:" ) );
    textLabel5->setText( tr2i18n( "Day of Month to start Forecast:" ) );
    textLabel4->setText( tr2i18n( "Historic Cycles:" ) );
    textLabel6->setText( tr2i18n( "Chart Detail:" ) );
    m_comboDetail->clear();
    m_comboDetail->insertItem( tr2i18n( "All" ) );
    m_comboDetail->insertItem( tr2i18n( "Top-Level" ) );
    m_comboDetail->insertItem( tr2i18n( "Groups" ) );
    m_comboDetail->insertItem( tr2i18n( "Totals" ) );
    m_comboDetail->setCurrentItem( 2 );
    TQToolTip::add( m_comboDetail, tr2i18n( "<p>Choose what level of detail to show on the chart.</p>" ) );
    textLabel2->setText( tr2i18n( "Current Forecast Method:" ) );
    m_forecastMethod->setText( tr2i18n( "method" ) );
    m_historyMethod->setTitle( tr2i18n( "History Forecast Method" ) );
    radioButton11->setText( tr2i18n( "Simple Moving Average" ) );
    radioButton12->setText( tr2i18n( "Weighted Moving Average" ) );
    radioButton12_2->setText( tr2i18n( "Linear Regression" ) );
    m_forecastButton->setText( tr2i18n( "Forecast" ) );
    m_saveButton->setText( tr2i18n( "Save" ) );
    m_tab->changeTab( summary, tr2i18n( "Summary" ) );
    m_tab->changeTab( detail, tr2i18n( "Detail" ) );
    m_tab->changeTab( advanced, tr2i18n( "Advanced" ) );
    m_tab->changeTab( budget, tr2i18n( "Budget Forecast" ) );
    m_tab->changeTab( m_tabChart, tr2i18n( "Chart" ) );
}

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

TQMetaObject *KForecastViewDecl::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KForecastViewDecl( "KForecastViewDecl", &KForecastViewDecl::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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