KHTML
khtml_printsettings.cpp
Go to the documentation of this file.
00001 /* 00002 * This file is part of the KDE libraries 00003 * Copyright (c) 2002 Michael Goffioul <kdeprint@swing.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., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 **/ 00019 00020 #include "khtml_printsettings.h" 00021 00022 #include <kdialog.h> 00023 #include <klocale.h> 00024 #include <QtGui/QCheckBox> 00025 #include <QtGui/QLayout> 00026 00027 KHTMLPrintSettings::KHTMLPrintSettings(QWidget *parent) 00028 : QWidget(parent) 00029 { 00030 //WhatsThis strings.... (added by pfeifle@kde.org) 00031 QString whatsThisPrintImages = i18n( "<qt>" 00032 "<p><strong>'Print images'</strong></p>" 00033 "<p>" 00034 "If this checkbox is enabled, images contained in the HTML page will " 00035 "be printed. Printing may take longer and use more ink or toner." 00036 "</p>" 00037 "<p>" 00038 "If this checkbox is disabled, only the text of the HTML page will be " 00039 "printed, without the included images. Printing will be faster and use " 00040 "less ink or toner." 00041 "</p>" 00042 " </qt>" ); 00043 QString whatsThisPrintHeader = i18n( "<qt>" 00044 "<p><strong>'Print header'</strong></p>" 00045 "<p>" 00046 "If this checkbox is enabled, the printout of the HTML document will " 00047 "contain a header line at the top of each page. This header contains " 00048 "the current date, the location URL of the printed page and the page " 00049 "number." 00050 "</p>" 00051 "<p>" 00052 "If this checkbox is disabled, the printout of the HTML document will " 00053 "not contain such a header line." 00054 "</p>" 00055 " </qt>" ); 00056 QString whatsThisPrinterFriendlyMode = i18n( "<qt>" 00057 "<p><strong>'Printerfriendly mode'</strong></p>" 00058 "<p>" 00059 "If this checkbox is enabled, the printout of the HTML document will " 00060 "be black and white only, and all colored background will be converted " 00061 "into white. Printout will be faster and use less ink or toner." 00062 "</p>" 00063 "<p>" 00064 "If this checkbox is disabled, the printout of the HTML document will " 00065 "happen in the original color settings as you see in your application. " 00066 "This may result in areas of full-page color (or grayscale, if you use " 00067 "a black+white printer). Printout will possibly happen more slowly and " 00068 "will probably use more toner or ink." 00069 "</p>" 00070 " </qt>" ); 00071 setWindowTitle(i18n("HTML Settings")); 00072 00073 m_printfriendly = new QCheckBox(i18n("Printer friendly mode (black text, no background)"), this); 00074 m_printfriendly->setWhatsThis(whatsThisPrinterFriendlyMode); 00075 m_printfriendly->setChecked(true); 00076 m_printimages = new QCheckBox(i18n("Print images"), this); 00077 m_printimages->setWhatsThis(whatsThisPrintImages); 00078 m_printimages->setChecked(true); 00079 m_printheader = new QCheckBox(i18n("Print header"), this); 00080 m_printheader->setWhatsThis(whatsThisPrintHeader); 00081 m_printheader->setChecked(true); 00082 00083 QVBoxLayout *l0 = new QVBoxLayout(this); 00084 l0->addWidget(m_printfriendly); 00085 l0->addWidget(m_printimages); 00086 l0->addWidget(m_printheader); 00087 l0->addStretch(1); 00088 } 00089 00090 KHTMLPrintSettings::~KHTMLPrintSettings() 00091 { 00092 } 00093 00094 bool KHTMLPrintSettings::printFriendly() 00095 { 00096 return m_printfriendly->isChecked(); 00097 } 00098 00099 bool KHTMLPrintSettings::printImages() 00100 { 00101 return m_printimages->isChecked(); 00102 } 00103 00104 bool KHTMLPrintSettings::printHeader() 00105 { 00106 return m_printheader->isChecked(); 00107 } 00108 00109 00110 #include "khtml_printsettings.moc"
KDE 4.6 API Reference