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

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

#include "prefcharacterbase.h"

#include <ntqvariant.h>
#include <kpushbutton.h>
#include <ntqpushbutton.h>
#include <ntqframe.h>
#include <ntqlabel.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>


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

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

    PrefCharacterBaseLayout->addMultiCellWidget( line1, 2, 2, 0, 1 );

    lblShortCutInfo = new TQLabel( this, "lblShortCutInfo" );
    lblShortCutInfo->setFrameShape( TQLabel::NoFrame );
    lblShortCutInfo->setFrameShadow( TQLabel::Plain );
    lblShortCutInfo->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );

    PrefCharacterBaseLayout->addMultiCellWidget( lblShortCutInfo, 3, 3, 0, 1 );

    lstCharacters = new TQListView( this, "lstCharacters" );
    lstCharacters->addColumn( tr2i18n( "Action" ) );
    lstCharacters->addColumn( tr2i18n( "Shortcut" ) );
    lstCharacters->addColumn( tr2i18n( "Character" ) );
    lstCharacters->setResizePolicy( TQScrollView::Manual );
    lstCharacters->setSelectionMode( TQListView::Single );
    lstCharacters->setAllColumnsShowFocus( true );

    PrefCharacterBaseLayout->addMultiCellWidget( lstCharacters, 0, 0, 0, 1 );
    spacer2 = new TQSpacerItem( 220, 30, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    PrefCharacterBaseLayout->addItem( spacer2, 1, 0 );

    layout9 = new TQGridLayout( 0, 1, 1, 0, 6, "layout9"); 
    spacer5 = new TQSpacerItem( 30, 50, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    layout9->addMultiCell( spacer5, 0, 1, 1, 1 );

    btnCharacter = new KPushButton( this, "btnCharacter" );

    layout9->addWidget( btnCharacter, 1, 2 );
    spacer4 = new TQSpacerItem( 31, 31, TQSizePolicy::Minimum, TQSizePolicy::Fixed );
    layout9->addItem( spacer4, 0, 2 );

    lblPreview = new TQLabel( this, "lblPreview" );
    lblPreview->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, lblPreview->sizePolicy().hasHeightForWidth() ) );
    TQFont lblPreview_font(  lblPreview->font() );
    lblPreview_font.setPointSize( 36 );
    lblPreview->setFont( lblPreview_font ); 
    lblPreview->setAlignment( int( TQLabel::AlignBottom ) );

    layout9->addMultiCellWidget( lblPreview, 0, 1, 0, 0 );

    PrefCharacterBaseLayout->addLayout( layout9, 1, 1 );
    languageChange();
    resize( TQSize(300, 356).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( lstCharacters, btnCharacter );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void PrefCharacterBase::languageChange()
{
    lblShortCutInfo->setText( tr2i18n( "Note: Select Settings -> Configure Shortcuts... to change the shortcut associated with each action." ) );
    lstCharacters->header()->setLabel( 0, tr2i18n( "Action" ) );
    lstCharacters->header()->setLabel( 1, tr2i18n( "Shortcut" ) );
    lstCharacters->header()->setLabel( 2, tr2i18n( "Character" ) );
    lstCharacters->clear();
    TQListViewItem * item = new TQListViewItem( lstCharacters, 0 );
    item->setText( 0, tr2i18n( "Special Character 1" ) );
    item->setText( 1, tr2i18n( "Ctrl+1" ) );
    item->setText( 2, tr2i18n( "A" ) );

    item = new TQListViewItem( lstCharacters, item );
    item->setText( 0, tr2i18n( "Special Character 2" ) );
    item->setText( 1, tr2i18n( "Ctrl+2" ) );
    item->setText( 2, tr2i18n( "B" ) );

    item = new TQListViewItem( lstCharacters, item );
    item->setText( 0, tr2i18n( "Special Character 3" ) );
    item->setText( 1, tr2i18n( "Ctrl+3" ) );
    item->setText( 2, tr2i18n( "C" ) );

    item = new TQListViewItem( lstCharacters, item );
    item->setText( 0, tr2i18n( "Special Character 4" ) );
    item->setText( 1, tr2i18n( "Ctrl+4" ) );
    item->setText( 2, tr2i18n( "D" ) );

    item = new TQListViewItem( lstCharacters, item );
    item->setText( 0, tr2i18n( "Special Character 5" ) );
    item->setText( 1, tr2i18n( "Ctrl+5" ) );
    item->setText( 2, tr2i18n( "E" ) );

    item = new TQListViewItem( lstCharacters, item );
    item->setText( 0, tr2i18n( "Special Character 6" ) );
    item->setText( 1, tr2i18n( "Ctrl+6" ) );
    item->setText( 2, tr2i18n( "F" ) );

    item = new TQListViewItem( lstCharacters, item );
    item->setText( 0, tr2i18n( "Special Character 7" ) );
    item->setText( 1, tr2i18n( "Ctrl+7" ) );
    item->setText( 2, tr2i18n( "G" ) );

    item = new TQListViewItem( lstCharacters, item );
    item->setText( 0, tr2i18n( "Special Character 8" ) );
    item->setText( 1, tr2i18n( "Ctrl+8" ) );
    item->setText( 2, tr2i18n( "H" ) );

    item = new TQListViewItem( lstCharacters, item );
    item->setText( 0, tr2i18n( "Special Character 9" ) );
    item->setText( 1, tr2i18n( "Ctrl+9" ) );
    item->setText( 2, tr2i18n( "I" ) );

    TQToolTip::add( lstCharacters, tr2i18n( "Select character to modify" ) );
    TQWhatsThis::add( lstCharacters, tr2i18n( "Customizable special character actions" ) );
    btnCharacter->setText( tr2i18n( "C&haracter..." ) );
    TQToolTip::add( btnCharacter, tr2i18n( "Click to choose a new character" ) );
    TQWhatsThis::add( btnCharacter, tr2i18n( "Choose a character for the selected action" ) );
    lblPreview->setText( tr2i18n( "A" ) );
    TQToolTip::add( lblPreview, tr2i18n( "Preview of current character" ) );
    TQWhatsThis::add( lblPreview, tr2i18n( "Preview of the character associated with the selected action" ) );
}

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

TQMetaObject *PrefCharacterBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_PrefCharacterBase( "PrefCharacterBase", &PrefCharacterBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* PrefCharacterBase::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 TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"PrefCharacterBase", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_PrefCharacterBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool PrefCharacterBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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