• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KHTML

  • sources
  • kde-4.14
  • kdelibs
  • khtml
khtml_printsettings.cpp
Go to the documentation of this file.
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 whatsThisPrintHeader = 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::printHeader()
105 {
106  return m_printheader->isChecked();
107 }
108 
109 
110 #include "khtml_printsettings.moc"
kdialog.h
i18n
QString i18n(const char *text)
QWidget
KHTMLPrintSettings::printImages
bool printImages()
Definition: khtml_printsettings.cpp:99
klocale.h
khtml_printsettings.h
QBoxLayout::addWidget
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
KHTMLPrintSettings::printHeader
bool printHeader()
Definition: khtml_printsettings.cpp:104
QCheckBox
KHTMLPrintSettings::printFriendly
bool printFriendly()
Definition: khtml_printsettings.cpp:94
QVBoxLayout
KHTMLPrintSettings::~KHTMLPrintSettings
~KHTMLPrintSettings()
Definition: khtml_printsettings.cpp:90
QString
KHTMLPrintSettings::KHTMLPrintSettings
KHTMLPrintSettings(QWidget *parent=0)
Definition: khtml_printsettings.cpp:27
QAbstractButton::setChecked
void setChecked(bool)
QWidget::setWhatsThis
void setWhatsThis(const QString &)
QBoxLayout::addStretch
void addStretch(int stretch)
QWidget::setWindowTitle
void setWindowTitle(const QString &)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:26:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal