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

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

#include "iconvieweditor.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqiconview.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>

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


/*
 *  Constructs a IconViewEditorBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
IconViewEditorBase::IconViewEditorBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl ),
      image0( (const char **) image0_data )
{
    if ( !name )
	setName( "IconViewEditorBase" );
    setSizeGripEnabled( true );
    IconViewEditorBaseLayout = new TQVBoxLayout( this, 11, 6, "IconViewEditorBaseLayout"); 

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

    preview = new TQIconView( this, "preview" );
    Layout6->addWidget( preview );

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

    itemNew = new TQPushButton( this, "itemNew" );
    Layout5->addWidget( itemNew );

    itemDelete = new TQPushButton( this, "itemDelete" );
    Layout5->addWidget( itemDelete );
    Vertical_Spacing1 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    Layout5->addItem( Vertical_Spacing1 );
    Layout6->addLayout( Layout5 );

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

    Label1 = new TQLabel( GroupBox1, "Label1" );

    GroupBox1Layout->addWidget( Label1, 0, 0 );

    itemText = new TQLineEdit( GroupBox1, "itemText" );
    itemText->setMinimumSize( TQSize( 0, 0 ) );

    GroupBox1Layout->addWidget( itemText, 0, 1 );

    Label2 = new TQLabel( GroupBox1, "Label2" );

    GroupBox1Layout->addWidget( Label2, 1, 0 );

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

    itemPixmap = new TQLabel( GroupBox1, "itemPixmap" );
    Layout4->addWidget( itemPixmap );

    itemDeletePixmap = new TQPushButton( GroupBox1, "itemDeletePixmap" );
    itemDeletePixmap->setMaximumSize( TQSize( 30, 22 ) );
    itemDeletePixmap->setPixmap( image0 );
    Layout4->addWidget( itemDeletePixmap );

    itemChoosePixmap = new TQPushButton( GroupBox1, "itemChoosePixmap" );
    itemChoosePixmap->setMaximumSize( TQSize( 30, 22 ) );
    Layout4->addWidget( itemChoosePixmap );

    GroupBox1Layout->addLayout( Layout4, 1, 1 );
    Layout6->addWidget( GroupBox1 );
    IconViewEditorBaseLayout->addLayout( Layout6 );

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

    buttonHelp = new TQPushButton( this, "buttonHelp" );
    buttonHelp->setAutoDefault( true );
    Layout1->addWidget( buttonHelp );
    Horizontal_Spacing2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout1->addItem( Horizontal_Spacing2 );

    buttonOk = new TQPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( true );
    buttonOk->setDefault( true );
    Layout1->addWidget( buttonOk );

    buttonApply = new TQPushButton( this, "buttonApply" );
    buttonApply->setAutoDefault( true );
    Layout1->addWidget( buttonApply );

    buttonCancel = new TQPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( true );
    Layout1->addWidget( buttonCancel );
    IconViewEditorBaseLayout->addLayout( Layout1 );
    languageChange();
    resize( TQSize(567, 321).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( itemNew, TQ_SIGNAL( clicked() ), this, TQ_SLOT( insertNewItem() ) );
    connect( itemDelete, TQ_SIGNAL( clicked() ), this, TQ_SLOT( deleteCurrentItem() ) );
    connect( itemText, TQ_SIGNAL( textChanged( const TQString & ) ), this, TQ_SLOT( currentTextChanged(const TQString&) ) );
    connect( buttonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( okClicked() ) );
    connect( buttonApply, TQ_SIGNAL( clicked() ), this, TQ_SLOT( applyClicked() ) );
    connect( buttonCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( cancelClicked() ) );
    connect( itemChoosePixmap, TQ_SIGNAL( clicked() ), this, TQ_SLOT( choosePixmap() ) );
    connect( preview, TQ_SIGNAL( selectionChanged(TQIconViewItem*) ), this, TQ_SLOT( currentItemChanged(TQIconViewItem*) ) );
    connect( preview, TQ_SIGNAL( currentChanged(TQIconViewItem*) ), this, TQ_SLOT( currentItemChanged(TQIconViewItem*) ) );
    connect( itemDeletePixmap, TQ_SIGNAL( clicked() ), this, TQ_SLOT( deletePixmap() ) );

    // tab order
    setTabOrder( buttonOk, buttonCancel );
    setTabOrder( buttonCancel, preview );
    setTabOrder( preview, itemNew );
    setTabOrder( itemNew, itemDelete );
    setTabOrder( itemDelete, itemText );
    setTabOrder( itemText, itemDeletePixmap );
    setTabOrder( itemDeletePixmap, itemChoosePixmap );
    setTabOrder( itemChoosePixmap, buttonHelp );
    setTabOrder( buttonHelp, buttonApply );

    // buddies
    Label1->setBuddy( itemText );
    Label2->setBuddy( itemChoosePixmap );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void IconViewEditorBase::languageChange()
{
    setCaption( tr2i18n( "Edit Iconview" ) );
    TQWhatsThis::add( this, tr2i18n( "<b>Edit Iconview</b><p>Add, edit or delete items in the icon view.</p><p>Click the <b>New Item</b>-button to create a new item, then enter text and choose a pixmap.</p><p>Select an item from the view and click the <b>Delete Item</b>-button to remove the item from the iconview.</p>" ) );
    TQWhatsThis::add( preview, tr2i18n( "All items in the iconview." ) );
    itemNew->setText( tr2i18n( "&New Item" ) );
    TQToolTip::add( itemNew, tr2i18n( "Add an item" ) );
    TQWhatsThis::add( itemNew, tr2i18n( "Create a new item for the iconview." ) );
    itemDelete->setText( tr2i18n( "&Delete Item" ) );
    TQToolTip::add( itemDelete, tr2i18n( "Delete item" ) );
    TQWhatsThis::add( itemDelete, tr2i18n( "Delete the selected item." ) );
    GroupBox1->setTitle( tr2i18n( "&Item Properties" ) );
    Label1->setText( tr2i18n( "&Text:" ) );
    TQToolTip::add( itemText, tr2i18n( "Change text" ) );
    TQWhatsThis::add( itemText, tr2i18n( "Change the text for the selected item." ) );
    Label2->setText( tr2i18n( "&Pixmap:" ) );
    itemPixmap->setText( tr2i18n( "Label4" ) );
    itemDeletePixmap->setText( TQString::null );
    TQToolTip::add( itemDeletePixmap, tr2i18n( "Delete Pixmap" ) );
    TQWhatsThis::add( itemDeletePixmap, tr2i18n( "Delete the selected item's pixmap." ) );
    itemChoosePixmap->setText( tr2i18n( "..." ) );
    TQToolTip::add( itemChoosePixmap, tr2i18n( "Select a Pixmap" ) );
    TQWhatsThis::add( itemChoosePixmap, tr2i18n( "Select a pixmap file for the current item." ) );
    buttonHelp->setText( tr2i18n( "&Help" ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    TQWhatsThis::add( buttonOk, tr2i18n( "Close the dialog and apply all the changes." ) );
    buttonApply->setText( tr2i18n( "&Apply" ) );
    TQWhatsThis::add( buttonApply, tr2i18n( "Apply all changes." ) );
    buttonCancel->setText( tr2i18n( "&Cancel" ) );
    TQWhatsThis::add( buttonCancel, tr2i18n( "Close the dialog and discard any changes." ) );
}

void IconViewEditorBase::init()
{
}

void IconViewEditorBase::destroy()
{
}

void IconViewEditorBase::applyClicked()
{
    tqWarning( "IconViewEditorBase::applyClicked(): Not implemented yet" );
}

void IconViewEditorBase::cancelClicked()
{
    tqWarning( "IconViewEditorBase::cancelClicked(): Not implemented yet" );
}

void IconViewEditorBase::choosePixmap()
{
    tqWarning( "IconViewEditorBase::choosePixmap(): Not implemented yet" );
}

void IconViewEditorBase::currentItemChanged(TQIconViewItem*)
{
    tqWarning( "IconViewEditorBase::currentItemChanged(TQIconViewItem*): Not implemented yet" );
}

void IconViewEditorBase::currentTextChanged(const TQString&)
{
    tqWarning( "IconViewEditorBase::currentTextChanged(const TQString&): Not implemented yet" );
}

void IconViewEditorBase::deleteCurrentItem()
{
    tqWarning( "IconViewEditorBase::deleteCurrentItem(): Not implemented yet" );
}

void IconViewEditorBase::insertNewItem()
{
    tqWarning( "IconViewEditorBase::insertNewItem(): Not implemented yet" );
}

void IconViewEditorBase::deletePixmap()
{
    tqWarning( "IconViewEditorBase::deletePixmap(): Not implemented yet" );
}

void IconViewEditorBase::okClicked()
{
    tqWarning( "IconViewEditorBase::okClicked(): Not implemented yet" );
}

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

TQMetaObject *IconViewEditorBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_IconViewEditorBase( "IconViewEditorBase", &IconViewEditorBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* IconViewEditorBase::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 = TQDialog::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 = {"applyClicked", 0, 0 };
    static const TQUMethod slot_4 = {"cancelClicked", 0, 0 };
    static const TQUMethod slot_5 = {"choosePixmap", 0, 0 };
    static const TQUParameter param_slot_6[] = {
	{ 0, &static_QUType_ptr, "TQIconViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_6 = {"currentItemChanged", 1, param_slot_6 };
    static const TQUParameter param_slot_7[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_7 = {"currentTextChanged", 1, param_slot_7 };
    static const TQUMethod slot_8 = {"deleteCurrentItem", 0, 0 };
    static const TQUMethod slot_9 = {"insertNewItem", 0, 0 };
    static const TQUMethod slot_10 = {"deletePixmap", 0, 0 };
    static const TQUMethod slot_11 = {"okClicked", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "init()", &slot_1, TQMetaData::Protected },
	{ "destroy()", &slot_2, TQMetaData::Protected },
	{ "applyClicked()", &slot_3, TQMetaData::Protected },
	{ "cancelClicked()", &slot_4, TQMetaData::Protected },
	{ "choosePixmap()", &slot_5, TQMetaData::Protected },
	{ "currentItemChanged(TQIconViewItem*)", &slot_6, TQMetaData::Protected },
	{ "currentTextChanged(const TQString&)", &slot_7, TQMetaData::Protected },
	{ "deleteCurrentItem()", &slot_8, TQMetaData::Protected },
	{ "insertNewItem()", &slot_9, TQMetaData::Protected },
	{ "deletePixmap()", &slot_10, TQMetaData::Protected },
	{ "okClicked()", &slot_11, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"IconViewEditorBase", parentObject,
	slot_tbl, 12,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_IconViewEditorBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool IconViewEditorBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: init(); break;
    case 2: destroy(); break;
    case 3: applyClicked(); break;
    case 4: cancelClicked(); break;
    case 5: choosePixmap(); break;
    case 6: currentItemChanged((TQIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 7: currentTextChanged((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 8: deleteCurrentItem(); break;
    case 9: insertNewItem(); break;
    case 10: deletePixmap(); break;
    case 11: okClicked(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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