khtml Library API Documentation

khtml_printsettings.cpp

00001 /* 00002 * This file is part of the KDE libraries 00003 * Copyright (c) 2002 Michael Goffioul <goffioul@imec.be> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License version 2 as published by the Free Software Foundation. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this library; see the file COPYING.LIB. If not, write to 00016 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00017 * Boston, MA 02111-1307, USA. 00018 **/ 00019 00020 #include "khtml_printsettings.h" 00021 00022 #include <klocale.h> 00023 #include <qcheckbox.h> 00024 #include <qlayout.h> 00025 00026 KHTMLPrintSettings::KHTMLPrintSettings(QWidget *parent, const char *name) 00027 : KPrintDialogPage(parent, name) 00028 { 00029 setTitle(i18n("HTML Settings")); 00030 00031 m_printfriendly = new QCheckBox(i18n("Printer friendly mode (black text, no background)"), this); 00032 m_printfriendly->setChecked(true); 00033 m_printimages = new QCheckBox(i18n("Print images"), this); 00034 m_printimages->setChecked(true); 00035 m_printheader = new QCheckBox(i18n("Print header"), this); 00036 m_printheader->setChecked(true); 00037 00038 QVBoxLayout *l0 = new QVBoxLayout(this, 0, 10); 00039 l0->addWidget(m_printfriendly); 00040 l0->addWidget(m_printimages); 00041 l0->addWidget(m_printheader); 00042 l0->addStretch(1); 00043 } 00044 00045 KHTMLPrintSettings::~KHTMLPrintSettings() 00046 { 00047 } 00048 00049 void KHTMLPrintSettings::getOptions(QMap<QString,QString>& opts, bool /*incldef*/) 00050 { 00051 opts["app-khtml-printfriendly"] = (m_printfriendly->isChecked() ? "true" : "false"); 00052 opts["app-khtml-printimages"] = (m_printimages->isChecked() ? "true" : "false"); 00053 opts["app-khtml-printheader"] = (m_printheader->isChecked() ? "true" : "false"); 00054 } 00055 00056 void KHTMLPrintSettings::setOptions(const QMap<QString,QString>& opts) 00057 { 00058 m_printfriendly->setChecked(opts["app-khtml-printfriendly"] != "false"); 00059 m_printimages->setChecked(opts["app-khtml-printimages"] != "false"); 00060 m_printheader->setChecked(opts["app-khtml-printheader"] != "false"); 00061 } 00062 00063 #include "khtml_printsettings.moc"
KDE Logo
This file is part of the documentation for khtml Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 10 18:56:13 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003