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

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

#include "kbudgetviewdecl.h"

#include <ntqvariant.h>
#include <kmymoney/kmymoneyedit.h>
#include <kmymoney/kbudgetvalues.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <kpushbutton.h>
#include <tdelistview.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "../widgets/kmymoneyaccounttreebudget.h"

/*
 *  Constructs a KBudgetViewDecl as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
KBudgetViewDecl::KBudgetViewDecl( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "KBudgetViewDecl" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 1, 1, sizePolicy().hasHeightForWidth() ) );
    setFocusPolicy( TQWidget::TabFocus );
    KBudgetViewDeclLayout = new TQVBoxLayout( this, 0, 6, "KBudgetViewDeclLayout"); 

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

    groupBox1 = new TQGroupBox( this, "groupBox1" );
    groupBox1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, groupBox1->sizePolicy().hasHeightForWidth() ) );
    groupBox1->setColumnLayout(0, TQt::Vertical );
    groupBox1->layout()->setSpacing( 6 );
    groupBox1->layout()->setMargin( 11 );
    groupBox1Layout = new TQVBoxLayout( groupBox1->layout() );
    groupBox1Layout->setAlignment( TQt::AlignTop );

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

    m_newButton = new KPushButton( groupBox1, "m_newButton" );
    layout8->addWidget( m_newButton );

    m_renameButton = new KPushButton( groupBox1, "m_renameButton" );
    layout8->addWidget( m_renameButton );

    m_deleteButton = new KPushButton( groupBox1, "m_deleteButton" );
    layout8->addWidget( m_deleteButton );

    m_resetButton = new KPushButton( groupBox1, "m_resetButton" );
    m_resetButton->setEnabled( false );
    layout8->addWidget( m_resetButton );

    m_updateButton = new KPushButton( groupBox1, "m_updateButton" );
    m_updateButton->setEnabled( false );
    layout8->addWidget( m_updateButton );
    groupBox1Layout->addLayout( layout8 );

    m_budgetList = new TDEListView( groupBox1, "m_budgetList" );
    m_budgetList->addColumn( tr2i18n( "Name" ) );
    m_budgetList->addColumn( tr2i18n( "Year" ) );
    m_budgetList->header()->setResizeEnabled( false, m_budgetList->header()->count() - 1 );
    m_budgetList->setAllColumnsShowFocus( true );
    m_budgetList->setShowSortIndicator( true );
    m_budgetList->setFullWidth( false );
    m_budgetList->setShadeSortColumn( false );
    groupBox1Layout->addWidget( m_budgetList );
    layout7->addWidget( groupBox1 );

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

    m_accountTree = new KMyMoneyAccountTreeBudget( this, "m_accountTree" );
    m_accountTree->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 5, 1, m_accountTree->sizePolicy().hasHeightForWidth() ) );
    layout6->addWidget( m_accountTree );

    m_hideUnusedButton = new TQCheckBox( this, "m_hideUnusedButton" );
    layout6->addWidget( m_hideUnusedButton );

    m_assignmentBox = new TQGroupBox( this, "m_assignmentBox" );
    m_assignmentBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 5, 0, m_assignmentBox->sizePolicy().hasHeightForWidth() ) );
    m_assignmentBox->setColumnLayout(0, TQt::Vertical );
    m_assignmentBox->layout()->setSpacing( 6 );
    m_assignmentBox->layout()->setMargin( 11 );
    m_assignmentBoxLayout = new TQVBoxLayout( m_assignmentBox->layout() );
    m_assignmentBoxLayout->setAlignment( TQt::AlignTop );

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

    textLabel3 = new TQLabel( m_assignmentBox, "textLabel3" );
    layout7_2->addWidget( textLabel3 );

    m_leAccounts = new TQLineEdit( m_assignmentBox, "m_leAccounts" );
    m_leAccounts->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 1, 0, m_leAccounts->sizePolicy().hasHeightForWidth() ) );
    m_leAccounts->setFocusPolicy( TQLineEdit::NoFocus );
    m_leAccounts->setReadOnly( true );
    layout7_2->addWidget( m_leAccounts );

    textLabel1 = new TQLabel( m_assignmentBox, "textLabel1" );
    layout7_2->addWidget( textLabel1 );

    m_accountTotal = new kMyMoneyEdit( m_assignmentBox, "m_accountTotal" );
    m_accountTotal->setFocusPolicy( kMyMoneyEdit::NoFocus );
    m_accountTotal->setProperty( "calculatorButtonVisibility", TQVariant( false ) );
    m_accountTotal->setProperty( "resetButtonVisibility", TQVariant( false ) );
    m_accountTotal->setReadOnly( true );
    layout7_2->addWidget( m_accountTotal );
    m_assignmentBoxLayout->addLayout( layout7_2 );

    m_cbBudgetSubaccounts = new TQCheckBox( m_assignmentBox, "m_cbBudgetSubaccounts" );
    m_assignmentBoxLayout->addWidget( m_cbBudgetSubaccounts );

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

    m_budgetValue = new KBudgetValues( m_assignmentBox, "m_budgetValue" );
    layout9->addWidget( m_budgetValue );
    spacer2 = new TQSpacerItem( 21, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout9->addItem( spacer2 );
    m_assignmentBoxLayout->addLayout( layout9 );
    layout6->addWidget( m_assignmentBox );
    layout7->addLayout( layout6 );
    KBudgetViewDeclLayout->addLayout( layout7 );
    languageChange();
    resize( TQSize(957, 610).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KBudgetViewDecl::languageChange()
{
    groupBox1->setTitle( tr2i18n( "Your budgets" ) );
    m_newButton->setText( tr2i18n( "New" ) );
    m_renameButton->setText( tr2i18n( "Ren" ) );
    m_deleteButton->setText( tr2i18n( "Del" ) );
    m_resetButton->setText( tr2i18n( "Res" ) );
    m_updateButton->setText( tr2i18n( "Upd" ) );
    m_budgetList->header()->setLabel( 0, tr2i18n( "Name" ) );
    m_budgetList->header()->setLabel( 1, tr2i18n( "Year" ) );
    m_hideUnusedButton->setText( tr2i18n( "Hide unused budget categories" ) );
    m_assignmentBox->setTitle( tr2i18n( "Assignments" ) );
    textLabel3->setText( tr2i18n( "Account" ) );
    textLabel1->setText( tr2i18n( "Total" ) );
    m_cbBudgetSubaccounts->setText( tr2i18n( "Include subaccounts" ) );
}

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

TQMetaObject *KBudgetViewDecl::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KBudgetViewDecl( "KBudgetViewDecl", &KBudgetViewDecl::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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