1 | /* |
2 | * This file is part of the KDE libraries |
3 | * Copyright (c) 2002 Michael Goffioul <kdeprint@swing.be> |
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 <kdialog.h> |
23 | #include <klocale.h> |
24 | #include <QtGui/QCheckBox> |
25 | #include <QtGui/QLayout> |
26 | |
27 | KHTMLPrintSettings::KHTMLPrintSettings(QWidget *parent) |
28 | : QWidget(parent) |
29 | { |
30 | //WhatsThis strings.... (added by pfeifle@kde.org) |
31 | QString whatsThisPrintImages = i18n( "<qt>" |
32 | "<p><strong>'Print images'</strong></p>" |
33 | "<p>" |
34 | "If this checkbox is enabled, images contained in the HTML page will " |
35 | "be printed. Printing may take longer and use more ink or toner." |
36 | "</p>" |
37 | "<p>" |
38 | "If this checkbox is disabled, only the text of the HTML page will be " |
39 | "printed, without the included images. Printing will be faster and use " |
40 | "less ink or toner." |
41 | "</p>" |
42 | " </qt>" ); |
43 | QString = i18n( "<qt>" |
44 | "<p><strong>'Print header'</strong></p>" |
45 | "<p>" |
46 | "If this checkbox is enabled, the printout of the HTML document will " |
47 | "contain a header line at the top of each page. This header contains " |
48 | "the current date, the location URL of the printed page and the page " |
49 | "number." |
50 | "</p>" |
51 | "<p>" |
52 | "If this checkbox is disabled, the printout of the HTML document will " |
53 | "not contain such a header line." |
54 | "</p>" |
55 | " </qt>" ); |
56 | QString whatsThisPrinterFriendlyMode = i18n( "<qt>" |
57 | "<p><strong>'Printerfriendly mode'</strong></p>" |
58 | "<p>" |
59 | "If this checkbox is enabled, the printout of the HTML document will " |
60 | "be black and white only, and all colored background will be converted " |
61 | "into white. Printout will be faster and use less ink or toner." |
62 | "</p>" |
63 | "<p>" |
64 | "If this checkbox is disabled, the printout of the HTML document will " |
65 | "happen in the original color settings as you see in your application. " |
66 | "This may result in areas of full-page color (or grayscale, if you use " |
67 | "a black+white printer). Printout will possibly happen more slowly and " |
68 | "will probably use more toner or ink." |
69 | "</p>" |
70 | " </qt>" ); |
71 | setWindowTitle(i18n("HTML Settings" )); |
72 | |
73 | m_printfriendly = new QCheckBox(i18n("Printer friendly mode (black text, no background)" ), this); |
74 | m_printfriendly->setWhatsThis(whatsThisPrinterFriendlyMode); |
75 | m_printfriendly->setChecked(true); |
76 | m_printimages = new QCheckBox(i18n("Print images" ), this); |
77 | m_printimages->setWhatsThis(whatsThisPrintImages); |
78 | m_printimages->setChecked(true); |
79 | m_printheader = new QCheckBox(i18n("Print header" ), this); |
80 | m_printheader->setWhatsThis(whatsThisPrintHeader); |
81 | m_printheader->setChecked(true); |
82 | |
83 | QVBoxLayout *l0 = new QVBoxLayout(this); |
84 | l0->addWidget(m_printfriendly); |
85 | l0->addWidget(m_printimages); |
86 | l0->addWidget(m_printheader); |
87 | l0->addStretch(1); |
88 | } |
89 | |
90 | KHTMLPrintSettings::~KHTMLPrintSettings() |
91 | { |
92 | } |
93 | |
94 | bool KHTMLPrintSettings::printFriendly() |
95 | { |
96 | return m_printfriendly->isChecked(); |
97 | } |
98 | |
99 | bool KHTMLPrintSettings::printImages() |
100 | { |
101 | return m_printimages->isChecked(); |
102 | } |
103 | |
104 | bool KHTMLPrintSettings::() |
105 | { |
106 | return m_printheader->isChecked(); |
107 | } |
108 | |
109 | |
110 | #include "khtml_printsettings.moc" |
111 | |