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

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

#include "gadusearch.h"

#include <ntqvariant.h>
#include <krestrictedline.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqwidgetstack.h>
#include <ntqbuttongroup.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqspinbox.h>
#include <ntqcombobox.h>
#include <ntqradiobutton.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>

static const char* const image0_data[] = { 
"16 16 9 1",
". c None",
"# c #000000",
"f c #c00000",
"e c #ecd401",
"d c #f2d203",
"a c #f2de01",
"g c #ff0000",
"b c #ffea01",
"c c #ffff00",
".......##.......",
"...#..#aa#..#...",
"..#a#.#aa#.#a#..",
".#aaa#aaaa#aaa#.",
"..#aabccbdaba#..",
"...#bcbbdeee#...",
".##bbc#ed#dda##.",
"#aabbbddddddaaa#",
"#aaabeddedddbaa#",
".##bbdffffeea##.",
"...#ddbggbed#...",
"..#aabaaadbea#..",
".#aaa#aaaa#aaa#.",
"..#a#.#aa#.#a#..",
"...#..#aa#..#...",
".......##......."};


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

    pubsearch = new TQWidgetStack( this, "pubsearch" );

    page = new TQWidget( pubsearch, "page" );
    pageLayout = new TQGridLayout( page, 1, 1, 11, 6, "pageLayout"); 

    buttonGroup2 = new TQButtonGroup( page, "buttonGroup2" );
    buttonGroup2->setLineWidth( 0 );
    buttonGroup2->setFlat( true );
    buttonGroup2->setColumnLayout(0, TQt::Vertical );
    buttonGroup2->layout()->setSpacing( 6 );
    buttonGroup2->layout()->setMargin( 11 );
    buttonGroup2Layout = new TQGridLayout( buttonGroup2->layout() );
    buttonGroup2Layout->setAlignment( TQt::AlignTop );

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

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

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

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

    textLabel1a = new TQLabel( buttonGroup2, "textLabel1a" );
    layout29->addWidget( textLabel1a );

    textLabel1_2a = new TQLabel( buttonGroup2, "textLabel1_2a" );
    layout29->addWidget( textLabel1_2a );

    textLabel1_3a = new TQLabel( buttonGroup2, "textLabel1_3a" );
    layout29->addWidget( textLabel1_3a );

    textLabel1_3_2a = new TQLabel( buttonGroup2, "textLabel1_3_2a" );
    layout29->addWidget( textLabel1_3_2a );
    layout31->addLayout( layout29 );

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

    nameS = new TQLineEdit( buttonGroup2, "nameS" );
    layout30->addWidget( nameS );

    surname = new TQLineEdit( buttonGroup2, "surname" );
    layout30->addWidget( surname );

    nick = new TQLineEdit( buttonGroup2, "nick" );
    layout30->addWidget( nick );

    cityS = new TQLineEdit( buttonGroup2, "cityS" );
    layout30->addWidget( cityS );
    layout31->addLayout( layout30 );
    layout36->addLayout( layout31 );

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

    textLabel1_2_2a = new TQLabel( buttonGroup2, "textLabel1_2_2a" );
    layout34->addWidget( textLabel1_2_2a );

    ageFrom = new TQSpinBox( buttonGroup2, "ageFrom" );
    ageFrom->setCursor( TQCursor( 0 ) );
    ageFrom->setButtonSymbols( TQSpinBox::PlusMinus );
    ageFrom->setMaxValue( 120 );
    ageFrom->setMinValue( 0 );
    ageFrom->setValue( 0 );
    layout34->addWidget( ageFrom );

    textLabel1_2_3 = new TQLabel( buttonGroup2, "textLabel1_2_3" );
    layout34->addWidget( textLabel1_2_3 );

    ageTo = new TQSpinBox( buttonGroup2, "ageTo" );
    ageTo->setCursor( TQCursor( 0 ) );
    ageTo->setButtonSymbols( TQSpinBox::PlusMinus );
    ageTo->setMaxValue( 120 );
    ageTo->setMinValue( 0 );
    ageTo->setValue( 0 );
    layout34->addWidget( ageTo );
    spacer1 = new TQSpacerItem( 297, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout34->addItem( spacer1 );
    layout36->addLayout( layout34 );

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

    textLabel1_4a = new TQLabel( buttonGroup2, "textLabel1_4a" );
    textLabel1_4a->setTextFormat( TQLabel::PlainText );
    textLabel1_4a->setScaledContents( false );
    layout32->addWidget( textLabel1_4a );

    gender = new TQComboBox( false, buttonGroup2, "gender" );
    gender->setFocusPolicy( TQComboBox::TabFocus );
    layout32->addWidget( gender );
    layout36->addLayout( layout32 );
    layout38->addLayout( layout36 );

    buttonGroup2Layout->addLayout( layout38, 1, 0 );

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

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

    uin_static = new TQLabel( buttonGroup2, "uin_static" );
    layout33->addWidget( uin_static );

    UIN = new KRestrictedLine( buttonGroup2, "UIN" );
    UIN->setMaxLength( 32 );
    UIN->setEchoMode( KRestrictedLine::Normal );
    layout33->addWidget( UIN );
    layout37->addLayout( layout33 );

    buttonGroup2Layout->addLayout( layout37, 3, 0 );

    radioByUin = new TQRadioButton( buttonGroup2, "radioByUin" );
    radioByUin->setAutoRepeat( true );

    buttonGroup2Layout->addWidget( radioByUin, 2, 0 );

    radioByData = new TQRadioButton( buttonGroup2, "radioByData" );
    radioByData->setAutoMask( true );

    buttonGroup2Layout->addWidget( radioByData, 0, 0 );

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

    onlyOnline = new TQCheckBox( buttonGroup2, "onlyOnline" );
    layout35->addWidget( onlyOnline );
    spacer2 = new TQSpacerItem( 224, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout35->addItem( spacer2 );

    buttonGroup2Layout->addLayout( layout35, 5, 0 );
    spacer5 = new TQSpacerItem( 20, 21, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    buttonGroup2Layout->addItem( spacer5, 4, 0 );

    pageLayout->addWidget( buttonGroup2, 0, 0 );
    pubsearch->addWidget( page, 0 );

    page_2 = new TQWidget( pubsearch, "page_2" );
    pageLayout_2 = new TQGridLayout( page_2, 1, 1, 11, 6, "pageLayout_2"); 

    listFound = new TDEListView( page_2, "listFound" );
    listFound->addColumn( tr2i18n( "Status" ) );
    listFound->header()->setLabel( listFound->header()->count() - 1, image0, tr2i18n( "Status" ) );
    listFound->header()->setResizeEnabled( false, listFound->header()->count() - 1 );
    listFound->addColumn( tr2i18n( "Name" ) );
    listFound->header()->setResizeEnabled( false, listFound->header()->count() - 1 );
    listFound->addColumn( tr2i18n( "Nick Name" ) );
    listFound->header()->setResizeEnabled( false, listFound->header()->count() - 1 );
    listFound->addColumn( tr2i18n( "Age" ) );
    listFound->header()->setResizeEnabled( false, listFound->header()->count() - 1 );
    listFound->addColumn( tr2i18n( "City" ) );
    listFound->header()->setResizeEnabled( false, listFound->header()->count() - 1 );
    listFound->addColumn( tr2i18n( "UIN" ) );
    listFound->header()->setResizeEnabled( false, listFound->header()->count() - 1 );
    listFound->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)3, 0, 0, listFound->sizePolicy().hasHeightForWidth() ) );
    listFound->setMinimumSize( TQSize( 512, 256 ) );
    listFound->setMaximumSize( TQSize( 640, 512 ) );
    listFound->setLineWidth( 2 );
    listFound->setResizePolicy( TDEListView::AutoOneFit );
    listFound->setProperty( "selectionMode", "Extended" );
    listFound->setAllColumnsShowFocus( true );
    listFound->setShowSortIndicator( true );
    listFound->setResizeMode( TDEListView::NoColumn );
    listFound->setFullWidth( false );
    listFound->setItemsMovable( false );
    listFound->setAutoOpen( false );
    listFound->setDropVisualizer( false );

    pageLayout_2->addWidget( listFound, 0, 0 );
    pubsearch->addWidget( page_2, 1 );

    GaduPublicDirectoryLayout->addWidget( pubsearch, 0, 0 );
    languageChange();
    resize( TQSize(570, 386).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( radioByData, TQ_SIGNAL( toggled(bool) ), UIN, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByData, TQ_SIGNAL( toggled(bool) ), uin_static, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByUin, TQ_SIGNAL( toggled(bool) ), ageFrom, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByUin, TQ_SIGNAL( toggled(bool) ), ageTo, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByUin, TQ_SIGNAL( toggled(bool) ), cityS, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByUin, TQ_SIGNAL( toggled(bool) ), gender, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByUin, TQ_SIGNAL( toggled(bool) ), nameS, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByUin, TQ_SIGNAL( toggled(bool) ), surname, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByUin, TQ_SIGNAL( toggled(bool) ), textLabel1_2_2a, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByUin, TQ_SIGNAL( toggled(bool) ), textLabel1_2a, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByUin, TQ_SIGNAL( toggled(bool) ), textLabel1_3_2a, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByUin, TQ_SIGNAL( toggled(bool) ), textLabel1a, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByUin, TQ_SIGNAL( toggled(bool) ), nick, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByUin, TQ_SIGNAL( toggled(bool) ), textLabel1_4a, TQ_SLOT( setDisabled(bool) ) );
    connect( radioByUin, TQ_SIGNAL( toggled(bool) ), textLabel1_3a, TQ_SLOT( setDisabled(bool) ) );

    // tab order
    setTabOrder( nameS, surname );
    setTabOrder( surname, nick );
    setTabOrder( nick, cityS );
    setTabOrder( cityS, gender );
    setTabOrder( gender, UIN );
    setTabOrder( UIN, ageFrom );
    setTabOrder( ageFrom, ageTo );
    setTabOrder( ageTo, onlyOnline );
    setTabOrder( onlyOnline, listFound );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void GaduPublicDirectory::languageChange()
{
    buttonGroup2->setTitle( TQString::null );
    textLabel1a->setText( tr2i18n( "Name:" ) );
    textLabel1_2a->setText( tr2i18n( "Surname:" ) );
    textLabel1_3a->setText( tr2i18n( "Nick:" ) );
    textLabel1_3_2a->setText( tr2i18n( "City:" ) );
    textLabel1_2_2a->setText( tr2i18n( "Age from:" ) );
    textLabel1_2_3->setText( tr2i18n( "to:" ) );
    textLabel1_4a->setText( tr2i18n( "Gender:" ) );
    gender->clear();
    gender->insertItem( TQString::null );
    gender->insertItem( tr2i18n( "Male" ) );
    gender->insertItem( tr2i18n( "Female" ) );
    uin_static->setText( tr2i18n( "User number:" ) );
    radioByUin->setText( tr2i18n( "Request information about user:" ) );
    radioByData->setText( tr2i18n( "Search by specified data:" ) );
    onlyOnline->setText( tr2i18n( "Lookup only those that are currently online" ) );
    listFound->header()->setLabel( 0, tr2i18n( "Status" ) );
    listFound->header()->setLabel( 1, tr2i18n( "Name" ) );
    listFound->header()->setLabel( 2, tr2i18n( "Nick Name" ) );
    listFound->header()->setLabel( 3, tr2i18n( "Age" ) );
    listFound->header()->setLabel( 4, tr2i18n( "City" ) );
    listFound->header()->setLabel( 5, tr2i18n( "UIN" ) );
    listFound->clear();
    TQListViewItem * item = new TQListViewItem( listFound, 0 );
    item->setText( 0, tr2i18n( "12" ) );
    item->setText( 1, tr2i18n( "DONT_TRANSLATE" ) );
    item->setText( 2, tr2i18n( "DONT_TRANSL" ) );
    item->setText( 3, tr2i18n( "999" ) );
    item->setText( 4, tr2i18n( "DONT_TRANSL" ) );
    item->setText( 5, tr2i18n( "245324956234" ) );

}

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

TQMetaObject *GaduPublicDirectory::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_GaduPublicDirectory( "GaduPublicDirectory", &GaduPublicDirectory::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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