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

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

#include "icqsearchbase.h"

#include <ntqvariant.h>
#include <kpushbutton.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqcombobox.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    clearButton = new KPushButton( this, "clearButton" );
    clearButton->setEnabled( false );
    clearButton->setProperty( "stdItem", 10 );

    ICQSearchBaseLayout->addWidget( clearButton, 4, 1 );

    closeButton = new KPushButton( this, "closeButton" );
    closeButton->setProperty( "stdItem", 13 );

    ICQSearchBaseLayout->addWidget( closeButton, 7, 1 );

    stopButton = new KPushButton( this, "stopButton" );
    stopButton->setEnabled( false );
    stopButton->setProperty( "stdItem", 26 );

    ICQSearchBaseLayout->addWidget( stopButton, 3, 1 );

    addButton = new KPushButton( this, "addButton" );
    addButton->setEnabled( false );
    addButton->setProperty( "stdItem", 27 );

    ICQSearchBaseLayout->addWidget( addButton, 5, 1 );

    userInfoButton = new KPushButton( this, "userInfoButton" );
    userInfoButton->setEnabled( false );

    ICQSearchBaseLayout->addWidget( userInfoButton, 6, 1 );
    spacer6 = new TQSpacerItem( 41, 190, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    ICQSearchBaseLayout->addItem( spacer6, 0, 1 );

    tabWidget3 = new TQTabWidget( this, "tabWidget3" );

    tab = new TQWidget( tabWidget3, "tab" );
    tabLayout = new TQGridLayout( tab, 1, 1, 11, 6, "tabLayout"); 

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

    tabLayout->addWidget( textLabel1, 0, 0 );

    uin = new TQLineEdit( tab, "uin" );

    tabLayout->addWidget( uin, 0, 1 );
    spacer4 = new TQSpacerItem( 20, 105, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout->addItem( spacer4, 1, 1 );
    tabWidget3->insertTab( tab, TQString::fromLatin1("") );

    tab_2 = new TQWidget( tabWidget3, "tab_2" );
    tabLayout_2 = new TQGridLayout( tab_2, 1, 1, 11, 6, "tabLayout_2"); 

    lastName = new TQLineEdit( tab_2, "lastName" );

    tabLayout_2->addWidget( lastName, 1, 3 );

    nickName = new TQLineEdit( tab_2, "nickName" );

    tabLayout_2->addWidget( nickName, 0, 1 );

    textLabel4 = new TQLabel( tab_2, "textLabel4" );

    tabLayout_2->addWidget( textLabel4, 1, 2 );

    textLabel3 = new TQLabel( tab_2, "textLabel3" );

    tabLayout_2->addWidget( textLabel3, 0, 2 );

    textLabel6 = new TQLabel( tab_2, "textLabel6" );

    tabLayout_2->addWidget( textLabel6, 1, 0 );

    textLabel2 = new TQLabel( tab_2, "textLabel2" );

    tabLayout_2->addWidget( textLabel2, 0, 0 );

    country = new TQComboBox( false, tab_2, "country" );

    tabLayout_2->addWidget( country, 3, 3 );

    textLabel9 = new TQLabel( tab_2, "textLabel9" );

    tabLayout_2->addWidget( textLabel9, 3, 0 );

    language = new TQComboBox( false, tab_2, "language" );

    tabLayout_2->addWidget( language, 3, 1 );

    city = new TQLineEdit( tab_2, "city" );

    tabLayout_2->addWidget( city, 2, 3 );

    textLabel10 = new TQLabel( tab_2, "textLabel10" );

    tabLayout_2->addWidget( textLabel10, 2, 2 );

    firstName = new TQLineEdit( tab_2, "firstName" );

    tabLayout_2->addWidget( firstName, 0, 3 );

    email = new TQLineEdit( tab_2, "email" );

    tabLayout_2->addWidget( email, 1, 1 );

    textLabel8 = new TQLabel( tab_2, "textLabel8" );

    tabLayout_2->addWidget( textLabel8, 2, 0 );

    gender = new TQComboBox( false, tab_2, "gender" );

    tabLayout_2->addWidget( gender, 2, 1 );

    onlyOnline = new TQCheckBox( tab_2, "onlyOnline" );

    tabLayout_2->addMultiCellWidget( onlyOnline, 4, 4, 0, 1 );

    textLabel11 = new TQLabel( tab_2, "textLabel11" );

    tabLayout_2->addWidget( textLabel11, 3, 2 );
    spacer5 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_2->addItem( spacer5, 5, 1 );
    spacer3 = new TQSpacerItem( 166, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    tabLayout_2->addMultiCell( spacer3, 4, 4, 2, 3 );
    tabWidget3->insertTab( tab_2, TQString::fromLatin1("") );

    ICQSearchBaseLayout->addWidget( tabWidget3, 0, 0 );

    searchResults = new TDEListView( this, "searchResults" );
    searchResults->addColumn( tr2i18n( "UIN" ) );
    searchResults->addColumn( tr2i18n( "Nickname" ) );
    searchResults->addColumn( tr2i18n( "First Name" ) );
    searchResults->addColumn( tr2i18n( "Last Name" ) );
    searchResults->addColumn( tr2i18n( "Email" ) );
    searchResults->addColumn( tr2i18n( "Requires Authorization?" ) );
    searchResults->setAllColumnsShowFocus( true );

    ICQSearchBaseLayout->addMultiCellWidget( searchResults, 1, 7, 0, 0 );

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

    ICQSearchBaseLayout->addWidget( searchButton, 1, 1 );

    newSearchButton = new KPushButton( this, "newSearchButton" );
    newSearchButton->setEnabled( true );

    ICQSearchBaseLayout->addWidget( newSearchButton, 2, 1 );
    languageChange();
    resize( TQSize(603, 465).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( tabWidget3, uin );
    setTabOrder( uin, nickName );
    setTabOrder( nickName, firstName );
    setTabOrder( firstName, email );
    setTabOrder( email, lastName );
    setTabOrder( lastName, gender );
    setTabOrder( gender, city );
    setTabOrder( city, language );
    setTabOrder( language, country );
    setTabOrder( country, onlyOnline );
    setTabOrder( onlyOnline, searchButton );
    setTabOrder( searchButton, stopButton );
    setTabOrder( stopButton, clearButton );
    setTabOrder( clearButton, addButton );
    setTabOrder( addButton, userInfoButton );
    setTabOrder( userInfoButton, closeButton );
    setTabOrder( closeButton, searchResults );

    // buddies
    textLabel1->setBuddy( uin );
    textLabel4->setBuddy( lastName );
    textLabel3->setBuddy( firstName );
    textLabel6->setBuddy( email );
    textLabel2->setBuddy( nickName );
    textLabel9->setBuddy( language );
    textLabel10->setBuddy( city );
    textLabel8->setBuddy( gender );
    textLabel11->setBuddy( country );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ICQSearchBase::languageChange()
{
    clearButton->setText( tr2i18n( "C&lear" ) );
    TQWhatsThis::add( clearButton, tr2i18n( "Clear the results" ) );
    closeButton->setText( tr2i18n( "&Close" ) );
    TQWhatsThis::add( closeButton, tr2i18n( "Close this dialog" ) );
    stopButton->setText( tr2i18n( "Stop" ) );
    TQWhatsThis::add( stopButton, tr2i18n( "Stops the search" ) );
    addButton->setText( tr2i18n( "Add" ) );
    TQWhatsThis::add( addButton, tr2i18n( "Add the selected user to your contact list" ) );
    userInfoButton->setText( tr2i18n( "User Info" ) );
    TQWhatsThis::add( userInfoButton, tr2i18n( "Show information about the selected contact" ) );
    textLabel1->setText( tr2i18n( "&UIN #:" ) );
    tabWidget3->changeTab( tab, tr2i18n( "UIN Search" ) );
    textLabel4->setText( tr2i18n( "&Last name:" ) );
    textLabel3->setText( tr2i18n( "&First name:" ) );
    textLabel6->setText( tr2i18n( "&Email:" ) );
    textLabel2->setText( tr2i18n( "&Nickname:" ) );
    textLabel9->setText( tr2i18n( "Lan&guage:" ) );
    textLabel10->setText( tr2i18n( "&City:" ) );
    textLabel8->setText( tr2i18n( "&Gender:" ) );
    onlyOnline->setText( tr2i18n( "Only search for online contacts" ) );
    textLabel11->setText( tr2i18n( "C&ountry:" ) );
    tabWidget3->changeTab( tab_2, tr2i18n( "ICQ Whitepages Search" ) );
    searchResults->header()->setLabel( 0, tr2i18n( "UIN" ) );
    searchResults->header()->setLabel( 1, tr2i18n( "Nickname" ) );
    searchResults->header()->setLabel( 2, tr2i18n( "First Name" ) );
    searchResults->header()->setLabel( 3, tr2i18n( "Last Name" ) );
    searchResults->header()->setLabel( 4, tr2i18n( "Email" ) );
    searchResults->header()->setLabel( 5, tr2i18n( "Requires Authorization?" ) );
    TQWhatsThis::add( searchResults, tr2i18n( "This is where the results from your search are displayed. If you double-click a result, the search window will close and pass the UIN of the contact you wish to add back to the Add Contact Wizard. You can only add one contact at a time." ) );
    searchButton->setText( tr2i18n( "&Search" ) );
    TQWhatsThis::add( searchButton, tr2i18n( "Search the ICQ Whitepages with your search criteria" ) );
    newSearchButton->setText( tr2i18n( "New Search" ) );
    TQWhatsThis::add( newSearchButton, tr2i18n( "Clears both search fields and results" ) );
}

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

TQMetaObject *ICQSearchBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ICQSearchBase( "ICQSearchBase", &ICQSearchBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ICQSearchBase::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(
	"ICQSearchBase", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ICQSearchBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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