KHtml

khtml_printsettings.cpp
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (c) 2002 Michael Goffioul <[email protected]>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License version 2 as published by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB. If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  **/
19 
20 #include "khtml_printsettings.h"
21 
22 #include <klocalizedstring.h>
23 #include <QCheckBox>
24 #include <QLayout>
25 
26 KHTMLPrintSettings::KHTMLPrintSettings(QWidget *parent)
27  : QWidget(parent)
28 {
29  //WhatsThis strings.... (added by [email protected])
30  QString whatsThisPrintImages = i18n("<qt>"
31  "<p><strong>'Print images'</strong></p>"
32  "<p>"
33  "If this checkbox is enabled, images contained in the HTML page will "
34  "be printed. Printing may take longer and use more ink or toner."
35  "</p>"
36  "<p>"
37  "If this checkbox is disabled, only the text of the HTML page will be "
38  "printed, without the included images. Printing will be faster and use "
39  "less ink or toner."
40  "</p>"
41  " </qt>");
42  QString whatsThisPrintHeader = i18n("<qt>"
43  "<p><strong>'Print header'</strong></p>"
44  "<p>"
45  "If this checkbox is enabled, the printout of the HTML document will "
46  "contain a header line at the top of each page. This header contains "
47  "the current date, the location URL of the printed page and the page "
48  "number."
49  "</p>"
50  "<p>"
51  "If this checkbox is disabled, the printout of the HTML document will "
52  "not contain such a header line."
53  "</p>"
54  " </qt>");
55  QString whatsThisPrinterFriendlyMode = i18n("<qt>"
56  "<p><strong>'Printerfriendly mode'</strong></p>"
57  "<p>"
58  "If this checkbox is enabled, the printout of the HTML document will "
59  "be black and white only, and all colored background will be converted "
60  "into white. Printout will be faster and use less ink or toner."
61  "</p>"
62  "<p>"
63  "If this checkbox is disabled, the printout of the HTML document will "
64  "happen in the original color settings as you see in your application. "
65  "This may result in areas of full-page color (or grayscale, if you use "
66  "a black+white printer). Printout will possibly happen more slowly and "
67  "will probably use more toner or ink."
68  "</p>"
69  " </qt>");
70  setWindowTitle(i18n("HTML Settings"));
71 
72  m_printfriendly = new QCheckBox(i18n("Printer friendly mode (black text, no background)"), this);
73  m_printfriendly->setWhatsThis(whatsThisPrinterFriendlyMode);
74  m_printfriendly->setChecked(true);
75  m_printimages = new QCheckBox(i18n("Print images"), this);
76  m_printimages->setWhatsThis(whatsThisPrintImages);
77  m_printimages->setChecked(true);
78  m_printheader = new QCheckBox(i18n("Print header"), this);
79  m_printheader->setWhatsThis(whatsThisPrintHeader);
80  m_printheader->setChecked(true);
81 
82  QVBoxLayout *l0 = new QVBoxLayout(this);
83  l0->addWidget(m_printfriendly);
84  l0->addWidget(m_printimages);
85  l0->addWidget(m_printheader);
86  l0->addStretch(1);
87 }
88 
89 KHTMLPrintSettings::~KHTMLPrintSettings()
90 {
91 }
92 
93 bool KHTMLPrintSettings::printFriendly()
94 {
95  return m_printfriendly->isChecked();
96 }
97 
98 bool KHTMLPrintSettings::printImages()
99 {
100  return m_printimages->isChecked();
101 }
102 
103 bool KHTMLPrintSettings::printHeader()
104 {
105  return m_printheader->isChecked();
106 }
107 
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
QString i18n(const char *text, const TYPE &arg...)
void addStretch(int stretch)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 25 2021 22:48:17 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.