/*
 *  This file is part of the KDE libraries
 *  Copyright (c) 2005 Helge Deller <deller@kde.org>
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public
 *  License version 2 as published by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public License
 *  along with this library; see the file COPYING.LIB.  If not, write to
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 *  Boston, MA 02110-1301, USA.
 **/

#include "kfax_printsettings.h"

#include <klocale.h>
#include <qcheckbox.h>
#include <qlayout.h>
#include <QWhatsThis>
//Added by qt3to4:
#include <QVBoxLayout>

KFAXPrintSettings::KFAXPrintSettings(QWidget *parent)
: QWidget(parent)
{
	QString whatsThisScaleFullPage = i18n( "<qt>"
		"<p><strong>'Ignore Paper Margins'</strong></p>"
		"<p>"
		"If this checkbox is enabled, the paper margins will be ignored "
		"and the fax will be printed on the full paper size."
		"</p>"
		"<p>"
		"If this checkbox is disabled, KFax will respect the standard paper "
		"margins and print the fax inside this printable area."
		"</p>"
						" </qt>" );
	QString whatsThisCenterHorz = i18n( "<qt>"
		"<p><strong>'Horizontal centered'</strong></p>"
		"<p>"
		"If this checkbox is enabled, the fax will be centered horizontally "
		"on the page."
		"</p>"
		"<p>"
		"If this checkbox is disabled, the fax will be printed at the left "
		"side of the page."
		"</p>"
						" </qt>" );
	QString whatsThisCenterVert = i18n( "<qt>"
		"<p><strong>'Vertical centered'</strong></p>"
		"<p>"
		"If this checkbox is enabled, the fax will be centered vertically "
		"on the page."
		"</p>"
		"<p>"
		"If this checkbox is disabled, the fax will be printed at the top "
		"of the page."
		"</p>"
						" </qt>" );

	setWindowTitle(i18n("&Layout"));

	m_scaleFullPage = new QCheckBox(i18n("Ignore paper margins"), this);
	m_scaleFullPage->setWhatsThis(whatsThisScaleFullPage);
	m_center_horz = new QCheckBox(i18n("Horizontal centered"), this);
	m_center_horz->setWhatsThis(whatsThisCenterHorz);
	m_center_vert = new QCheckBox(i18n("Vertical centered"), this);
	m_center_vert->setWhatsThis(whatsThisCenterVert);

	QVBoxLayout *l0 = new QVBoxLayout(this);
	l0->setSpacing(10);
	l0->setMargin(0);
	l0->addWidget(m_scaleFullPage);
	l0->addWidget(m_center_horz);
	l0->addWidget(m_center_vert);
	l0->addStretch(1);
}

KFAXPrintSettings::~KFAXPrintSettings()
{
}

bool KFAXPrintSettings::printScaleFullPage()
{
	return m_scaleFullPage->isChecked();
}

void KFAXPrintSettings::setPrintScaleFullPage( bool scaleFullPage )
{
	m_scaleFullPage->setChecked( scaleFullPage );
}

bool KFAXPrintSettings::printCenterHorz()
{
	return m_center_horz->isChecked();
}

void KFAXPrintSettings::setPrintCenterHorz( bool centerHorz )
{
	m_center_horz->setChecked( centerHorz );
}

bool KFAXPrintSettings::printCenterVert()
{
	return m_center_vert->isChecked();
}

void KFAXPrintSettings::setPrintCenterVert( bool centerVert )
{
	m_center_vert->setChecked( centerVert );
}

#include "kfax_printsettings.moc"
