• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • khtml
 

khtml

  • khtml
khtml_printsettings.cpp
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 <klocale.h>
23 #include <tqcheckbox.h>
24 #include <tqlayout.h>
25 #include <tqwhatsthis.h>
26 
27 KHTMLPrintSettings::KHTMLPrintSettings(TQWidget *parent, const char *name)
28 : KPrintDialogPage(parent, name)
29 {
30  //WhatsThis strings.... (added by pfeifle@kde.org)
31  TQString 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  TQString 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  TQString 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 slower and will "
68  "certainly use much more toner or ink."
69  "</p>"
70  " </qt>" );
71  setTitle(i18n("HTML Settings"));
72 
73  m_printfriendly = new TQCheckBox(i18n("Printer friendly mode (black text, no background)"), this);
74  TQWhatsThis::add(m_printfriendly, whatsThisPrinterFriendlyMode);
75  m_printfriendly->setChecked(true);
76  m_printimages = new TQCheckBox(i18n("Print images"), this);
77  TQWhatsThis::add(m_printimages, whatsThisPrintImages);
78  m_printimages->setChecked(true);
79  m_printheader = new TQCheckBox(i18n("Print header"), this);
80  TQWhatsThis::add(m_printheader, whatsThisPrintHeader);
81  m_printheader->setChecked(true);
82 
83  TQVBoxLayout *l0 = new TQVBoxLayout(this, 0, 10);
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 void KHTMLPrintSettings::getOptions(TQMap<TQString,TQString>& opts, bool /*incldef*/)
95 {
96  opts["app-khtml-printfriendly"] = (m_printfriendly->isChecked() ? "true" : "false");
97  opts["app-khtml-printimages"] = (m_printimages->isChecked() ? "true" : "false");
98  opts["app-khtml-printheader"] = (m_printheader->isChecked() ? "true" : "false");
99 }
100 
101 void KHTMLPrintSettings::setOptions(const TQMap<TQString,TQString>& opts)
102 {
103  m_printfriendly->setChecked(opts["app-khtml-printfriendly"] != "false");
104  m_printimages->setChecked(opts["app-khtml-printimages"] != "false");
105  m_printheader->setChecked(opts["app-khtml-printheader"] != "false");
106 }
107 
108 #include "khtml_printsettings.moc"
klocale.h

khtml

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

khtml

Skip menu "khtml"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for khtml by doxygen 1.8.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |