#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/usr/src/ports/kdelibs3/kdelibs3-3.5.10-11.i686/src/kdelibs-3.5.10/kdeui/kspellui.ui'
**
** Created by User Interface Compiler
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "kspellui.h"

#include <qvariant.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qheader.h>
#include <qlistview.h>
#include <qlineedit.h>
#include <qcombobox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a KSpellUI as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
KSpellUI::KSpellUI( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "KSpellUI" );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
    KSpellUILayout = new QGridLayout( this, 1, 1, 0, 6, "KSpellUILayout"); 
    KSpellUILayout->setResizeMode( QLayout::Minimum );

    textLabel2 = new QLabel( this, "textLabel2" );

    KSpellUILayout->addMultiCellWidget( textLabel2, 1, 1, 0, 1 );

    m_unknownWord = new QLabel( this, "m_unknownWord" );

    KSpellUILayout->addWidget( m_unknownWord, 1, 2 );

    textLabel5 = new QLabel( this, "textLabel5" );

    KSpellUILayout->addWidget( textLabel5, 8, 0 );

    m_contextLabel = new QLabel( this, "m_contextLabel" );
    m_contextLabel->setFrameShape( QLabel::Box );
    m_contextLabel->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );

    KSpellUILayout->addMultiCellWidget( m_contextLabel, 0, 0, 0, 5 );

    m_addBtn = new QPushButton( this, "m_addBtn" );

    KSpellUILayout->addMultiCellWidget( m_addBtn, 1, 1, 4, 5 );
    spacer2 = new QSpacerItem( 21, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    KSpellUILayout->addItem( spacer2, 1, 3 );

    m_replaceAllBtn = new QPushButton( this, "m_replaceAllBtn" );

    KSpellUILayout->addWidget( m_replaceAllBtn, 4, 5 );

    m_suggestions = new QListView( this, "m_suggestions" );
    m_suggestions->addColumn( tr2i18n( "Suggested Words" ) );
    m_suggestions->setResizeMode( QListView::AllColumns );

    KSpellUILayout->addMultiCellWidget( m_suggestions, 3, 7, 0, 4 );

    m_replaceBtn = new QPushButton( this, "m_replaceBtn" );

    KSpellUILayout->addWidget( m_replaceBtn, 3, 5 );

    textLabel4 = new QLabel( this, "textLabel4" );

    KSpellUILayout->addMultiCellWidget( textLabel4, 2, 2, 0, 1 );

    m_skipBtn = new QPushButton( this, "m_skipBtn" );

    KSpellUILayout->addWidget( m_skipBtn, 5, 5 );

    m_skipAllBtn = new QPushButton( this, "m_skipAllBtn" );

    KSpellUILayout->addWidget( m_skipAllBtn, 6, 5 );

    m_replacement = new QLineEdit( this, "m_replacement" );

    KSpellUILayout->addMultiCellWidget( m_replacement, 2, 2, 2, 4 );

    m_suggestBtn = new QPushButton( this, "m_suggestBtn" );

    KSpellUILayout->addWidget( m_suggestBtn, 2, 5 );

    m_language = new QComboBox( FALSE, this, "m_language" );

    KSpellUILayout->addMultiCellWidget( m_language, 8, 8, 1, 4 );
    spacer1 = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding );
    KSpellUILayout->addMultiCell( spacer1, 7, 8, 5, 5 );
    languageChange();
    resize( QSize(422, 282).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( m_addBtn, m_replacement );
    setTabOrder( m_replacement, m_suggestBtn );
    setTabOrder( m_suggestBtn, m_replaceBtn );
    setTabOrder( m_replaceBtn, m_replaceAllBtn );
    setTabOrder( m_replaceAllBtn, m_skipBtn );
    setTabOrder( m_skipBtn, m_skipAllBtn );
    setTabOrder( m_skipAllBtn, m_suggestions );
    setTabOrder( m_suggestions, m_language );

    // buddies
    textLabel5->setBuddy( m_language );
    textLabel4->setBuddy( m_replacement );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KSpellUI::languageChange()
{
    textLabel2->setText( tr2i18n( "Unknown word:" ) );
    QWhatsThis::add( textLabel2, tr2i18n( "<qt><p>This word was considered to be an \"unknown word\" because it does not match any entry in the dictionary currently in use. It may also be a word in a foreign language.</p>\n"
"<p>If the word is not misspelled, you may add it to the dictionary by clicking <b>Add to Dictionary</b>. If you don't want to add the unknown word to the dictionary, but you want to leave it unchanged, click <b>Ignore</b> or <b>Ignore All</b>.</p>\n"
"<p>However, if the word is misspelled, you can try to find the correct replacement in the list below. If you cannot find a replacement there, you may type it in the text box below, and click <b>Replace</b> or <b>Replace All</b>.</p>\n"
"</qt>" ) );
    m_unknownWord->setText( tr2i18n( "<b>misspelled</b>" ) );
    QToolTip::add( m_unknownWord, tr2i18n( "Unknown word" ) );
    QWhatsThis::add( m_unknownWord, tr2i18n( "<qt><p>This word was considered to be an \"unknown word\" because it does not match any entry in the dictionary currently in use. It may also be a word in a foreign language.</p>\n"
"<p>If the word is not misspelled, you may add it to the dictionary by clicking <b>Add to Dictionary</b>. If you don't want to add the unknown word to the dictionary, but you want to leave it unchanged, click <b>Ignore</b> or <b>Ignore All</b>.</p>\n"
"<p>However, if the word is misspelled, you can try to find the correct replacement in the list below. If you cannot find a replacement there, you may type it in the text box below, and click <b>Replace</b> or <b>Replace All</b>.</p>\n"
"</qt>" ) );
    textLabel5->setText( tr2i18n( "&Language:" ) );
    QWhatsThis::add( textLabel5, tr2i18n( "<qt>\n"
"<p>Select the language of the document you are proofing here.</p>\n"
"</qt>" ) );
    m_contextLabel->setText( tr2i18n( "... the <b>misspelled</b> word shown in context ..." ) );
    QToolTip::add( m_contextLabel, tr2i18n( "Text excerpt showing the unknown word in its context." ) );
    QWhatsThis::add( m_contextLabel, tr2i18n( "<qt>\n"
"<p>Here you can see a text excerpt showing the unknown word in its context. If this information is not sufficient to choose the best replacement for the unknown word, you can click on the document you are proofing, read a larger part of the text and then return here to continue proofing.</p>\n"
"</qt>" ) );
    m_addBtn->setText( tr2i18n( "<< Add to Dictionary" ) );
    QWhatsThis::add( m_addBtn, tr2i18n( "<qt>\n"
"<p>The unknown word was detected and considered unknown because it is not included in the dictionary.<br>\n"
"Click here if you consider that the unknown word is not misspelled and you want to avoid wrongly detecting it again in the future. If you want to let it remain as is, but not add it to the dictionary, then click <b>Ignore</b> or <b>Ignore All</b> instead.</p>\n"
"</qt>" ) );
    m_replaceAllBtn->setText( tr2i18n( "R&eplace All" ) );
    QWhatsThis::add( m_replaceAllBtn, tr2i18n( "<qt>\n"
"<p>Click here to replace all occurrences of the unknown text with the text in the edit box above (to the left).</p>\n"
"</qt>" ) );
    m_suggestions->header()->setLabel( 0, tr2i18n( "Suggested Words" ) );
    QToolTip::add( m_suggestions, tr2i18n( "Suggestion List" ) );
    QWhatsThis::add( m_suggestions, tr2i18n( "<qt>\n"
"<p>If the unknown word is misspelled, you should check if the correction for it is available and if it is, click on it. If none of the words in this list is a good replacement you may type the correct word in the edit box above.</p>\n"
"<p>To correct this word click <b>Replace</b> if you want to correct only this occurrence or <b>Replace All</b> if you want to correct all occurrences.</p>\n"
"</qt>" ) );
    m_replaceBtn->setText( tr2i18n( "&Replace" ) );
    QWhatsThis::add( m_replaceBtn, tr2i18n( "<qt>\n"
"<p>Click here to replace this occurrence of the unknown text with the text in the edit box above (to the left).</p>\n"
"</qt>" ) );
    textLabel4->setText( tr2i18n( "Replace &with:" ) );
    QWhatsThis::add( textLabel4, tr2i18n( "<qt>\n"
"<p>If the unknown word is misspelled, you should type the correction for your misspelled word here or select it from the list below.</p>\n"
"<p>You can then click <b>Replace</b> if you want to correct only this occurrence of the word or <b>Replace All</b> if you want to correct all occurrences.</p>\n"
"</qt>" ) );
    m_skipBtn->setText( tr2i18n( "&Ignore" ) );
    QWhatsThis::add( m_skipBtn, tr2i18n( "<qt>\n"
"<p>Click here to let this occurrence of the unknown word remain as is.</p>\n"
"<p>This action is useful when the word is a name, an acronym, a foreign word or any other unknown word that you want to use but not add to the dictionary.</p>\n"
"</qt>" ) );
    m_skipAllBtn->setText( tr2i18n( "I&gnore All" ) );
    QWhatsThis::add( m_skipAllBtn, tr2i18n( "<qt>\n"
"<p>Click here to let all occurrences of the unknown word remain as they are.</p>\n"
"<p>This action is useful when the word is a name, an acronym, a foreign word or any other unknown word that you want to use but not add to the dictionary.</p>\n"
"</qt>" ) );
    QWhatsThis::add( m_replacement, tr2i18n( "<qt>\n"
"<p>If the unknown word is misspelled, you should type the correction for your misspelled word here or select it from the list below.</p>\n"
"<p>You can then click <b>Replace</b> if you want to correct only this occurrence of the word or <b>Replace All</b> if you want to correct all occurrences.</p>\n"
"</qt>" ) );
    m_suggestBtn->setText( tr2i18n( "S&uggest" ) );
    m_language->clear();
    m_language->insertItem( tr2i18n( "English" ) );
    QToolTip::add( m_language, tr2i18n( "Language Selection" ) );
    QWhatsThis::add( m_language, tr2i18n( "<qt>\n"
"<p>Select the language of the document you are proofing here.</p>\n"
"</qt>" ) );
}

#include "kspellui.moc"
