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

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

#include "transactionsortoption.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <tdelistview.h>
#include <kpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "transactionsortoption.ui.h"

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

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

    m_availableList = new TDEListView( this, "m_availableList" );
    m_availableList->addColumn( tr2i18n( "Sort options" ) );
    m_availableList->setAllColumnsShowFocus( true );
    m_availableList->setResizeMode( TDEListView::AllColumns );
    m_availableList->setItemsMovable( false );
    layout3->addWidget( m_availableList );
    TransactionSortOptionLayout->addLayout( layout3 );

    layout5 = new TQVBoxLayout( 0, 0, 6, "layout5"); 
    spacer3 = new TQSpacerItem( 20, 67, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout5->addItem( spacer3 );

    m_addButton = new KPushButton( this, "m_addButton" );
    layout5->addWidget( m_addButton );

    m_removeButton = new KPushButton( this, "m_removeButton" );
    layout5->addWidget( m_removeButton );
    spacer4 = new TQSpacerItem( 21, 67, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout5->addItem( spacer4 );
    TransactionSortOptionLayout->addLayout( layout5 );

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

    m_selectedList = new TDEListView( this, "m_selectedList" );
    m_selectedList->addColumn( tr2i18n( "Sort order" ) );
    m_selectedList->setAllColumnsShowFocus( true );
    m_selectedList->setResizeMode( TDEListView::AllColumns );
    m_selectedList->setItemsMovable( false );
    layout4->addWidget( m_selectedList );
    TransactionSortOptionLayout->addLayout( layout4 );

    layout6 = new TQVBoxLayout( 0, 0, 6, "layout6"); 
    spacer5 = new TQSpacerItem( 20, 67, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout6->addItem( spacer5 );

    m_upButton = new KPushButton( this, "m_upButton" );
    layout6->addWidget( m_upButton );

    m_downButton = new KPushButton( this, "m_downButton" );
    layout6->addWidget( m_downButton );
    spacer6 = new TQSpacerItem( 20, 67, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout6->addItem( spacer6 );
    TransactionSortOptionLayout->addLayout( layout6 );
    languageChange();
    resize( TQSize(486, 228).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_addButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotAddItem() ) );
    connect( m_availableList, TQ_SIGNAL( selectionChanged(TQListViewItem*) ), this, TQ_SLOT( slotAvailableSelected(TQListViewItem*) ) );
    connect( m_downButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotDownItem() ) );
    connect( m_removeButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotRemoveItem() ) );
    connect( m_selectedList, TQ_SIGNAL( selectionChanged(TQListViewItem*) ), this, TQ_SLOT( slotSelectedSelected(TQListViewItem*) ) );
    connect( m_upButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotUpItem() ) );
    connect( m_selectedList, TQ_SIGNAL( doubleClicked(TQListViewItem*) ), this, TQ_SLOT( toggleDirection(TQListViewItem*) ) );
    connect( m_selectedList, TQ_SIGNAL( spacePressed(TQListViewItem*) ), this, TQ_SLOT( toggleDirection(TQListViewItem*) ) );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void TransactionSortOption::languageChange()
{
    setCaption( tr2i18n( "TransactionSortOptionDecl" ) );
    m_availableList->header()->setLabel( 0, tr2i18n( "Sort options" ) );
    m_addButton->setText( TQString::null );
    m_removeButton->setText( TQString::null );
    m_selectedList->header()->setLabel( 0, tr2i18n( "Sort order" ) );
    m_upButton->setText( TQString::null );
    m_downButton->setText( TQString::null );
}

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

TQMetaObject *TransactionSortOption::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_TransactionSortOption( "TransactionSortOption", &TransactionSortOption::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* TransactionSortOption::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 TQUParameter param_slot_0[] = {
	{ "settings", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"setSettings", 1, param_slot_0 };
    static const TQUParameter param_slot_1[] = {
	{ "item", &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"toggleDirection", 1, param_slot_1 };
    static const TQUMethod slot_2 = {"languageChange", 0, 0 };
    static const TQUParameter param_slot_3[] = {
	{ "item", &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_3 = {"slotAvailableSelected", 1, param_slot_3 };
    static const TQUParameter param_slot_4[] = {
	{ "item", &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_4 = {"slotSelectedSelected", 1, param_slot_4 };
    static const TQUMethod slot_5 = {"slotAddItem", 0, 0 };
    static const TQUMethod slot_6 = {"slotRemoveItem", 0, 0 };
    static const TQUMethod slot_7 = {"slotUpItem", 0, 0 };
    static const TQUMethod slot_8 = {"slotDownItem", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "setSettings(const TQString&)", &slot_0, TQMetaData::Public },
	{ "toggleDirection(TQListViewItem*)", &slot_1, TQMetaData::Public },
	{ "languageChange()", &slot_2, TQMetaData::Protected },
	{ "slotAvailableSelected(TQListViewItem*)", &slot_3, TQMetaData::Protected },
	{ "slotSelectedSelected(TQListViewItem*)", &slot_4, TQMetaData::Protected },
	{ "slotAddItem()", &slot_5, TQMetaData::Protected },
	{ "slotRemoveItem()", &slot_6, TQMetaData::Protected },
	{ "slotUpItem()", &slot_7, TQMetaData::Protected },
	{ "slotDownItem()", &slot_8, TQMetaData::Protected }
    };
    static const TQUParameter param_signal_0[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod signal_0 = {"settingsChanged", 1, param_signal_0 };
    static const TQMetaData signal_tbl[] = {
	{ "settingsChanged(const TQString&)", &signal_0, TQMetaData::Public }
    };
    metaObj = TQMetaObject::new_metaobject(
	"TransactionSortOption", parentObject,
	slot_tbl, 9,
	signal_tbl, 1,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_TransactionSortOption.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

// TQ_SIGNAL settingsChanged
void TransactionSortOption::settingsChanged( const TQString& t0 )
{
    activate_signal( staticMetaObject()->signalOffset() + 0, t0 );
}

bool TransactionSortOption::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: setSettings((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 1: toggleDirection((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 2: languageChange(); break;
    case 3: slotAvailableSelected((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 4: slotSelectedSelected((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 5: slotAddItem(); break;
    case 6: slotRemoveItem(); break;
    case 7: slotUpItem(); break;
    case 8: slotDownItem(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool TransactionSortOption::tqt_emit( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: settingsChanged((const TQString&)static_QUType_TQString.get(_o+1)); break;
    default:
	return TQWidget::tqt_emit(_id,_o);
    }
    return true;
}
#ifndef TQT_NO_PROPERTIES

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

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