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

tdeprint

  • tdeprint
  • cups
kphpgl2page.cpp
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (c) 2001 Michael Goffioul <tdeprint@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 "kphpgl2page.h"
21 
22 #include <tqcheckbox.h>
23 #include <tqgroupbox.h>
24 #include <tqlayout.h>
25 #include <tqwhatsthis.h>
26 #include <tdelocale.h>
27 #include <knuminput.h>
28 
29 KPHpgl2Page::KPHpgl2Page(TQWidget *parent, const char *name)
30 : KPrintDialogPage(parent, name)
31 {
32  //WhatsThis strings.... (added by pfeifle@kde.org)
33  TQString whatsThisBlackplotHpgl2Page = i18n( " <qt> "
34  " <b>Print in Black Only (Blackplot)</b> "
35  " <p>The \'blackplot\' option specifies that all pens should plot in black-only:"
36  " The default is to use the colors defined in the plot file, or the standard "
37  " pen colors defined in the HP-GL/2 reference manual from Hewlett Packard. </p> "
38  " <br> "
39  " <hr> "
40  " <p><em><b>Additional hint for power users:</b> This TDEPrint GUI element matches "
41  " with the CUPS commandline job option parameter:</em> "
42  " <pre>"
43  " -o blackplot=true "
44  " </pre> "
45  " </p> "
46  " </qt>" );
47 
48  TQString whatsThisFitplotHpgl2Page = i18n( " <qt> "
49  " <b>Scale Print Image to Page Size</b> "
50  " <p>The 'fitplot' option specifies that the HP-GL image should be scaled to fill "
51  " exactly the page with the (elsewhere selected) media size. </p> "
52  " <p>The default is 'fitplot is disabled'. The default will therefore use the absolute "
53  " distances specified in the plot file. (You should be aware that HP-GL files are very "
54  " often CAD drawings intended for large format plotters. On standard office printers "
55  " they will therefore lead to the drawing printout being spread across multiple pages.) </p> "
56  " <p><b>Note:</b>This feature depends upon an accurate plot size (PS) command in the "
57  " HP-GL/2 file. If no plot size is given in the file the filter converting the HP-GL "
58  " to PostScript assumes the plot is ANSI E size. </p> "
59  " <br> "
60  " <hr> "
61  " <p><em><b>Additional hint for power users:</b> This TDEPrint GUI element matches with the CUPS commandline job option parameter:</em> "
62  " <pre> "
63  " -o fitplot=true "
64  " </pre>"
65  " </p> "
66  " </qt>" );
67 
68  TQString whatsThisPenwidthHpgl2Page = i18n( " <qt> "
69  " <b>Set Pen Width for HP-GL (if not defined in file)</b>. "
70  " <p>The pen width value can be set here in case the original HP-GL file does not have it "
71  " set. The pen width specifies the value in micrometers. The default value of 1000 produces "
72  " lines that are 1000 micrometers == 1 millimeter in width. Specifying a pen width of 0 "
73  " produces lines that are exactly 1 pixel wide. </p> "
74  " <p><b>Note:</b> The penwidth option set here is ignored if the pen widths are set inside "
75  " the plot file itself..</p> "
76  " <br> "
77  " <hr> "
78  " <p><em><b>Additional hint for power users:</b> This TDEPrint GUI element matches with the CUPS commandline job option parameter:</em> "
79  " <pre>"
80  " -o penwidth=... # example: \"2000\" or \"500\" "
81  " </pre>"
82  " </p> "
83  " </qt>" );
84 
85  TQString whatsThisAllOptionsHpgl2Page = i18n( " <qt> "
86  " <b>HP-GL Print Options</b> "
87  " <p>All options on this page are only applicable if you use TDEPrint to send HP-GL and "
88  " HP-GL/2 files to one of your printers. </p> "
89  " <p>HP-GL and HP-GL/2 are page description languages developed by Hewlett-Packard to drive "
90  " Pen Plotting devices. </p> "
91  " <p>TDEPrint can (with the help of CUPS) convert the HP-GL file format and print it "
92  " on any installed printer. </p> "
93  " <p><b>Note 1:</b> To print HP-GL files, start 'kprinter' and simply load the file into "
94  " the running kprinter.</p>"
95  " <p><b>Note 2:</b> The 'fitplot' parameter provided on this dialog does also work for "
96  " printing PDF files (if your CUPS version is more recent than 1.1.22).</p> "
97  " <br> "
98  " <hr> "
99  " <p><em><b>Additional hint for power users:</b> These TDEPrint GUI elements match with CUPS commandline job option parameters:</em> "
100  " <pre>"
101  " -o blackplot=... # examples: \"true\" or \"false\" "
102  " <br> "
103  " -o fitplot=... # examples: \"true\" or \"false\" "
104  " <br> "
105  " -o penwidth=... # examples: \"true\" or \"false\" "
106  " </pre>"
107  " </p> "
108  " </qt>" );
109 
110 
111  setTitle("HP-GL/2");
112 
113  TQGroupBox *box = new TQGroupBox(0, Qt::Vertical, i18n("HP-GL/2 Options"), this);
114 
115  m_blackplot = new TQCheckBox(i18n("&Use only black pen"), box);
116  TQWhatsThis::add(m_blackplot, whatsThisBlackplotHpgl2Page);
117 
118  m_fitplot = new TQCheckBox(i18n("&Fit plot to page"), box);
119  TQWhatsThis::add(m_fitplot, whatsThisFitplotHpgl2Page);
120 
121  m_penwidth = new KIntNumInput(1000, box);
122  m_penwidth->setLabel(i18n("&Pen width:"), Qt::AlignLeft|Qt::AlignVCenter);
123  m_penwidth->setSuffix(" [um]");
124  m_penwidth->setRange(0, 10000, 100, true);
125  TQWhatsThis::add(m_penwidth, whatsThisPenwidthHpgl2Page);
126 
127  TQVBoxLayout *l0 = new TQVBoxLayout(this, 0, 10);
128  l0->addWidget(box);
129  l0->addStretch(1);
130 
131  TQVBoxLayout *l1 = new TQVBoxLayout(TQT_TQLAYOUT(box->layout()), 10);
132  l1->addWidget(m_blackplot);
133  l1->addWidget(m_fitplot);
134  l1->addWidget(m_penwidth);
135  TQWhatsThis::add(this, whatsThisAllOptionsHpgl2Page);
136 }
137 
138 KPHpgl2Page::~KPHpgl2Page()
139 {
140 }
141 
142 void KPHpgl2Page::setOptions(const TQMap<TQString,TQString>& opts)
143 {
144  TQString value;
145  if (opts.contains("blackplot") && ((value=opts["blackplot"]).isEmpty() || value == "true"))
146  m_blackplot->setChecked(true);
147  if (opts.contains("fitplot") && ((value=opts["fitplot"]).isEmpty() || value == "true"))
148  m_fitplot->setChecked(true);
149  if (!(value=opts["penwidth"]).isEmpty())
150  m_penwidth->setValue(value.toInt());
151 }
152 
153 void KPHpgl2Page::getOptions(TQMap<TQString,TQString>& opts, bool incldef)
154 {
155  if (incldef || m_penwidth->value() != 1000)
156  opts["penwidth"] = TQString::number(m_penwidth->value());
157  if (m_blackplot->isChecked())
158  opts["blackplot"] = "true";
159  else if (incldef)
160  opts["blackplot"] = "false";
161  else
162  opts.remove("blackplot");
163  if (m_fitplot->isChecked())
164  opts["fitplot"] = "true";
165  else if (incldef)
166  opts["fitplot"] = "false";
167  else
168  opts.remove("fitplot");
169 }
KPrintDialogPage
This class is intended to be used as base class for customized print dialog page. ...
Definition: kprintdialogpage.h:90

tdeprint

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

tdeprint

Skip menu "tdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.8.8
This website is maintained by Timothy Pearson.