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

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

#include "printdialogpagebase.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <knuminput.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

    textLabel1 = new TQLabel( this, "textLabel1" );
    layout2->addWidget( textLabel1 );

    mPosition = new KComboBox( false, this, "mPosition" );
    layout2->addWidget( mPosition );
    spacer1 = new TQSpacerItem( 101, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout2->addItem( spacer1 );
    PrintDialogPageBaseLayout->addLayout( layout2 );

    mAddFileName = new TQCheckBox( this, "mAddFileName" );
    mAddFileName->setChecked( true );
    PrintDialogPageBaseLayout->addWidget( mAddFileName );

    mAddComment = new TQCheckBox( this, "mAddComment" );
    PrintDialogPageBaseLayout->addWidget( mAddComment );

    mScaleGroup = new TQButtonGroup( this, "mScaleGroup" );
    mScaleGroup->setColumnLayout(0, TQt::Vertical );
    mScaleGroup->layout()->setSpacing( 6 );
    mScaleGroup->layout()->setMargin( 11 );
    mScaleGroupLayout = new TQVBoxLayout( mScaleGroup->layout() );
    mScaleGroupLayout->setAlignment( TQt::AlignTop );

    mNoScale = new TQRadioButton( mScaleGroup, "mNoScale" );
    mNoScale->setChecked( true );
    mScaleGroup->insert( mNoScale, 1 );
    mScaleGroupLayout->addWidget( mNoScale );

    mFitToPage = new TQRadioButton( mScaleGroup, "mFitToPage" );
    mFitToPage->setChecked( false );
    mScaleGroup->insert( mFitToPage, 2 );
    mScaleGroupLayout->addWidget( mFitToPage );

    layout4 = new TQHBoxLayout( 0, 0, 6, "layout4"); 
    spacer4 = new TQSpacerItem( 20, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    layout4->addItem( spacer4 );

    mEnlargeToFit = new TQCheckBox( mScaleGroup, "mEnlargeToFit" );
    mEnlargeToFit->setEnabled( false );
    layout4->addWidget( mEnlargeToFit );
    spacer6 = new TQSpacerItem( 240, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout4->addItem( spacer6 );
    mScaleGroupLayout->addLayout( layout4 );

    mScale = new TQRadioButton( mScaleGroup, "mScale" );
    mScaleGroup->insert( mScale, 3 );
    mScaleGroupLayout->addWidget( mScale );

    layout4_2 = new TQHBoxLayout( 0, 0, 6, "layout4_2"); 
    spacer4_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    layout4_2->addItem( spacer4_2 );

    mWidth = new KDoubleSpinBox( mScaleGroup, "mWidth" );
    mWidth->setEnabled( false );
    mWidth->setMaxValue( 1e+06 );
    mWidth->setLineStep( 1 );
    mWidth->setAcceptLocalizedNumbers( false );
    mWidth->setPrecision( 2 );
    layout4_2->addWidget( mWidth );

    textLabel2 = new TQLabel( mScaleGroup, "textLabel2" );
    layout4_2->addWidget( textLabel2 );

    mHeight = new KDoubleSpinBox( mScaleGroup, "mHeight" );
    mHeight->setEnabled( false );
    mHeight->setMaxValue( 1e+06 );
    mHeight->setLineStep( 1 );
    mHeight->setAcceptLocalizedNumbers( false );
    mHeight->setPrecision( 2 );
    layout4_2->addWidget( mHeight );

    mUnit = new KComboBox( false, mScaleGroup, "mUnit" );
    mUnit->setEnabled( false );
    layout4_2->addWidget( mUnit );

    mKeepRatio = new TQCheckBox( mScaleGroup, "mKeepRatio" );
    mKeepRatio->setEnabled( false );
    layout4_2->addWidget( mKeepRatio );
    spacer2 = new TQSpacerItem( 16, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout4_2->addItem( spacer2 );
    mScaleGroupLayout->addLayout( layout4_2 );
    PrintDialogPageBaseLayout->addWidget( mScaleGroup );
    languageChange();
    resize( TQSize(511, 260).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( mScale, TQ_SIGNAL( toggled(bool) ), mUnit, TQ_SLOT( setEnabled(bool) ) );
    connect( mScale, TQ_SIGNAL( toggled(bool) ), mKeepRatio, TQ_SLOT( setEnabled(bool) ) );
    connect( mFitToPage, TQ_SIGNAL( toggled(bool) ), mEnlargeToFit, TQ_SLOT( setEnabled(bool) ) );
    connect( mScale, TQ_SIGNAL( toggled(bool) ), mWidth, TQ_SLOT( setEnabled(bool) ) );
    connect( mScale, TQ_SIGNAL( toggled(bool) ), mHeight, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void PrintDialogPageBase::languageChange()
{
    setCaption( tr2i18n( "Image Settings" ) );
    textLabel1->setText( tr2i18n( "Image position:" ) );
    mPosition->clear();
    mPosition->insertItem( tr2i18n( "Top-Left" ) );
    mPosition->insertItem( tr2i18n( "Top-Central" ) );
    mPosition->insertItem( tr2i18n( "Top-Right" ) );
    mPosition->insertItem( tr2i18n( "Central-Left" ) );
    mPosition->insertItem( tr2i18n( "Central" ) );
    mPosition->insertItem( tr2i18n( "Central-Right" ) );
    mPosition->insertItem( tr2i18n( "Bottom-Left" ) );
    mPosition->insertItem( tr2i18n( "Bottom-Central" ) );
    mPosition->insertItem( tr2i18n( "Bottom-Right" ) );
    mAddFileName->setText( tr2i18n( "Print fi&lename below image" ) );
    mAddComment->setText( tr2i18n( "Print image comment" ) );
    mScaleGroup->setTitle( tr2i18n( "Scaling" ) );
    mNoScale->setText( tr2i18n( "&No scaling" ) );
    mFitToPage->setText( tr2i18n( "&Fit image to page" ) );
    mEnlargeToFit->setText( tr2i18n( "Enlarge smaller images" ) );
    mScale->setText( tr2i18n( "&Scale to:" ) );
    textLabel2->setText( tr2i18n( "x" ) );
    mUnit->clear();
    mUnit->insertItem( tr2i18n( "Millimeters" ) );
    mUnit->insertItem( tr2i18n( "Centimeters" ) );
    mUnit->insertItem( tr2i18n( "Inches" ) );
    mKeepRatio->setText( tr2i18n( "Keep ratio" ) );
}

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

TQMetaObject *PrintDialogPageBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_PrintDialogPageBase( "PrintDialogPageBase", &PrintDialogPageBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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