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

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

#include "coverdialogbase.h"

#include <ntqvariant.h>
#include <covericonview.h>
#include <kiconviewsearchline.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqtoolbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>

#include "covericonview.h"

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

    m_artists = new TDEListView( this, "m_artists" );
    m_artists->addColumn( tr2i18n( "Artist" ) );
    m_artists->header()->setClickEnabled( false, m_artists->header()->count() - 1 );
    m_artists->header()->setResizeEnabled( false, m_artists->header()->count() - 1 );
    m_artists->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)7, 0, 0, m_artists->sizePolicy().hasHeightForWidth() ) );
    m_artists->setMinimumSize( TQSize( 164, 0 ) );
    m_artists->setResizeMode( TDEListView::LastColumn );
    m_artists->setShadeSortColumn( false );
    CoverDialogBaseLayout->addWidget( m_artists );

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

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

    m_clearSearch = new TQToolButton( this, "m_clearSearch" );
    layout3_2->addWidget( m_clearSearch );

    m_searchLine = new TDEIconViewSearchLine( this, "m_searchLine" );
    m_searchLine->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 1, 0, m_searchLine->sizePolicy().hasHeightForWidth() ) );
    layout3_2->addWidget( m_searchLine );
    layout3->addLayout( layout3_2 );

    m_covers = new CoverIconView( this, "m_covers" );
    m_covers->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 1, 0, m_covers->sizePolicy().hasHeightForWidth() ) );
    m_covers->setProperty( "gridX", 140 );
    m_covers->setProperty( "gridY", 150 );
    layout3->addWidget( m_covers );
    CoverDialogBaseLayout->addLayout( layout3 );
    languageChange();
    resize( TQSize(685, 554).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_artists, TQ_SIGNAL( clicked(TQListViewItem*) ), this, TQ_SLOT( slotArtistClicked(TQListViewItem*) ) );
    connect( m_clearSearch, TQ_SIGNAL( clicked() ), m_searchLine, TQ_SLOT( clear() ) );
    connect( m_covers, TQ_SIGNAL( contextMenuRequested(TQIconViewItem*,const TQPoint&) ), this, TQ_SLOT( slotContextRequested(TQIconViewItem*,const TQPoint&) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void CoverDialogBase::languageChange()
{
    setCaption( tr2i18n( "Cover Manager" ) );
    m_artists->header()->setLabel( 0, tr2i18n( "Artist" ) );
    m_artists->clear();
    TQListViewItem * item = new TQListViewItem( m_artists, 0 );
    item->setText( 0, tr2i18n( "<All>" ) );

    m_clearSearch->setText( tr2i18n( "Clear Search" ) );
    TQToolTip::add( m_clearSearch, tr2i18n( "Clear Search" ) );
    TQWhatsThis::add( m_clearSearch, tr2i18n( "Clear the current cover search." ) );
}

void CoverDialogBase::slotArtistClicked(TQListViewItem*)
{
    tqWarning( "CoverDialogBase::slotArtistClicked(TQListViewItem*): Not implemented yet" );
}

void CoverDialogBase::slotContextRequested(TQIconViewItem*,const TQPoint&)
{
    tqWarning( "CoverDialogBase::slotContextRequested(TQIconViewItem*,const TQPoint&): Not implemented yet" );
}

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

TQMetaObject *CoverDialogBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_CoverDialogBase( "CoverDialogBase", &CoverDialogBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* CoverDialogBase::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 = {"slotArtistClicked", 1, param_slot_0 };
    static const TQUParameter param_slot_1[] = {
	{ 0, &static_QUType_ptr, "TQIconViewItem", TQUParameter::In },
	{ "pt", &static_QUType_varptr, "\x0e", TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"slotContextRequested", 2, param_slot_1 };
    static const TQUMethod slot_2 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "slotArtistClicked(TQListViewItem*)", &slot_0, TQMetaData::Public },
	{ "slotContextRequested(TQIconViewItem*,const TQPoint&)", &slot_1, TQMetaData::Public },
	{ "languageChange()", &slot_2, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"CoverDialogBase", parentObject,
	slot_tbl, 3,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_CoverDialogBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool CoverDialogBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: slotArtistClicked((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 1: slotContextRequested((TQIconViewItem*)static_QUType_ptr.get(_o+1),(const TQPoint&)*((const TQPoint*)static_QUType_ptr.get(_o+2))); break;
    case 2: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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