#include "simapi.h"
/****************************************************************************
** Form implementation generated from reading ui file './jabberconfigbase.ui'
**
** Created: вт мар 30 17:32:50 2004
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.1.2   edited Dec 19 11:45 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "jabberconfigbase.h"

#include <qvariant.h>
#include <qwidget.h>
#include <qpushbutton.h>
#include <qtabwidget.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qspinbox.h>
#include <qframe.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>

#include "linklabel.h"
static const char* const img0_jabberconfigbase[] = { 
"22 22 2 1",
". c None",
"# c #a4c610",
"........######........",
".....###########......",
"....##############....",
"...################...",
"..######......######..",
"..#####........#####..",
".#####.......#..#####.",
".####.......###..####.",
"####.......#####..####",
"####......#####...####",
"####....#######...####",
"####....######....####",
"####...########...####",
".####.##########..####",
".####..####.#########.",
".#####..##...########.",
"..#####.......#######.",
"..######......######..",
"...###################",
"....##################",
"......###########.###.",
"........######.....#.."};

static const char* const img1_jabberconfigbase[] = { 
"22 22 2 1",
". c None",
"# c #a1c410",
"........######........",
".....###########......",
"....##############....",
"...################...",
"..######......######..",
"..#####........#####..",
".#####.......#..#####.",
".####.......###..####.",
"####.......#####..####",
"####......#####...####",
"####....#######...####",
"####....######....####",
"####...########...####",
".####.##########..####",
".####..####.#########.",
".#####..##...########.",
"..#####.......#######.",
"..######......######..",
"...###################",
"....##################",
"......###########.###.",
"........######.....#.."};


/* 
 *  Constructs a JabberConfigBase as a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f'.
 */
JabberConfigBase::JabberConfigBase( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl ),
      image0( (const char **) img0_jabberconfigbase ),
      image1( (const char **) img1_jabberconfigbase )
{
    if ( !name )
	setName( "Form1" );
    Form1Layout = new QVBoxLayout( this, 11, 6, "Form1Layout"); 

    tabCfg = new QTabWidget( this, "tabCfg" );

    tabJabber = new QWidget( tabCfg, "tabJabber" );
    tabJabberLayout = new QGridLayout( tabJabber, 1, 1, 11, 6, "tabJabberLayout"); 

    TextLabel2 = new QLabel( tabJabber, "TextLabel2" );
    TextLabel2->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    tabJabberLayout->addWidget( TextLabel2, 2, 0 );

    edtPasswd = new QLineEdit( tabJabber, "edtPasswd" );
    edtPasswd->setProperty( "echoMode", "Password" );

    tabJabberLayout->addWidget( edtPasswd, 2, 1 );

    lblUin = new QLabel( tabJabber, "lblUin" );
    lblUin->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    tabJabberLayout->addWidget( lblUin, 1, 0 );

    edtID = new QLineEdit( tabJabber, "edtID" );

    tabJabberLayout->addWidget( edtID, 1, 1 );

    chkRegister = new QCheckBox( tabJabber, "chkRegister" );

    tabJabberLayout->addMultiCellWidget( chkRegister, 0, 0, 0, 1 );

    lblServer1 = new QLabel( tabJabber, "lblServer1" );
    lblServer1->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    tabJabberLayout->addWidget( lblServer1, 3, 0 );

    edtServer1 = new QLineEdit( tabJabber, "edtServer1" );

    tabJabberLayout->addWidget( edtServer1, 3, 1 );

    lblPort1 = new QLabel( tabJabber, "lblPort1" );
    lblPort1->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    tabJabberLayout->addWidget( lblPort1, 4, 0 );

    edtPort1 = new QSpinBox( tabJabber, "edtPort1" );
    edtPort1->setProperty( "maxValue", 65355 );
    edtPort1->setProperty( "minValue", 1 );

    tabJabberLayout->addWidget( edtPort1, 4, 1 );
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    tabJabberLayout->addItem( spacer, 7, 1 );

    lnkPublic = new LinkLabel( tabJabber, "lnkPublic" );

    tabJabberLayout->addMultiCellWidget( lnkPublic, 6, 6, 0, 1 );

    chkSSL = new QCheckBox( tabJabber, "chkSSL" );

    tabJabberLayout->addMultiCellWidget( chkSSL, 5, 5, 0, 1 );
    tabCfg->insertTab( tabJabber, QString("") );

    tab = new QWidget( tabCfg, "tab" );
    tabLayout = new QGridLayout( tab, 1, 1, 11, 6, "tabLayout"); 

    lblServer = new QLabel( tab, "lblServer" );
    lblServer->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignRight ) );

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

    edtServer = new QLineEdit( tab, "edtServer" );

    tabLayout->addMultiCellWidget( edtServer, 0, 0, 1, 2 );

    lblPort = new QLabel( tab, "lblPort" );
    lblPort->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    tabLayout->addWidget( lblPort, 1, 0 );

    edtPort = new QSpinBox( tab, "edtPort" );
    edtPort->setProperty( "maxValue", 65535 );
    edtPort->setProperty( "minValue", 1 );

    tabLayout->addWidget( edtPort, 1, 1 );
    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    tabLayout->addItem( spacer_2, 1, 2 );

    Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1"); 

    edtMinPort = new QSpinBox( tab, "edtMinPort" );
    edtMinPort->setProperty( "maxValue", 65534 );
    edtMinPort->setProperty( "minValue", 1024 );
    Layout1->addWidget( edtMinPort );

    TextLabel2_2 = new QLabel( tab, "TextLabel2_2" );
    Layout1->addWidget( TextLabel2_2 );

    edtMaxPort = new QSpinBox( tab, "edtMaxPort" );
    edtMaxPort->setProperty( "maxValue", 65534 );
    edtMaxPort->setProperty( "minValue", 1024 );
    Layout1->addWidget( edtMaxPort );
    QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout1->addItem( spacer_3 );

    tabLayout->addMultiCellLayout( Layout1, 5, 5, 0, 2 );

    TextLabel1_2_2 = new QLabel( tab, "TextLabel1_2_2" );

    tabLayout->addMultiCellWidget( TextLabel1_2_2, 4, 4, 0, 2 );

    chkPlain = new QCheckBox( tab, "chkPlain" );

    tabLayout->addMultiCellWidget( chkPlain, 3, 3, 0, 2 );

    chkSSL1 = new QCheckBox( tab, "chkSSL1" );

    tabLayout->addMultiCellWidget( chkSSL1, 2, 2, 0, 2 );

    chkHTTP = new QCheckBox( tab, "chkHTTP" );

    tabLayout->addMultiCellWidget( chkHTTP, 7, 7, 0, 2 );

    Line2 = new QFrame( tab, "Line2" );
    Line2->setProperty( "frameShape", "HLine" );
    Line2->setProperty( "frameShadow", "Sunken" );
    Line2->setProperty( "frameShape", QFrame::VLine );
    Line2->setProperty( "frameShape", "HLine" );

    tabLayout->addMultiCellWidget( Line2, 6, 6, 0, 2 );

    TextLabel1_4 = new QLabel( tab, "TextLabel1_4" );
    TextLabel1_4->setProperty( "sizePolicy", QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, 0, 0, TextLabel1_4->sizePolicy().hasHeightForWidth() ) );
    TextLabel1_4->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignLeft ) );

    tabLayout->addMultiCellWidget( TextLabel1_4, 9, 9, 0, 2 );
    QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    tabLayout->addItem( spacer_4, 10, 0 );

    Layout6 = new QHBoxLayout( 0, 0, 6, "Layout6"); 

    TextLabel1_3 = new QLabel( tab, "TextLabel1_3" );
    Layout6->addWidget( TextLabel1_3 );

    edtUrl = new QLineEdit( tab, "edtUrl" );
    Layout6->addWidget( edtUrl );

    tabLayout->addMultiCellLayout( Layout6, 8, 8, 0, 2 );
    tabCfg->insertTab( tab, QString("") );

    tab_2 = new QWidget( tabCfg, "tab_2" );
    tabLayout_2 = new QGridLayout( tab_2, 1, 1, 11, 6, "tabLayout_2"); 

    TextLabel1_2 = new QLabel( tab_2, "TextLabel1_2" );
    TextLabel1_2->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignRight ) );

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

    edtResource = new QLineEdit( tab_2, "edtResource" );

    tabLayout_2->addMultiCellWidget( edtResource, 0, 0, 1, 2 );

    TextLabel1 = new QLabel( tab_2, "TextLabel1" );
    TextLabel1->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignRight ) );

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

    edtPriority = new QSpinBox( tab_2, "edtPriority" );

    tabLayout_2->addWidget( edtPriority, 1, 1 );
    QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    tabLayout_2->addItem( spacer_5, 1, 2 );

    chkVHost = new QCheckBox( tab_2, "chkVHost" );

    tabLayout_2->addMultiCellWidget( chkVHost, 2, 2, 0, 2 );

    edtVHost = new QLineEdit( tab_2, "edtVHost" );

    tabLayout_2->addMultiCellWidget( edtVHost, 3, 3, 0, 2 );

    chkTyping = new QCheckBox( tab_2, "chkTyping" );

    tabLayout_2->addMultiCellWidget( chkTyping, 4, 4, 0, 2 );

    chkIcons = new QCheckBox( tab_2, "chkIcons" );

    tabLayout_2->addMultiCellWidget( chkIcons, 6, 6, 0, 2 );

    chkRichText = new QCheckBox( tab_2, "chkRichText" );

    tabLayout_2->addMultiCellWidget( chkRichText, 5, 5, 0, 2 );
    QSpacerItem* spacer_6 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    tabLayout_2->addItem( spacer_6, 9, 0 );

    chkSubscribe = new QCheckBox( tab_2, "chkSubscribe" );

    tabLayout_2->addMultiCellWidget( chkSubscribe, 7, 7, 0, 2 );

    chkAccept = new QCheckBox( tab_2, "chkAccept" );

    tabLayout_2->addMultiCellWidget( chkAccept, 8, 8, 0, 2 );
    tabCfg->insertTab( tab_2, QString("") );
    Form1Layout->addWidget( tabCfg );
    languageChange();
    resize( QSize(335, 300).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( tabCfg, chkRegister );
    setTabOrder( chkRegister, edtID );
    setTabOrder( edtID, edtPasswd );
    setTabOrder( edtPasswd, edtServer1 );
    setTabOrder( edtServer1, edtPort1 );
    setTabOrder( edtPort1, chkSSL );
    setTabOrder( chkSSL, edtServer );
    setTabOrder( edtServer, edtPort );
    setTabOrder( edtPort, chkPlain );
    setTabOrder( chkPlain, edtMinPort );
    setTabOrder( edtMinPort, edtMaxPort );
    setTabOrder( edtMaxPort, edtResource );
    setTabOrder( edtResource, edtPriority );
    setTabOrder( edtPriority, chkVHost );
    setTabOrder( chkVHost, edtVHost );
    setTabOrder( edtVHost, chkTyping );
    setTabOrder( chkTyping, chkRichText );
    setTabOrder( chkRichText, chkIcons );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void JabberConfigBase::languageChange()
{
    setProperty( "caption", i18n( "Form1" ) );
    TextLabel2->setProperty( "text", i18n( "Password:" ) );
    lblUin->setProperty( "text", i18n( "Username:" ) );
    chkRegister->setProperty( "text", i18n( "&Register new account" ) );
    lblServer1->setProperty( "text", i18n( "Server:" ) );
    lblPort1->setProperty( "text", i18n( "Port:" ) );
    chkSSL->setProperty( "text", i18n( "Use &SSL" ) );
    tabCfg->changeTab( tabJabber, i18n( "&Jabber" ) );
    lblServer->setProperty( "text", i18n( "Server:" ) );
    lblPort->setProperty( "text", i18n( "Port:" ) );
    TextLabel2_2->setProperty( "text", i18n( "-" ) );
    TextLabel1_2_2->setProperty( "text", i18n( "Port range for direct connections:" ) );
    chkPlain->setProperty( "text", i18n( "Use &plain text login" ) );
    chkSSL1->setProperty( "text", i18n( "Use &SSL" ) );
    chkHTTP->setProperty( "text", i18n( "Use &HTTP polling" ) );
    TextLabel1_4->setProperty( "text", i18n( "Note: For HTTP-pooling using proxy setings for HTTP" ) );
    TextLabel1_3->setProperty( "text", i18n( "URL:" ) );
    tabCfg->changeTab( tab, i18n( "&Network" ) );
    TextLabel1_2->setProperty( "text", i18n( "Resource:" ) );
    TextLabel1->setProperty( "text", i18n( "Priority:" ) );
    chkVHost->setProperty( "text", i18n( "Manualy specify Jabber host:" ) );
    chkTyping->setProperty( "text", i18n( "Enable &typing notification" ) );
    chkIcons->setProperty( "text", i18n( "Use protocol &icons for agents contacts" ) );
    chkRichText->setProperty( "text", i18n( "Send &rich text messages if possible" ) );
    chkSubscribe->setProperty( "text", i18n( "Automaticaly send &subscribe request" ) );
    chkAccept->setProperty( "text", i18n( "Automaticaly &accept subscribe requests" ) );
    tabCfg->changeTab( tab_2, i18n( "&Options" ) );
}

#include "jabberconfigbase.moc"
