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

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

#include "invitewidget.h"

#include <ntqvariant.h>
#include <kactivelabel.h>
#include <ntqlabel.h>
#include <ntqpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    TextLabel2 = new TQLabel( this, "TextLabel2" );
    TQFont TextLabel2_font(  TextLabel2->font() );
    TextLabel2_font.setBold( true );
    TextLabel2->setFont( TextLabel2_font ); 

    InviteWidgetLayout->addMultiCellWidget( TextLabel2, 0, 0, 1, 3 );

    kActiveLabel1 = new KActiveLabel( this, "kActiveLabel1" );
    kActiveLabel1->setFocusPolicy( KActiveLabel::NoFocus );

    InviteWidgetLayout->addMultiCellWidget( kActiveLabel1, 1, 1, 1, 3 );

    pixmapLabel = new TQLabel( this, "pixmapLabel" );
    pixmapLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, pixmapLabel->sizePolicy().hasHeightForWidth() ) );
    pixmapLabel->setMinimumSize( TQSize( 108, 318 ) );
    pixmapLabel->setMaximumSize( TQSize( 108, 318 ) );
    pixmapLabel->setFrameShape( TQLabel::WinPanel );
    pixmapLabel->setFrameShadow( TQLabel::Sunken );
    pixmapLabel->setScaledContents( true );
    pixmapLabel->setAlignment( int( TQLabel::AlignTop ) );

    InviteWidgetLayout->addMultiCellWidget( pixmapLabel, 0, 6, 0, 0 );
    spacer4 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    InviteWidgetLayout->addItem( spacer4, 4, 3 );

    btnCreateInvite = new TQPushButton( this, "btnCreateInvite" );

    InviteWidgetLayout->addWidget( btnCreateInvite, 3, 2 );
    spacer5 = new TQSpacerItem( 20, 24, TQSizePolicy::Minimum, TQSizePolicy::Fixed );
    InviteWidgetLayout->addItem( spacer5, 6, 2 );
    spacer3 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    InviteWidgetLayout->addItem( spacer3, 4, 1 );

    btnManageInvite = new TQPushButton( this, "btnManageInvite" );

    InviteWidgetLayout->addWidget( btnManageInvite, 5, 2 );

    btnEmailInvite = new TQPushButton( this, "btnEmailInvite" );

    InviteWidgetLayout->addWidget( btnEmailInvite, 4, 2 );
    spacer2 = new TQSpacerItem( 20, 89, TQSizePolicy::Minimum, TQSizePolicy::MinimumExpanding );
    InviteWidgetLayout->addItem( spacer2, 2, 2 );
    languageChange();
    resize( TQSize(521, 328).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void InviteWidget::languageChange()
{
    setCaption( TQString::null );
    TextLabel2->setText( tr2i18n( "Welcome to TDE Desktop Sharing" ) );
    kActiveLabel1->setText( tr2i18n( "TDE Desktop Sharing allows you to invite somebody at a remote location to watch and possibly control your desktop.\n"
"<a href=\"whatsthis:<p>An invitation creates a one-time password that allows the receiver to connect to your desktop. It is valid for only one successful connection and will expire after an hour if it has not been used. When somebody connects to your computer a dialog will appear and ask you for permission. The connection will not be established before you accept it. In this dialog you can also restrict the other person to view your desktop only, without the ability to move your mouse pointer or press keys.</p><p>If you want to create a permanent password for Desktop Sharing, allow 'Uninvited Connections' in the configuration.</p>\">More about invitations...</a>" ) );
    btnCreateInvite->setText( tr2i18n( "Create &Personal Invitation..." ) );
    TQToolTip::add( btnCreateInvite, TQString::null );
    TQWhatsThis::add( btnCreateInvite, tr2i18n( "Create a new invitation and display the connection data. Use this option if you want to invite somebody personally, for example, to give the connection data over the phone." ) );
    btnManageInvite->setText( tr2i18n( "&Manage Invitations (%1)..." ) );
    btnEmailInvite->setText( tr2i18n( "Invite via &Email..." ) );
    TQWhatsThis::add( btnEmailInvite, tr2i18n( "This button will start your email application with a pre-configured text that explains to the recipient how to connect to your computer. " ) );
}

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

TQMetaObject *InviteWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_InviteWidget( "InviteWidget", &InviteWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* InviteWidget::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 }
    };
    static const TQUMethod signal_0 = {"createInviteClicked", 0, 0 };
    static const TQUMethod signal_1 = {"emailInviteClicked", 0, 0 };
    static const TQUMethod signal_2 = {"manageInviteClicked", 0, 0 };
    static const TQMetaData signal_tbl[] = {
	{ "createInviteClicked()", &signal_0, TQMetaData::Public },
	{ "emailInviteClicked()", &signal_1, TQMetaData::Public },
	{ "manageInviteClicked()", &signal_2, TQMetaData::Public }
    };
    metaObj = TQMetaObject::new_metaobject(
	"InviteWidget", parentObject,
	slot_tbl, 1,
	signal_tbl, 3,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_InviteWidget.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

// TQ_SIGNAL createInviteClicked
void InviteWidget::createInviteClicked()
{
    activate_signal( staticMetaObject()->signalOffset() + 0 );
}

// TQ_SIGNAL emailInviteClicked
void InviteWidget::emailInviteClicked()
{
    activate_signal( staticMetaObject()->signalOffset() + 1 );
}

// TQ_SIGNAL manageInviteClicked
void InviteWidget::manageInviteClicked()
{
    activate_signal( staticMetaObject()->signalOffset() + 2 );
}

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

bool InviteWidget::tqt_emit( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: createInviteClicked(); break;
    case 1: emailInviteClicked(); break;
    case 2: manageInviteClicked(); break;
    default:
	return TQWidget::tqt_emit(_id,_o);
    }
    return true;
}
#ifndef TQT_NO_PROPERTIES

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

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