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

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

#include "pageSizeWidget_base.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "sizePreview.h"

/*
 *  Constructs a pageSizeWidget_base as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
pageSizeWidget_base::pageSizeWidget_base( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "pageSizeWidget_base" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)4, 0, 0, sizePolicy().hasHeightForWidth() ) );
    pageSizeWidget_baseLayout = new TQHBoxLayout( this, 11, 6, "pageSizeWidget_baseLayout"); 

    GroupBox5 = new TQGroupBox( this, "GroupBox5" );
    GroupBox5->setFrameShape( TQGroupBox::Box );
    GroupBox5->setFrameShadow( TQGroupBox::Sunken );
    GroupBox5->setColumnLayout(0, TQt::Vertical );
    GroupBox5->layout()->setSpacing( 6 );
    GroupBox5->layout()->setMargin( 11 );
    GroupBox5Layout = new TQGridLayout( GroupBox5->layout() );
    GroupBox5Layout->setAlignment( TQt::AlignTop );

    TextLabel3 = new TQLabel( GroupBox5, "TextLabel3" );

    GroupBox5Layout->addWidget( TextLabel3, 0, 0 );

    TextLabel1 = new TQLabel( GroupBox5, "TextLabel1" );

    GroupBox5Layout->addWidget( TextLabel1, 2, 0 );

    TextLabel2 = new TQLabel( GroupBox5, "TextLabel2" );

    GroupBox5Layout->addWidget( TextLabel2, 3, 0 );

    widthInput = new TQLineEdit( GroupBox5, "widthInput" );

    GroupBox5Layout->addWidget( widthInput, 2, 1 );

    heightInput = new TQLineEdit( GroupBox5, "heightInput" );

    GroupBox5Layout->addWidget( heightInput, 3, 1 );

    heightUnits = new KComboBox( false, GroupBox5, "heightUnits" );

    GroupBox5Layout->addWidget( heightUnits, 3, 2 );

    widthUnits = new KComboBox( false, GroupBox5, "widthUnits" );

    GroupBox5Layout->addWidget( widthUnits, 2, 2 );

    TextLabel4 = new TQLabel( GroupBox5, "TextLabel4" );

    GroupBox5Layout->addWidget( TextLabel4, 1, 0 );

    formatChoice = new KComboBox( false, GroupBox5, "formatChoice" );

    GroupBox5Layout->addMultiCellWidget( formatChoice, 0, 0, 1, 2 );

    orientationChoice = new KComboBox( false, GroupBox5, "orientationChoice" );

    GroupBox5Layout->addMultiCellWidget( orientationChoice, 1, 1, 1, 2 );
    pageSizeWidget_baseLayout->addWidget( GroupBox5 );

    GroupBox6 = new TQGroupBox( this, "GroupBox6" );
    GroupBox6->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)7, 0, 0, GroupBox6->sizePolicy().hasHeightForWidth() ) );
    GroupBox6->setFrameShape( TQGroupBox::Box );
    GroupBox6->setLineWidth( 1 );
    GroupBox6->setColumnLayout(0, TQt::Vertical );
    GroupBox6->layout()->setSpacing( 6 );
    GroupBox6->layout()->setMargin( 11 );
    GroupBox6Layout = new TQHBoxLayout( GroupBox6->layout() );
    GroupBox6Layout->setAlignment( TQt::AlignTop );

    previewer = new SizePreview( GroupBox6, "previewer" );
    previewer->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)3, 0, 0, previewer->sizePolicy().hasHeightForWidth() ) );
    previewer->setMinimumSize( TQSize( 250, 50 ) );
    GroupBox6Layout->addWidget( previewer );
    pageSizeWidget_baseLayout->addWidget( GroupBox6 );
    languageChange();
    resize( TQSize(595, 175).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( formatChoice, orientationChoice );
    setTabOrder( orientationChoice, widthInput );
    setTabOrder( widthInput, widthUnits );
    setTabOrder( widthUnits, heightInput );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void pageSizeWidget_base::languageChange()
{
    TQToolTip::add( this, TQString::null );
    GroupBox5->setTitle( tr2i18n( "Page Format" ) );
    TextLabel3->setText( tr2i18n( "Format:" ) );
    TextLabel1->setText( tr2i18n( "Width:" ) );
    TextLabel2->setText( tr2i18n( "Height:" ) );
    TQToolTip::add( widthInput, tr2i18n( "Width of the chosen paper size in portrait orientation" ) );
    TQToolTip::add( heightInput, tr2i18n( "Height of the chosen paper size in portrait orientation" ) );
    heightUnits->clear();
    heightUnits->insertItem( tr2i18n( "cm" ) );
    heightUnits->insertItem( tr2i18n( "mm" ) );
    heightUnits->insertItem( tr2i18n( "in" ) );
    widthUnits->clear();
    widthUnits->insertItem( tr2i18n( "cm" ) );
    widthUnits->insertItem( tr2i18n( "mm" ) );
    widthUnits->insertItem( tr2i18n( "in" ) );
    TextLabel4->setText( tr2i18n( "Orientation:" ) );
    orientationChoice->clear();
    orientationChoice->insertItem( tr2i18n( "Portrait" ) );
    orientationChoice->insertItem( tr2i18n( "Landscape" ) );
    GroupBox6->setTitle( tr2i18n( "Page Preview" ) );
}

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

TQMetaObject *pageSizeWidget_base::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_pageSizeWidget_base( "pageSizeWidget_base", &pageSizeWidget_base::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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