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

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

#include "actioneditor.h"

#include <ntqvariant.h>
#include <ntqtoolbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>

#include "actionlistview.h"
static const char* const image0_data[] = { 
"22 22 7 1",
". c None",
"# c #000000",
"b c #292c29",
"c c #5a5d5a",
"d c #838583",
"e c #c5c2c5",
"a c #ffffff",
"......................",
"....##########........",
"....#aaaaaaa#b#.......",
"....#aaaaaaa#cb#......",
"....#aaaaaaa#dcb#.....",
"....#aaaaaaa#edcb#....",
"....#aaaaaaa#aedcb#...",
"....#aaaaaaa#######...",
"....#aaaaaaaaaaaaa#...",
"....#aaaaaaaaaaaaa#...",
"....#aaaaaaaaaaaaa#...",
"....#aaaaaaaaaaaaa#...",
"....#aaaaaaaaaaaaa#...",
"....#aaaaaaaaaaaaa#...",
"....#aaaaaaaaaaaaa#...",
"....#aaaaaaaaaaaaa#...",
"....#aaaaaaaaaaaaa#...",
"....#aaaaaaaaaaaaa#...",
"....#aaaaaaaaaaaaa#...",
"....###############...",
"......................",
"......................"};

static const char* const image1_data[] = { 
"22 22 3 1",
". c None",
"# c #000000",
"a c #000083",
"......................",
".......#.....#........",
".......#.....#........",
".......#.....#........",
".......#....##........",
".......##...#.........",
"........#...#.........",
"........##.##.........",
".........###..........",
".........###..........",
"..........#...........",
".........a#a..........",
"........aa.aaa........",
".......a.a.a..a.......",
"......a..a.a...a......",
".....a...a.a....a.....",
"....a....a.a....a.....",
"....a....a..a...a.....",
"....a....a..a..a......",
"....a...a....aa.......",
".....aaa..............",
"......................"};

static const char* const image2_data[] = { 
"22 22 35 1",
". c None",
"E c #0014b4",
"p c #0014ee",
"i c #001cd5",
"l c #001cde",
"r c #001ce6",
"q c #001cee",
"C c #0020d5",
"x c #0020de",
"v c #0024e6",
"s c #0024ee",
"t c #08188b",
"F c #102cbd",
"h c #1034ff",
"A c #103cff",
"G c #182cb4",
"b c #203ccd",
"k c #203cff",
"m c #39488b",
"f c #3961ff",
"g c #5a79ff",
"u c #a40808",
"B c #a40c00",
"j c #ac0808",
"z c #ac0c00",
"e c #cd1010",
"w c #d51410",
"D c #de1410",
"a c #de1818",
"y c #e61410",
"o c #e61818",
"n c #ee0c08",
"d c #ff4041",
"# c #ff797b",
"c c #ffa5a4",
"......................",
"......................",
"......................",
"......................",
"......................",
".#aaaaaaa.bbbbbbbbbb..",
"a#ccccccde.bfgggggghi.",
"aacccccddaj.bkggggghlm",
"aannnnaaaaoj.bpqrqsslt",
"aaaaaaaaoaoau.brvvvvit",
"aaaaaaaaaaaawu.bvvvvxt",
"aaaaaaaaaaaawu.bvvvvxt",
"aaaaaaaayaawz.bssvvvit",
"aaaaaaaaaawu.bAAsvvvxt",
"aaaaaaaaawB.bAAsvvvvCt",
"aDwwwwwwwu.bbAvvvvvvE.",
".wwwwwwww.bbbFFGFGGG..",
"......................",
"......................",
"......................",
"......................",
"......................"};


/*
 *  Constructs a ActionEditorBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
ActionEditorBase::ActionEditorBase( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl ),
      image0( (const char **) image0_data ),
      image1( (const char **) image1_data ),
      image2( (const char **) image2_data )
{
    if ( !name )
	setName( "ActionEditorBase" );
    ActionEditorBaseLayout = new TQVBoxLayout( this, 4, 6, "ActionEditorBaseLayout"); 

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

    buttonNewAction = new TQToolButton( this, "buttonNewAction" );
    buttonNewAction->setPixmap( image0 );
    buttonNewAction->setAutoRaise( true );
    Layout2->addWidget( buttonNewAction );

    buttonDeleteAction = new TQToolButton( this, "buttonDeleteAction" );
    buttonDeleteAction->setPixmap( image1 );
    buttonDeleteAction->setAutoRaise( true );
    Layout2->addWidget( buttonDeleteAction );

    buttonConnect = new TQToolButton( this, "buttonConnect" );
    buttonConnect->setPixmap( image2 );
    buttonConnect->setAutoRaise( true );
    Layout2->addWidget( buttonConnect );
    Spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout2->addItem( Spacer1 );
    ActionEditorBaseLayout->addLayout( Layout2 );

    listActions = new ActionListView( this, "listActions" );
    ActionEditorBaseLayout->addWidget( listActions );
    languageChange();
    resize( TQSize(206, 227).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( listActions, TQ_SIGNAL( currentChanged( TQListViewItem * ) ), this, TQ_SLOT( currentActionChanged(TQListViewItem*) ) );
    connect( listActions, TQ_SIGNAL( clicked( TQListViewItem * ) ), this, TQ_SLOT( currentActionChanged(TQListViewItem*) ) );
    connect( listActions, TQ_SIGNAL( selectionChanged( TQListViewItem * ) ), this, TQ_SLOT( currentActionChanged(TQListViewItem*) ) );
    connect( buttonNewAction, TQ_SIGNAL( clicked() ), this, TQ_SLOT( newAction() ) );
    connect( buttonConnect, TQ_SIGNAL( clicked() ), this, TQ_SLOT( connectionsClicked() ) );
    connect( buttonDeleteAction, TQ_SIGNAL( clicked() ), this, TQ_SLOT( deleteAction() ) );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ActionEditorBase::languageChange()
{
    setCaption( tr2i18n( "Edit Actions" ) );
    buttonNewAction->setText( TQString::null );
    TQToolTip::add( buttonNewAction, tr2i18n( "Create new Action" ) );
    buttonDeleteAction->setText( TQString::null );
    TQToolTip::add( buttonDeleteAction, tr2i18n( "Delete current Action" ) );
    buttonConnect->setText( TQString::null );
    TQToolTip::add( buttonConnect, tr2i18n( "Connect current Action" ) );
}

void ActionEditorBase::init()
{
}

void ActionEditorBase::destroy()
{
}

void ActionEditorBase::connectionsClicked()
{
    tqWarning( "ActionEditorBase::connectionsClicked(): Not implemented yet" );
}

void ActionEditorBase::currentActionChanged(TQListViewItem*)
{
    tqWarning( "ActionEditorBase::currentActionChanged(TQListViewItem*): Not implemented yet" );
}

void ActionEditorBase::deleteAction()
{
    tqWarning( "ActionEditorBase::deleteAction(): Not implemented yet" );
}

void ActionEditorBase::newAction()
{
    tqWarning( "ActionEditorBase::newAction(): Not implemented yet" );
}

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

TQMetaObject *ActionEditorBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ActionEditorBase( "ActionEditorBase", &ActionEditorBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ActionEditorBase::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 TQUMethod slot_1 = {"init", 0, 0 };
    static const TQUMethod slot_2 = {"destroy", 0, 0 };
    static const TQUMethod slot_3 = {"connectionsClicked", 0, 0 };
    static const TQUParameter param_slot_4[] = {
	{ 0, &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_4 = {"currentActionChanged", 1, param_slot_4 };
    static const TQUMethod slot_5 = {"deleteAction", 0, 0 };
    static const TQUMethod slot_6 = {"newAction", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "init()", &slot_1, TQMetaData::Protected },
	{ "destroy()", &slot_2, TQMetaData::Protected },
	{ "connectionsClicked()", &slot_3, TQMetaData::Protected },
	{ "currentActionChanged(TQListViewItem*)", &slot_4, TQMetaData::Protected },
	{ "deleteAction()", &slot_5, TQMetaData::Protected },
	{ "newAction()", &slot_6, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ActionEditorBase", parentObject,
	slot_tbl, 7,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ActionEditorBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool ActionEditorBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: init(); break;
    case 2: destroy(); break;
    case 3: connectionsClicked(); break;
    case 4: currentActionChanged((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 5: deleteAction(); break;
    case 6: newAction(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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