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

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

#include "contactaddednotifywidget.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <addressbooklinkwidget.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqgroupbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    m_label = new TQLabel( this, "m_label" );
    m_label->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );
    Form2Layout->addWidget( m_label );

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

    m_infoButton = new KPushButton( this, "m_infoButton" );
    layout2->addWidget( m_infoButton );
    Form2Layout->addLayout( layout2 );

    m_authorizeCb = new TQCheckBox( this, "m_authorizeCb" );
    m_authorizeCb->setChecked( true );
    Form2Layout->addWidget( m_authorizeCb );

    m_addCb = new TQCheckBox( this, "m_addCb" );
    m_addCb->setChecked( true );
    Form2Layout->addWidget( m_addCb );

    m_contactInfoBox = new TQGroupBox( this, "m_contactInfoBox" );
    m_contactInfoBox->setColumnLayout(0, TQt::Vertical );
    m_contactInfoBox->layout()->setSpacing( 6 );
    m_contactInfoBox->layout()->setMargin( 11 );
    m_contactInfoBoxLayout = new TQVBoxLayout( m_contactInfoBox->layout() );
    m_contactInfoBoxLayout->setAlignment( TQt::AlignTop );

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

    textLabel7 = new TQLabel( m_contactInfoBox, "textLabel7" );
    layout19->addWidget( textLabel7 );

    m_displayNameEdit = new KLineEdit( m_contactInfoBox, "m_displayNameEdit" );
    layout19->addWidget( m_displayNameEdit );
    m_contactInfoBoxLayout->addLayout( layout19 );

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

    textLabel5 = new TQLabel( m_contactInfoBox, "textLabel5" );
    layout6->addWidget( textLabel5 );

    m_groupList = new KComboBox( false, m_contactInfoBox, "m_groupList" );
    m_groupList->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, m_groupList->sizePolicy().hasHeightForWidth() ) );
    m_groupList->setEditable( true );
    layout6->addWidget( m_groupList );
    m_contactInfoBoxLayout->addLayout( layout6 );

    textLabel6 = new TQLabel( m_contactInfoBox, "textLabel6" );
    m_contactInfoBoxLayout->addWidget( textLabel6 );

    layout11 = new TQHBoxLayout( 0, 0, 6, "layout11"); 
    spacer11 = new TQSpacerItem( 51, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout11->addItem( spacer11 );

    widAddresseeLink = new Kopete::UI::AddressBookLinkWidget( m_contactInfoBox, "widAddresseeLink" );
    layout11->addWidget( widAddresseeLink );
    m_contactInfoBoxLayout->addLayout( layout11 );
    Form2Layout->addWidget( m_contactInfoBox );
    spacer21 = new TQSpacerItem( 21, 40, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    Form2Layout->addItem( spacer21 );
    languageChange();
    resize( TQSize(466, 342).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_addCb, TQ_SIGNAL( toggled(bool) ), m_contactInfoBox, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ContactAddedNotifyWidget::languageChange()
{
    m_label->setText( tr2i18n( "The contact XXX added you in his contactlist" ) );
    m_infoButton->setText( tr2i18n( "Read More Info About This Contact" ) );
    m_authorizeCb->setText( tr2i18n( "Authorize this contact to see my status" ) );
    m_addCb->setText( tr2i18n( "Add this contact in my contactlist" ) );
    m_contactInfoBox->setTitle( TQString::null );
    textLabel7->setText( tr2i18n( "Display name:" ) );
    TQToolTip::add( textLabel7, tr2i18n( "The display name of the contact.  Leave it empty to use the contact nickname" ) );
    TQWhatsThis::add( textLabel7, tr2i18n( "Enter the contact display name. This is how the contact will appears in the contactlist.\n"
"Leave it empty if you want to see the contact nickname as display name." ) );
    TQToolTip::add( m_displayNameEdit, tr2i18n( "The display name of the contact.  Leave it empty to use the contact nickname" ) );
    TQWhatsThis::add( m_displayNameEdit, tr2i18n( "Enter the contact display name. This is how the contact will appears in the contactlist.\n"
"Leave it empty if you want to see the contact nickname as display name." ) );
    textLabel5->setText( tr2i18n( "In the group:" ) );
    TQWhatsThis::add( textLabel5, tr2i18n( "Enter the group where the contact should be added. Leave it empty to add it in the top level group." ) );
    TQWhatsThis::add( m_groupList, tr2i18n( "Enter the group where the contact should be added. Leave it empty to add it in the top level group." ) );
    textLabel6->setText( tr2i18n( "Addressbook link:" ) );
}

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

TQMetaObject *ContactAddedNotifyWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ContactAddedNotifyWidget( "ContactAddedNotifyWidget", &ContactAddedNotifyWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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