KHTML
khtml_printsettings.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
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 slower and will "
00068 "certainly use much 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->setMargin(KDialog::marginHint());
00085 l0->setSpacing(KDialog::spacingHint());
00086 l0->addWidget(m_printfriendly);
00087 l0->addWidget(m_printimages);
00088 l0->addWidget(m_printheader);
00089 l0->addStretch(1);
00090 }
00091
00092 KHTMLPrintSettings::~KHTMLPrintSettings()
00093 {
00094 }
00095
00096 bool KHTMLPrintSettings::printFriendly()
00097 {
00098 return m_printfriendly->isChecked();
00099 }
00100
00101 bool KHTMLPrintSettings::printImages()
00102 {
00103 return m_printimages->isChecked();
00104 }
00105
00106 bool KHTMLPrintSettings::printHeader()
00107 {
00108 return m_printheader->isChecked();
00109 }
00110
00111
00112 #include "khtml_printsettings.moc"