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

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

#include "filerenamerbase.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <kurlrequester.h>
#include <tqscrollview.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqcombobox.h>
#include <ntqframe.h>
#include <ntqscrollview.h>
#include <ntqgroupbox.h>
#include <ntqlineedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a FileRenamerBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
FileRenamerBase::FileRenamerBase( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "FileRenamerBase" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
    FileRenamerBaseLayout = new TQVBoxLayout( this, 11, 6, "FileRenamerBaseLayout"); 

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

    m_separator = new KComboBox( false, this, "m_separator" );
    m_separator->setEditable( true );

    layout4->addWidget( m_separator, 1, 1 );

    textLabel1_6 = new TQLabel( this, "textLabel1_6" );

    layout4->addWidget( textLabel1_6, 0, 0 );

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

    m_category = new TQComboBox( false, this, "m_category" );
    layout3->addWidget( m_category );

    m_insertCategory = new KPushButton( this, "m_insertCategory" );
    layout3->addWidget( m_insertCategory );

    layout4->addLayout( layout3, 2, 1 );

    m_musicFolder = new KURLRequester( this, "m_musicFolder" );
    m_musicFolder->setShowLocalProtocol( true );
    m_musicFolder->setMode( 26 );

    layout4->addWidget( m_musicFolder, 0, 1 );

    textLabel1 = new TQLabel( this, "textLabel1" );

    layout4->addWidget( textLabel1, 2, 0 );

    textLabel1_7 = new TQLabel( this, "textLabel1_7" );

    layout4->addWidget( textLabel1_7, 1, 0 );
    FileRenamerBaseLayout->addLayout( layout4 );

    line1_2 = new TQFrame( this, "line1_2" );
    line1_2->setFrameShape( TQFrame::HLine );
    line1_2->setFrameShadow( TQFrame::Sunken );
    line1_2->setFrameShape( TQFrame::HLine );
    FileRenamerBaseLayout->addWidget( line1_2 );

    m_mainView = new TQScrollView( this, "m_mainView" );
    m_mainView->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 1, m_mainView->sizePolicy().hasHeightForWidth() ) );
    FileRenamerBaseLayout->addWidget( m_mainView );

    line1 = new TQFrame( this, "line1" );
    line1->setFrameShape( TQFrame::HLine );
    line1->setFrameShadow( TQFrame::Sunken );
    line1->setFrameShape( TQFrame::HLine );
    FileRenamerBaseLayout->addWidget( line1 );

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

    layout2 = new TQHBoxLayout( 0, 0, 6, "layout2"); 
    spacer2 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout2->addItem( spacer2 );

    m_showExample = new KPushButton( groupBox1, "m_showExample" );
    layout2->addWidget( m_showExample );
    spacer2_2 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout2->addItem( spacer2_2 );
    groupBox1Layout->addLayout( layout2 );

    m_exampleText = new TQLineEdit( groupBox1, "m_exampleText" );
    m_exampleText->setFocusPolicy( TQLineEdit::NoFocus );
    m_exampleText->setAcceptDrops( false );
    m_exampleText->setLineWidth( 2 );
    m_exampleText->setReadOnly( true );
    groupBox1Layout->addWidget( m_exampleText );
    FileRenamerBaseLayout->addWidget( groupBox1 );
    spacer7 = new TQSpacerItem( 20, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    FileRenamerBaseLayout->addItem( spacer7 );
    languageChange();
    resize( TQSize(489, 579).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_separator, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( exampleTextChanged() ) );
    connect( m_musicFolder, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( exampleTextChanged() ) );
    connect( m_showExample, TQ_SIGNAL( clicked() ), this, TQ_SLOT( toggleExampleDialog() ) );
    connect( m_insertCategory, TQ_SIGNAL( clicked() ), this, TQ_SLOT( insertCategory() ) );

    // tab order
    setTabOrder( m_musicFolder, m_separator );
    setTabOrder( m_separator, m_category );
    setTabOrder( m_category, m_insertCategory );
    setTabOrder( m_insertCategory, m_showExample );

    // buddies
    textLabel1->setBuddy( m_category );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void FileRenamerBase::languageChange()
{
    setCaption( tr2i18n( "File Renamer Configuration" ) );
    m_separator->clear();
    m_separator->insertItem( tr2i18n( " - " ) );
    m_separator->insertItem( tr2i18n( "_" ) );
    m_separator->insertItem( tr2i18n( "-" ) );
    textLabel1_6->setText( tr2i18n( "Music folder:" ) );
    m_category->clear();
    m_category->insertItem( tr2i18n( "Album Tag" ) );
    m_category->insertItem( tr2i18n( "Artist Tag" ) );
    m_category->insertItem( tr2i18n( "Genre Tag" ) );
    m_category->insertItem( tr2i18n( "Title Tag" ) );
    m_category->insertItem( tr2i18n( "Track Tag" ) );
    m_category->insertItem( tr2i18n( "Year Tag" ) );
    m_insertCategory->setText( tr2i18n( "Insert Category" ) );
    m_musicFolder->setProperty( "url", tr2i18n( "~/music" ) );
    textLabel1->setText( tr2i18n( "Add category:" ) );
    textLabel1_7->setText( tr2i18n( "Separator:" ) );
    groupBox1->setTitle( tr2i18n( "Example" ) );
    m_showExample->setText( tr2i18n( "Show Renamer Test Dialog" ) );
}

void FileRenamerBase::exampleTextChanged()
{
    tqWarning( "FileRenamerBase::exampleTextChanged(): Not implemented yet" );
}

void FileRenamerBase::toggleExampleDialog()
{
    tqWarning( "FileRenamerBase::toggleExampleDialog(): Not implemented yet" );
}

void FileRenamerBase::insertCategory()
{
    tqWarning( "FileRenamerBase::insertCategory(): Not implemented yet" );
}

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

TQMetaObject *FileRenamerBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_FileRenamerBase( "FileRenamerBase", &FileRenamerBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* FileRenamerBase::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 = {"exampleTextChanged", 0, 0 };
    static const TQUMethod slot_2 = {"toggleExampleDialog", 0, 0 };
    static const TQUMethod slot_3 = {"insertCategory", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "exampleTextChanged()", &slot_1, TQMetaData::Protected },
	{ "toggleExampleDialog()", &slot_2, TQMetaData::Protected },
	{ "insertCategory()", &slot_3, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"FileRenamerBase", parentObject,
	slot_tbl, 4,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_FileRenamerBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool FileRenamerBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: exampleTextChanged(); break;
    case 2: toggleExampleDialog(); break;
    case 3: insertCategory(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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