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

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

#include "profileeditorbase.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <kdialog.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <tdelistbox.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqsplitter.h>
#include <ntqwidgetstack.h>
#include <ntqtabwidget.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    splitter2 = new TQSplitter( this, "splitter2" );
    splitter2->setOrientation( TQSplitter::Vertical );

    widgetStack1 = new TQWidgetStack( splitter2, "widgetStack1" );

    WStackPage = new TQWidget( widgetStack1, "WStackPage" );
    WStackPageLayout = new TQVBoxLayout( WStackPage, 0, 0, "WStackPageLayout"); 

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

    addProfileButton = new KPushButton( WStackPage, "addProfileButton" );

    layout11->addWidget( addProfileButton, 0, 1 );
    spacer1 = new TQSpacerItem( 20, 142, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout11->addItem( spacer1, 2, 1 );

    profilesList = new TDEListView( WStackPage, "profilesList" );
    profilesList->addColumn( tr2i18n( "Name" ) );
    profilesList->addColumn( tr2i18n( "Description" ) );
    profilesList->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, profilesList->sizePolicy().hasHeightForWidth() ) );
    profilesList->setAllColumnsShowFocus( true );
    profilesList->setResizeMode( TDEListView::NoColumn );

    layout11->addMultiCellWidget( profilesList, 0, 2, 0, 0 );

    removeProfileButton = new KPushButton( WStackPage, "removeProfileButton" );
    removeProfileButton->setEnabled( false );

    layout11->addWidget( removeProfileButton, 1, 1 );
    WStackPageLayout->addLayout( layout11 );
    widgetStack1->addWidget( WStackPage, 0 );

    tabWidget2 = new TQTabWidget( splitter2, "tabWidget2" );

    tab = new TQWidget( tabWidget2, "tab" );
    tabLayout = new TQGridLayout( tab, 1, 1, 11, 6, "tabLayout"); 

    addPropertyButton = new KPushButton( tab, "addPropertyButton" );

    tabLayout->addWidget( addPropertyButton, 1, 2 );

    propertyCombo = new KComboBox( false, tab, "propertyCombo" );
    propertyCombo->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, propertyCombo->sizePolicy().hasHeightForWidth() ) );
    propertyCombo->setEditable( true );
    propertyCombo->setAutoCompletion( true );

    tabLayout->addWidget( propertyCombo, 1, 1 );

    removePropertyButton = new KPushButton( tab, "removePropertyButton" );
    removePropertyButton->setEnabled( false );

    tabLayout->addWidget( removePropertyButton, 1, 3 );

    layout7 = new TQVBoxLayout( 0, 0, 0, "layout7"); 

    textLabel1 = new TQLabel( tab, "textLabel1" );
    layout7->addWidget( textLabel1 );

    derivedPropertiesBox = new TDEListBox( tab, "derivedPropertiesBox" );
    layout7->addWidget( derivedPropertiesBox );

    tabLayout->addMultiCellLayout( layout7, 0, 1, 0, 0 );

    layout8 = new TQVBoxLayout( 0, 0, 0, "layout8"); 

    textLabel1_2 = new TQLabel( tab, "textLabel1_2" );
    layout8->addWidget( textLabel1_2 );

    ownPropertiesBox = new TDEListBox( tab, "ownPropertiesBox" );
    layout8->addWidget( ownPropertiesBox );

    tabLayout->addMultiCellLayout( layout8, 0, 0, 1, 3 );
    tabWidget2->insertTab( tab, TQString::fromLatin1("") );

    tab_2 = new TQWidget( tabWidget2, "tab_2" );
    tabLayout_2 = new TQGridLayout( tab_2, 1, 1, 11, 6, "tabLayout_2"); 

    layout5 = new TQVBoxLayout( 0, 0, 0, "layout5"); 

    textLabel2 = new TQLabel( tab_2, "textLabel2" );
    layout5->addWidget( textLabel2 );

    enabledList = new TDEListView( tab_2, "enabledList" );
    enabledList->addColumn( tr2i18n( "Plugin Name" ) );
    layout5->addWidget( enabledList );

    tabLayout_2->addMultiCellLayout( layout5, 0, 3, 2, 2 );

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

    textLabel2_2 = new TQLabel( tab_2, "textLabel2_2" );
    layout6->addWidget( textLabel2_2 );

    disabledList = new TDEListView( tab_2, "disabledList" );
    disabledList->addColumn( tr2i18n( "Plugin Name" ) );
    layout6->addWidget( disabledList );

    tabLayout_2->addMultiCellLayout( layout6, 4, 7, 2, 2 );

    delEnabledButton = new KPushButton( tab_2, "delEnabledButton" );

    tabLayout_2->addWidget( delEnabledButton, 2, 1 );
    spacer2_2 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_2->addItem( spacer2_2, 3, 1 );
    spacer2_3 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_2->addItem( spacer2_3, 4, 1 );

    delDisabledButton = new KPushButton( tab_2, "delDisabledButton" );

    tabLayout_2->addWidget( delDisabledButton, 6, 1 );
    spacer2_4 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_2->addItem( spacer2_4, 7, 1 );

    layout10 = new TQVBoxLayout( 0, 0, 0, "layout10"); 

    textLabel2_3 = new TQLabel( tab_2, "textLabel2_3" );
    layout10->addWidget( textLabel2_3 );

    allList = new TDEListView( tab_2, "allList" );
    allList->addColumn( tr2i18n( "Name" ) );
    allList->addColumn( tr2i18n( "Generic Name" ) );
    layout10->addWidget( allList );

    allEdit = new KLineEdit( tab_2, "allEdit" );
    layout10->addWidget( allEdit );

    tabLayout_2->addMultiCellLayout( layout10, 0, 7, 0, 0 );
    spacer2 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_2->addItem( spacer2, 0, 1 );

    addEnabledButton = new KPushButton( tab_2, "addEnabledButton" );

    tabLayout_2->addWidget( addEnabledButton, 1, 1 );

    addDisabledButton = new KPushButton( tab_2, "addDisabledButton" );

    tabLayout_2->addWidget( addDisabledButton, 5, 1 );
    tabWidget2->insertTab( tab_2, TQString::fromLatin1("") );

    TabPage = new TQWidget( tabWidget2, "TabPage" );
    TabPageLayout = new TQGridLayout( TabPage, 1, 1, 11, 6, "TabPageLayout"); 

    pluginsView = new TDEListView( TabPage, "pluginsView" );
    pluginsView->addColumn( tr2i18n( "Name" ) );
    pluginsView->addColumn( tr2i18n( "Generic Name" ) );
    pluginsView->addColumn( tr2i18n( "Properties" ) );
    pluginsView->setAllColumnsShowFocus( true );

    TabPageLayout->addWidget( pluginsView, 0, 0 );
    tabWidget2->insertTab( TabPage, TQString::fromLatin1("") );

    ProfileEditorBaseLayout->addWidget( splitter2, 0, 0 );
    languageChange();
    resize( TQSize(637, 476).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( profilesList, TQ_SIGNAL( currentChanged(TQListViewItem*) ), this, TQ_SLOT( profileExecuted(TQListViewItem*) ) );
    connect( ownPropertiesBox, TQ_SIGNAL( currentChanged(TQListBoxItem*) ), this, TQ_SLOT( propertyExecuted(TQListBoxItem*) ) );
    connect( addProfileButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addProfile() ) );
    connect( removeProfileButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( removeProfile() ) );
    connect( addPropertyButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addProperty() ) );
    connect( removePropertyButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( removeProperty() ) );
    connect( profilesList, TQ_SIGNAL( executed(TQListViewItem*) ), this, TQ_SLOT( profileExecuted(TQListViewItem*) ) );
    connect( profilesList, TQ_SIGNAL( selectionChanged(TQListViewItem*) ), this, TQ_SLOT( profileExecuted(TQListViewItem*) ) );
    connect( addEnabledButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addEnabled() ) );
    connect( delEnabledButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( delEnabled() ) );
    connect( addDisabledButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addDisabled() ) );
    connect( delDisabledButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( delDisabled() ) );

    // tab order
    setTabOrder( profilesList, addProfileButton );
    setTabOrder( addProfileButton, removeProfileButton );
    setTabOrder( removeProfileButton, tabWidget2 );
    setTabOrder( tabWidget2, derivedPropertiesBox );
    setTabOrder( derivedPropertiesBox, ownPropertiesBox );
    setTabOrder( ownPropertiesBox, propertyCombo );
    setTabOrder( propertyCombo, addPropertyButton );
    setTabOrder( addPropertyButton, removePropertyButton );
    setTabOrder( removePropertyButton, enabledList );
    setTabOrder( enabledList, disabledList );
    setTabOrder( disabledList, pluginsView );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ProfileEditorBase::languageChange()
{
    setCaption( tr2i18n( "Profile Editor for The TDevelop Platform" ) );
    addProfileButton->setText( tr2i18n( "Add Profile" ) );
    profilesList->header()->setLabel( 0, tr2i18n( "Name" ) );
    profilesList->header()->setLabel( 1, tr2i18n( "Description" ) );
    removeProfileButton->setText( tr2i18n( "Remove Profile" ) );
    addPropertyButton->setText( tr2i18n( "Add" ) );
    removePropertyButton->setText( tr2i18n( "Remove" ) );
    textLabel1->setText( tr2i18n( "Derived properties:" ) );
    textLabel1_2->setText( tr2i18n( "Own properties:" ) );
    tabWidget2->changeTab( tab, tr2i18n( "Properties" ) );
    textLabel2->setText( tr2i18n( "Enabled:" ) );
    enabledList->header()->setLabel( 0, tr2i18n( "Plugin Name" ) );
    textLabel2_2->setText( tr2i18n( "Disabled:" ) );
    disabledList->header()->setLabel( 0, tr2i18n( "Plugin Name" ) );
    delEnabledButton->setText( tr2i18n( "<-" ) );
    delDisabledButton->setText( tr2i18n( "<-" ) );
    textLabel2_3->setText( tr2i18n( "Available plugins:" ) );
    allList->header()->setLabel( 0, tr2i18n( "Name" ) );
    allList->header()->setLabel( 1, tr2i18n( "Generic Name" ) );
    addEnabledButton->setText( tr2i18n( "->" ) );
    addDisabledButton->setText( tr2i18n( "->" ) );
    tabWidget2->changeTab( tab_2, tr2i18n( "Lists of Explicitly Enabled && Disabled Plugins" ) );
    pluginsView->header()->setLabel( 0, tr2i18n( "Name" ) );
    pluginsView->header()->setLabel( 1, tr2i18n( "Generic Name" ) );
    pluginsView->header()->setLabel( 2, tr2i18n( "Properties" ) );
    tabWidget2->changeTab( TabPage, tr2i18n( "List of Plugins to Be Loaded" ) );
}

void ProfileEditorBase::profileExecuted(TQListViewItem*)
{
    tqWarning( "ProfileEditorBase::profileExecuted(TQListViewItem*): Not implemented yet" );
}

void ProfileEditorBase::propertyExecuted(TQListBoxItem*)
{
    tqWarning( "ProfileEditorBase::propertyExecuted(TQListBoxItem*): Not implemented yet" );
}

void ProfileEditorBase::addProfile()
{
    tqWarning( "ProfileEditorBase::addProfile(): Not implemented yet" );
}

void ProfileEditorBase::removeProfile()
{
    tqWarning( "ProfileEditorBase::removeProfile(): Not implemented yet" );
}

void ProfileEditorBase::addProperty()
{
    tqWarning( "ProfileEditorBase::addProperty(): Not implemented yet" );
}

void ProfileEditorBase::removeProperty()
{
    tqWarning( "ProfileEditorBase::removeProperty(): Not implemented yet" );
}

void ProfileEditorBase::addEnabled()
{
    tqWarning( "ProfileEditorBase::addEnabled(): Not implemented yet" );
}

void ProfileEditorBase::delEnabled()
{
    tqWarning( "ProfileEditorBase::delEnabled(): Not implemented yet" );
}

void ProfileEditorBase::addDisabled()
{
    tqWarning( "ProfileEditorBase::addDisabled(): Not implemented yet" );
}

void ProfileEditorBase::delDisabled()
{
    tqWarning( "ProfileEditorBase::delDisabled(): Not implemented yet" );
}

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

TQMetaObject *ProfileEditorBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ProfileEditorBase( "ProfileEditorBase", &ProfileEditorBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ProfileEditorBase::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[] = {
	{ "item", &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"profileExecuted", 1, param_slot_0 };
    static const TQUParameter param_slot_1[] = {
	{ "item", &static_QUType_ptr, "TQListBoxItem", TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"propertyExecuted", 1, param_slot_1 };
    static const TQUMethod slot_2 = {"addProfile", 0, 0 };
    static const TQUMethod slot_3 = {"removeProfile", 0, 0 };
    static const TQUMethod slot_4 = {"addProperty", 0, 0 };
    static const TQUMethod slot_5 = {"removeProperty", 0, 0 };
    static const TQUMethod slot_6 = {"addEnabled", 0, 0 };
    static const TQUMethod slot_7 = {"delEnabled", 0, 0 };
    static const TQUMethod slot_8 = {"addDisabled", 0, 0 };
    static const TQUMethod slot_9 = {"delDisabled", 0, 0 };
    static const TQUMethod slot_10 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "profileExecuted(TQListViewItem*)", &slot_0, TQMetaData::Public },
	{ "propertyExecuted(TQListBoxItem*)", &slot_1, TQMetaData::Public },
	{ "addProfile()", &slot_2, TQMetaData::Public },
	{ "removeProfile()", &slot_3, TQMetaData::Public },
	{ "addProperty()", &slot_4, TQMetaData::Public },
	{ "removeProperty()", &slot_5, TQMetaData::Public },
	{ "addEnabled()", &slot_6, TQMetaData::Public },
	{ "delEnabled()", &slot_7, TQMetaData::Public },
	{ "addDisabled()", &slot_8, TQMetaData::Public },
	{ "delDisabled()", &slot_9, TQMetaData::Public },
	{ "languageChange()", &slot_10, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ProfileEditorBase", parentObject,
	slot_tbl, 11,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ProfileEditorBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool ProfileEditorBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: profileExecuted((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 1: propertyExecuted((TQListBoxItem*)static_QUType_ptr.get(_o+1)); break;
    case 2: addProfile(); break;
    case 3: removeProfile(); break;
    case 4: addProperty(); break;
    case 5: removeProperty(); break;
    case 6: addEnabled(); break;
    case 7: delEnabled(); break;
    case 8: addDisabled(); break;
    case 9: delDisabled(); break;
    case 10: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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