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

tdeprint

  • tdeprint
kprinter.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 <config.h>
21 
22 #include "kprinter.h"
23 #include "kprinterimpl.h"
24 #include "kprintdialog.h"
25 #include "kprintpreview.h"
26 #include "kmfactory.h"
27 #include "kmuimanager.h"
28 #include "kmmanager.h"
29 #include "driver.h"
30 
31 #include <tqpaintdevicemetrics.h>
32 #include <tqfile.h>
33 #include <tqtl.h>
34 #include <tqdir.h>
35 #include <tqguardedptr.h>
36 #include <tdeapplication.h>
37 #include <kstandarddirs.h>
38 #include <tdeglobal.h>
39 #include <tdeconfig.h>
40 #include <krun.h>
41 #include <knotifyclient.h>
42 #include <kdebug.h>
43 #include <tdelocale.h>
44 #include <kprocess.h>
45 #include <klibloader.h>
46 #include <tdemessagebox.h>
47 
48 static void dumpOptions(const TQMap<TQString,TQString>& opts);
49 static void reportError(KPrinter*);
50 
51 //**************************************************************************************
52 // KPrinterWrapper class
53 //**************************************************************************************
54 
55 class KPrinterWrapper : public TQPrinter
56 {
57 friend class KPrinter;
58 public:
59  KPrinterWrapper(KPrinter*, PrinterMode m = ScreenResolution);
60  ~KPrinterWrapper();
61 protected:
62  virtual bool cmd(int, TQPainter*, TQPDevCmdParam*);
63  virtual int metric(int) const;
64  int qprinterMetric(int) const;
65 private:
66  KPrinter *m_printer;
67 };
68 
69 KPrinterWrapper::KPrinterWrapper(KPrinter *prt, TQPrinter::PrinterMode m)
70 : TQPrinter(m), m_printer(prt)
71 {
72 }
73 
74 KPrinterWrapper::~KPrinterWrapper()
75 {
76 }
77 
78 bool KPrinterWrapper::cmd(int c, TQPainter *painter, TQPDevCmdParam *p)
79 {
80  return TQPrinter::cmd(c,painter,p);
81 }
82 
83 int KPrinterWrapper::metric(int m) const
84 {
85  return m_printer->metric(m);
86 }
87 
88 int KPrinterWrapper::qprinterMetric(int m) const
89 {
90  return TQPrinter::metric(m);
91 }
92 
93 //**************************************************************************************
94 // KPrinterPrivate class
95 //**************************************************************************************
96 
97 class KPrinterPrivate
98 {
99 public:
100  TQGuardedPtr<KPrinterImpl> m_impl;
101  bool m_restore;
102  bool m_previewonly;
103  WId m_parentId;
104  QString m_docfilename;
105  TQString m_docdirectory;
106  KPrinterWrapper *m_wrapper;
107  TQMap<TQString,TQString> m_options;
108  QString m_tmpbuffer;
109  QString m_printername;
110  QString m_searchname;
111  QString m_errormsg;
112  bool m_ready;
113  int m_pagenumber;
114  DrPageSize *m_pagesize;
115  bool m_useprinterres;
116  int m_defaultres;
117 };
118 
119 //**************************************************************************************
120 // KPrinter class
121 //**************************************************************************************
122 
123 KPrinter::KPrinter(bool restore, TQPrinter::PrinterMode m)
124 : TQPaintDevice(TQInternal::Printer|TQInternal::ExternalDevice)
125 {
126  init(restore, m);
127 }
128 
129 KPrinter::~KPrinter()
130 {
131  // delete Wrapper object
132  delete d->m_wrapper;
133 
134  // save current options
135  if (d->m_restore)
136  saveSettings();
137 
138  // delete private data (along any data allocated internally)
139  delete d->m_pagesize;
140  delete d;
141 }
142 
143 void KPrinter::init(bool restore, TQPrinter::PrinterMode m)
144 {
145  // Private data initialization
146  d = new KPrinterPrivate;
147  d->m_impl = KMFactory::self()->printerImplementation();
148  d->m_restore = restore;
149  d->m_previewonly = false;
150  d->m_parentId = 0;
151  d->m_pagesize = 0;
152 
153  // initialize TQPrinter wrapper
154  d->m_wrapper = new KPrinterWrapper(this, m);
155 
156  // other initialization
157  d->m_tmpbuffer = d->m_impl->tempFile();
158  d->m_ready = false;
159  d->m_defaultres = d->m_wrapper->resolution();
160  d->m_useprinterres = false;
161 
162  // reload options from implementation (static object)
163  if (d->m_restore)
164  loadSettings();
165 }
166 
167 void KPrinter::loadSettings()
168 {
169  d->m_options = d->m_impl->loadOptions();
170 
171  // load the last printer used in the current process (if any)
172  // and remove the corresponding entry in the option map, as it
173  // is not needed anymore
174  setSearchName(option("kde-searchname"));
175  d->m_options.remove("kde-searchname");
176 
177  TDEConfig *conf = TDEGlobal::config(), *pconf = KMFactory::self()->printConfig();
178  conf->setGroup("KPrinter Settings");
179  pconf->setGroup("General");
180 
181  // load latest used printer from config file, if required in the options
182  if (searchName().isEmpty() && pconf->readBoolEntry("UseLast", true))
183  setSearchName(conf->readEntry("Printer"));
184 
185  // latest used print command
186  setOption("kde-printcommand",conf->readPathEntry("PrintCommand"));
187 
188  // latest used document directory
189  setDocDirectory( conf->readPathEntry( "DocDirectory" ) );
190  setDocFileName( "print" );
191 }
192 
193 void KPrinter::saveSettings()
194 {
195  if (d->m_impl)
196  {
197  setOption("kde-searchname", searchName());
198  d->m_impl->saveOptions(d->m_options);
199  }
200 
201  // save latest used printer to config file
202  TDEConfig *conf = TDEGlobal::config();
203  conf->setGroup("KPrinter Settings");
204  conf->writeEntry("Printer",searchName());
205  // latest used print command
206  conf->writePathEntry("PrintCommand",option("kde-printcommand"));
207 
208  // latest used document directory
209  if ( d->m_docdirectory.isEmpty() )
210  {
211  KURL url( outputFileName() );
212  if ( url.isValid() )
213  conf->writePathEntry( "DocDirectory", url.directory() );
214  }
215  else
216  conf->writePathEntry( "DocDirectory", d->m_docdirectory );
217 }
218 
219 bool KPrinter::setup(TQWidget *parent, const TQString& caption, bool forceExpand)
220 {
221  if (!kapp->authorize("print/dialog"))
222  {
223  autoConfigure(TQString::null, parent);
224  return true; // Just print it
225  }
226 
227  if (parent)
228  d->m_parentId = parent->winId();
229 
230  KPrintDialog *dlg = KPrintDialog::printerDialog(this, parent, caption, forceExpand);
231  bool state = false;
232  if (dlg)
233  {
234  state = dlg->exec();
235  delete dlg;
236  }
237  return state;
238 }
239 
240 void KPrinter::addStandardPage(int p)
241 {
242  KMFactory::self()->settings()->standardDialogPages |= p;
243 }
244 
245 void KPrinter::removeStandardPage(int p)
246 {
247  KMFactory::self()->settings()->standardDialogPages &= (~p);
248 }
249 
250 void KPrinter::addDialogPage(KPrintDialogPage *page)
251 {
252  KMFactory::self()->uiManager()->addPrintDialogPage(page);
253 }
254 
255 void KPrinter::setPageSelection(PageSelectionType t)
256 {
257  KMFactory::self()->settings()->pageSelection = t;
258 }
259 
260 KPrinter::PageSelectionType KPrinter::pageSelection()
261 {
262  return (PageSelectionType)KMFactory::self()->settings()->pageSelection;
263 }
264 
265 void KPrinter::setApplicationType(ApplicationType t)
266 {
267  KMFactory::self()->settings()->application = t;
268 }
269 
270 KPrinter::ApplicationType KPrinter::applicationType()
271 {
272  return (ApplicationType)KMFactory::self()->settings()->application;
273 }
274 
275 bool KPrinter::cmd(int c, TQPainter *painter, TQPDevCmdParam *p)
276 {
277  bool value(true);
278  if (c == TQPaintDevice::PdcBegin)
279  {
280  d->m_impl->statusMessage(i18n("Initialization..."), this);
281  d->m_pagenumber = 1;
282  preparePrinting();
283  d->m_impl->statusMessage(i18n("Generating print data: page %1").arg(d->m_pagenumber), this);
284  }
285  value = d->m_wrapper->cmd(c,painter,p);
286  if (c == TQPaintDevice::PdcEnd)
287  {
288  // this call should take care of everything (preview, output-to-file, filtering, ...)
289  value = value && printFiles(TQStringList(d->m_wrapper->outputFileName()),true);
290  // reset "ready" state
291  finishPrinting();
292  }
293  return value;
294 }
295 
296 void KPrinter::translateQtOptions()
297 {
298  d->m_wrapper->setCreator(creator());
299  d->m_wrapper->setDocName(docName());
300  d->m_wrapper->setFullPage(fullPage());
301  d->m_wrapper->setColorMode((TQPrinter::ColorMode)colorMode());
302  d->m_wrapper->setOrientation((TQPrinter::Orientation)orientation());
303  if ( !option( "kde-printsize" ).isEmpty() )
304  d->m_wrapper->setPageSize( ( TQPrinter::PageSize )option( "kde-printsize" ).toInt() );
305  else
306  d->m_wrapper->setPageSize((TQPrinter::PageSize)pageSize());
307  d->m_wrapper->setOutputToFile(true);
308  d->m_wrapper->setOutputFileName(d->m_tmpbuffer);
309  d->m_wrapper->setNumCopies(option("kde-qtcopies").isEmpty() ? 1 : option("kde-qtcopies").toInt());
310  if (!option("kde-margin-top").isEmpty())
311  {
318  int res = resolution();
319  d->m_wrapper->setMargins(
320  ( int )( ( option("kde-margin-top").toFloat() * res + 71 ) / 72 ),
321  ( int )( ( option("kde-margin-left").toFloat() * res + 71 ) / 72 ),
322  ( int )( ( option("kde-margin-bottom").toFloat() * res + 71 ) / 72 ),
323  ( int )( ( option("kde-margin-right").toFloat() * res + 71 ) / 72 ) );
324  }
325  else if ( d->m_pagesize != NULL )
326  {
327  int res = resolution();
328  DrPageSize *ps = d->m_pagesize;
329  int top = ( int )( ps->topMargin() * res + 71 ) / 72;
330  int left = ( int )( ps->leftMargin() * res + 71 ) / 72;
331  int bottom = ( int )( ps->bottomMargin() * res + 71 ) / 72;
332  int right = ( int )( ps->rightMargin() * res + 71 ) / 72;
333  if ( !fullPage() )
334  {
335  // Printers can often print very close to the edges (PPD files say ImageArea==PaperDimension).
336  // But that doesn't mean it looks good. Apps which use setFullPage(false) assume that
337  // KPrinter will give them reasonable margins, so let's TQMAX with defaults from Qt in that case.
338  // Keep this in sync with KPMarginPage::initPageSize
339  unsigned int it, il, ib, ir;
340  d->m_wrapper->margins( &it, &il, &ib, &ir );
341  top = TQMAX( top, (int)it );
342  left = TQMAX( left, (int)il );
343  bottom = TQMAX( bottom, (int)ib );
344  right = TQMAX( right, (int)ir );
345  }
346  d->m_wrapper->setMargins( top, left, bottom, right );
347  }
348  /*else
349  {
350  int res = d->m_wrapper->resolution();
351  d->m_wrapper->setMargins( res/3, res/2, res/3, res/2 );
352  }*/
353  // for special printers, copies are handled by Qt
354  if (option("kde-isspecial") == "1")
355  d->m_wrapper->setNumCopies(numCopies());
356 }
357 
358 bool KPrinter::printFiles(const TQStringList& l, bool flag, bool startviewer)
359 {
360  TQStringList files(l);
361  bool status(true);
362 
363  // First apply possible filters, and update "remove" flag if filters has
364  // been applied (result == 0, means nothing happened).
365  int fresult = d->m_impl->filterFiles(this, files, flag);
366  if (fresult == -1)
367  {
368  reportError(this);
369  status = false;
370  }
371  else if (fresult == 1)
372  flag = true;
373 
374  if (status)
375  {
376  // Automatic conversion to format supported by print system
377  fresult = d->m_impl->autoConvertFiles(this, files, flag);
378  if (fresult == -1)
379  {
380  reportError(this);
381  status = false;
382  }
383  else if (fresult == 1)
384  flag = true;
385  }
386 
387  // Continue if status is OK (filtering succeeded) and no output-to-file
388  if (status && files.count() > 0)
389  {
390  // Show preview if needed (only possible for a single file !), and stop
391  // if the user requested it. Force preview if preview-only mode has been set: it
392  // then use by default the first file in the list.
393  if (((files.count() != 1 || option("kde-preview") != "1") && !d->m_previewonly) || doPreview(files[0]))
394  {
395  // check if printing has been prepared (it may be not prepared if the KPrinter object is not
396  // use as a TQPaintDevice object)
397  preparePrinting();
398 
399  if (!d->m_impl->printFiles(this, files, flag))
400  {
401  reportError(this);
402  status = false;
403  }
404  else
405  {
406  if (/* !outputToFile() && */ startviewer && !TQFile::exists("/etc/xdg/autostart/system-config-printer-applet-kde.desktop") )
407  {
408  TQStringList args;
409  args << "-d";
410  args << printerName();
411  args << "--noshow";
412  kapp->tdeinitExec("kjobviewer", args);
413  }
414  }
415  }
416  else if (flag)
417  // situation: only one file, it has been previewed and printing has been canceled, then
418  // we should remove the file ourself
419  {
420  TQFile::remove(files[0]);
421  }
422  }
423  finishPrinting();
424  return status;
425 }
426 
427 bool KPrinter::doPreview(const TQString& file)
428 {
429  d->m_impl->statusMessage(i18n("Previewing..."), this);
430  d->m_impl->statusMessage(TQString::null, this);
431  return KPrintPreview::preview(file, d->m_previewonly, d->m_parentId);
432 }
433 
434 void KPrinter::preparePrinting()
435 {
436  // check if already prepared (-> do nothing)
437  if (d->m_ready) return;
438 
439  // re-initialize error
440  setErrorMessage(TQString::null);
441 
442  // re-initialize margins and page size (by default, use Qt mechanism)
443  setRealPageSize(NULL);
444 
445  // print-system-specific setup, only if not printing to file
446  if (option("kde-isspecial") != "1")
447  d->m_impl->preparePrinting(this);
448 
449  // set the correct resolution, if needed (or reset it)
450  int res = option( "kde-resolution" ).toInt();
451  if ( d->m_useprinterres && res > 0 )
452  d->m_wrapper->setResolution( res );
453  else
454  d->m_wrapper->setResolution( d->m_defaultres );
455 
456  // standard Qt settings
457  translateQtOptions();
458 
459  d->m_ready = true;
460 dumpOptions(d->m_options);
461 }
462 
463 void KPrinter::finishPrinting()
464 {
465  d->m_ready = false;
466  // close the status window
467  d->m_impl->statusMessage(TQString::null, this);
468 }
469 
470 TQValueList<int> KPrinter::pageList() const
471 {
472  TQValueList<int> list;
473  int mp(minPage()), MP(maxPage());
474  if (mp > 0 && MP > 0 && MP >= mp)
475  { // do something only if bounds specified
476  if (option("kde-current") == "1")
477  { // print only current page
478  int pp = currentPage();
479  if (pp >= mp && pp <= MP) list.append(pp);
480  }
481  else
482  {
483  // process range specification
484  if (!option("kde-range").isEmpty())
485  {
486  TQStringList ranges = TQStringList::split(',',option("kde-range"),false);
487  for (TQStringList::ConstIterator it=ranges.begin();it!=ranges.end();++it)
488  {
489  int p = (*it).find('-');
490  bool ok;
491  if (p == -1)
492  {
493  int pp = (*it).toInt(&ok);
494  if (ok && pp >= mp && pp <= MP)
495  list.append(pp);
496  }
497  else
498  {
499  int p1(0), p2(0);
500  p1 = (*it).left(p).toInt(&ok);
501  if (ok) p2 = (*it).right((*it).length()-p-1).toInt(&ok);
502  if (ok && p1 <= p2)
503  {
504  // clip to min/max
505  p1 = TQMAX(mp,p1);
506  p2 = TQMIN(MP,p2);
507  for (int i=p1;i<=p2;i++)
508  list.append(i);
509  }
510  }
511  }
512  }
513  else
514  { // add all pages between min and max
515  for (int i=mp;i<=MP;i++) list.append(i);
516  }
517 
518  // revert the list if needed
519  if (pageOrder() == LastPageFirst)
520  {
521  for (uint i=0;i<(list.count()/2);i++)
522  tqSwap(list[i],list[list.count()-1-i]);
523  }
524 
525  // select page set if needed
526  if (pageSet() != AllPages)
527  {
528  bool keepEven = (pageSet() == EvenPages);
529  for (TQValueList<int>::Iterator it=list.begin();it!=list.end();)
530  if ((((*it) % 2) != 0 && keepEven) ||
531  (((*it) % 2) == 0 && !keepEven)) it = list.remove(it);
532  else ++it;
533  }
534  }
535  }
536  return list;
537 }
538 
539 //**************************************************************************************
540 // TQPrinter interface
541 //**************************************************************************************
542 
543 int KPrinter::numCopies() const
544 {
545  bool ok;
546  int p = option("kde-copies").toInt(&ok);
547  return (ok ? p : 1);
548 }
549 
550 TQSize KPrinter::margins() const
551 {
552  return d->m_wrapper->margins();
553 }
554 
555 void KPrinter::margins( uint *top, uint *left, uint *bottom, uint *right ) const
556 {
557  d->m_wrapper->margins( top, left, bottom, right );
558 }
559 
560 int KPrinter::metric(int m) const
561 {
562  if (d->m_pagesize == NULL || !option( "kde-printsize" ).isEmpty())
563  return d->m_wrapper->qprinterMetric(m);
564 
565  int val(0);
566  bool land = (orientation() == KPrinter::Landscape);
567  uint res(d->m_wrapper->resolution()), top = res/2, left = res/2, bottom = res/3, right = res/2;
568  margins( &top, &left, &bottom, &right );
569  switch ( m )
570  {
571  case TQPaintDeviceMetrics::PdmWidth:
572  val = (land ? ( int )d->m_pagesize->pageHeight() : ( int )d->m_pagesize->pageWidth());
573  if ( res != 72 )
574  val = (val * res + 36) / 72;
575  if ( !fullPage() )
576  val -= ( left + right );
577  break;
578  case TQPaintDeviceMetrics::PdmHeight:
579  val = (land ? ( int )d->m_pagesize->pageWidth() : ( int )d->m_pagesize->pageHeight());
580  if ( res != 72 )
581  val = (val * res + 36) / 72;
582  if ( !fullPage() )
583  val -= ( top + bottom );
584  break;
585  case TQPaintDeviceMetrics::PdmWidthMM:
586  val = metric( TQPaintDeviceMetrics::PdmWidth );
587  val = (val * 254 + 5*res) / (10*res); // +360 to get the right rounding
588  break;
589  case TQPaintDeviceMetrics::PdmHeightMM:
590  val = metric( TQPaintDeviceMetrics::PdmHeight );
591  val = (val * 254 + 5*res) / (10*res);
592  break;
593  default:
594  val = d->m_wrapper->qprinterMetric(m);
595  break;
596  }
597  return val;
598 }
599 
600 void KPrinter::setOrientation(Orientation o)
601 {
602  KMFactory::self()->settings()->orientation = o;
603  setOption("kde-orientation",(o == Landscape ? "Landscape" : "Portrait"));
604  d->m_impl->broadcastOption("kde-orientation",(o == Landscape ? "Landscape" : "Portrait"));
605  d->m_impl->broadcastOption( "kde-orientation-fixed", "1" );
606 }
607 
608 void KPrinter::setOption( const TQString& key, const TQString& value, bool broadcast )
609 {
610  setOption( key, value );
611  if ( broadcast )
612  d->m_impl->broadcastOption( key, value );
613 }
614 
615 void KPrinter::setPageSize(PageSize s)
616 {
617  KMFactory::self()->settings()->pageSize = s;
618  setOption("kde-pagesize",TQString::number((int)s),true);
619  d->m_impl->broadcastOption( "kde-pagesize-fixed", "1" );
620 }
621 
622 void KPrinter::setOptions(const TQMap<TQString,TQString>& opts)
623 { // This functions remove all options except those with "kde-..."
624  // which correspond to externally-sets options (use the value
625  // from "opts" if specified
626  TQMap<TQString,TQString> tmpset = d->m_options;
627  d->m_options = opts;
628  // remove some problematic options that may not be overwritten (ugly hack).
629  // Default values will be used instead, except if the dialog has set new ones.
630  tmpset.remove("kde-pagesize");
631  tmpset.remove( "kde-printsize" );
632  tmpset.remove("kde-orientation");
633  tmpset.remove("kde-colormode");
634  tmpset.remove("kde-margin-top");
635  tmpset.remove("kde-margin-left");
636  tmpset.remove("kde-margin-bottom");
637  tmpset.remove("kde-margin-right");
638  tmpset.remove( "kde-resolution" );
639  tmpset.remove( "kde-fonts" );
640  for (TQMap<TQString,TQString>::ConstIterator it=tmpset.begin();it!=tmpset.end();++it)
641  if (it.key().left(4) == "kde-" && !(d->m_options.contains(it.key())))
642  d->m_options[it.key()] = it.data();
643 }
644 
645 void KPrinter::initOptions(const TQMap<TQString,TQString>& opts)
646 { // This function can be used to initialize the KPrinter object just after
647  // creation to set some options. Non global options will be propagated to
648  // all listed printers (non-global => start with "kde-...")
649  for (TQMap<TQString,TQString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it)
650  {
651  setOption(it.key(), it.data());
652  if (it.key().left(4) != "kde-")
653  d->m_impl->broadcastOption(it.key(),it.data());
654  }
655 }
656 
657 void KPrinter::reload()
658 {
659  d->m_impl = KMFactory::self()->printerImplementation();
660  int global = KMFactory::self()->settings()->orientation;
661  if (global != -1) setOrientation((KPrinter::Orientation)global);
662  global = KMFactory::self()->settings()->pageSize;
663  if (global != -1) setPageSize((KPrinter::PageSize)global);
664  //initOptions(d->m_options);
665 }
666 
667 bool KPrinter::autoConfigure(const TQString& prname, TQWidget *parent)
668 {
669  KMManager *mgr = KMManager::self();
670  KMPrinter *mprt(0);
671 
672  mgr->printerList(false);
673  if (prname.isEmpty())
674  mprt = mgr->defaultPrinter();
675  else
676  mprt = mgr->findPrinter(prname);
677 
678  if (mprt)
679  return mprt->autoConfigure(this, parent);
680  else
681  return false;
682 }
683 
684 //**************************************************************************************
685 // Util functions
686 //**************************************************************************************
687 
688 void reportError(KPrinter *p)
689 {
690  if (!KNotifyClient::event(0,"printerror",i18n("<p><nobr>A print error occurred. Error message received from system:</nobr></p><br>%1").arg(p->errorMessage())))
691  kdDebug(500) << "could not send notify event" << endl;
692 }
693 
694 KPrinter::PageSize pageNameToPageSize(const TQString& _name)
695 {
696  TQString name = _name.upper();
697  if (name == "LETTER") return KPrinter::Letter;
698  else if (name == "LEGAL") return KPrinter::Legal;
699  else if (name == "A4") return KPrinter::A4;
700  else if (name == "A3") return KPrinter::A3;
701  else if (name == "EXECUTIVE") return KPrinter::Executive;
702  else if (name == "LEDGER") return KPrinter::Ledger;
703  else if (name == "TABLOID") return KPrinter::Tabloid;
704  else if (name == "FOLIO") return KPrinter::Folio;
705  else if (name == "A5") return KPrinter::A5;
706  else if (name == "A6") return KPrinter::A6;
707  else if (name == "A7") return KPrinter::A7;
708  else if (name == "A8") return KPrinter::A8;
709  else if (name == "A9") return KPrinter::A9;
710  else if (name == "A2") return KPrinter::A2;
711  else if (name == "A1") return KPrinter::A1;
712  else if (name == "A0") return KPrinter::A0;
713  else if (name == "B0" || name == "B0ISO") return KPrinter::B0;
714  else if (name == "B1" || name == "B1ISO") return KPrinter::B1;
715  else if (name == "B2" || name == "B2ISO") return KPrinter::B2;
716  else if (name == "B3" || name == "B3ISO") return KPrinter::B3;
717  else if (name == "B4" || name == "B4ISO") return KPrinter::B4;
718  else if (name == "B5" || name == "B5ISO") return KPrinter::B5;
719  else if (name == "B6" || name == "B6ISO") return KPrinter::B6;
720  else if (name == "B7" || name == "B7ISO") return KPrinter::B7;
721  else if (name == "B8" || name == "B8ISO") return KPrinter::B8;
722  else if (name == "B9" || name == "B9ISO") return KPrinter::B9;
723  else if (name == "B10" || name == "B10ISO") return KPrinter::B10;
724  else if (name == "C5" || name == "C5E" || name == "ENVC5") return KPrinter::C5E;
725  else if (name == "DL" || name == "DLE" || name == "ENVDL") return KPrinter::DLE;
726  else if (name == "COMM10" || name == "COM10" || name == "ENV10") return KPrinter::Comm10E;
727  else return KPrinter::A4;
728 }
729 
730 const char* pageSizeToPageName(KPrinter::PageSize s)
731 {
732  switch(s)
733  {
734  case KPrinter::Letter: return "Letter";
735  case KPrinter::Legal: return "Legal";
736  case KPrinter::A4: return "A4";
737  case KPrinter::A3: return "A3";
738  case KPrinter::Executive: return "Executive";
739  case KPrinter::Ledger: return "Ledger";
740  case KPrinter::Tabloid: return "Tabloid";
741  case KPrinter::Folio: return "Folio";
742  case KPrinter::A5: return "A5";
743  case KPrinter::A6: return "A6";
744  case KPrinter::A7: return "A7";
745  case KPrinter::A8: return "A8";
746  case KPrinter::A9: return "A9";
747  case KPrinter::A2: return "A2";
748  case KPrinter::A1: return "A1";
749  case KPrinter::A0: return "A0";
750  case KPrinter::B0: return "B0";
751  case KPrinter::B1: return "B1";
752  case KPrinter::B2: return "B2";
753  case KPrinter::B3: return "B3";
754  case KPrinter::B4: return "B4";
755  case KPrinter::B5: return "B5";
756  case KPrinter::B6: return "B6";
757  case KPrinter::B7: return "B7";
758  case KPrinter::B8: return "B8";
759  case KPrinter::B9: return "B9";
760  case KPrinter::B10: return "B10";
761  case KPrinter::C5E: return "C5";
762  case KPrinter::DLE: return "DL";
763  case KPrinter::Comm10E: return "Comm10";
764  default: return "A4";
765  }
766 }
767 
768 // FIXME: remove for 4.0
769 TQSize rangeToSize( const TQString& )
770 {
771  kdWarning( 500 ) << "rangeToSize(TQString) is obsolete, do not use (no effect)" << endl;
772  return TQSize();
773 }
774 
775 static void dumpOptions(const TQMap<TQString,TQString>& opts)
776 {
777  kdDebug(500) << "********************" << endl;
778  for (TQMap<TQString,TQString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it)
779  kdDebug(500) << it.key() << " = " << it.data() << endl;
780 }
781 
782 KPrinterImpl* KPrinter::implementation() const
783 { return d->m_impl; }
784 
785 const TQString& KPrinter::option(const TQString& key) const
786 { return ((const KPrinterPrivate*)(d))->m_options[key]; }
787 
788 void KPrinter::setOption(const TQString& key, const TQString& value)
789 { d->m_options[key] = value; }
790 
791 TQString KPrinter::docName() const
792 { return option("kde-docname"); }
793 
794 void KPrinter::setDocName(const TQString& d)
795 { setOption("kde-docname",d); }
796 
797 TQString KPrinter::creator() const
798 { return option("kde-creator"); }
799 
800 void KPrinter::setCreator(const TQString& d)
801 { setOption("kde-creator",d); }
802 
803 bool KPrinter::fullPage() const
804 { return (option("kde-fullpage") == "1"); }
805 
806 void KPrinter::setFullPage(bool on)
807 { setOption("kde-fullpage",(on ? "1" : "0")); }
808 
809 KPrinter::ColorMode KPrinter::colorMode() const
810 { return (KPrinter::ColorMode)(option("kde-colormode") == "GrayScale" ? GrayScale : Color); }
811 
812 void KPrinter::setColorMode(ColorMode m)
813 { setOption("kde-colormode",(m == Color ? "Color" : "GrayScale")); }
814 
815 void KPrinter::setNumCopies(int n)
816 { setOption("kde-copies",TQString::number(n)); }
817 
818 KPrinter::Orientation KPrinter::orientation() const
819 { return (option("kde-orientation") == "Landscape" ? Landscape : Portrait); }
820 
821 KPrinter::PageOrder KPrinter::pageOrder() const
822 { return (option("kde-pageorder") == "Reverse" ? LastPageFirst : FirstPageFirst); }
823 
824 void KPrinter::setPageOrder(PageOrder o)
825 { setOption("kde-pageorder",(o == LastPageFirst ? "Reverse" : "Forward")); }
826 
827 KPrinter::CollateType KPrinter::collate() const
828 { return (option("kde-collate") == "Collate" ? Collate : Uncollate); }
829 
830 void KPrinter::setCollate(CollateType c)
831 { setOption("kde-collate",(c == Collate ? "Collate" : "Uncollate")); }
832 
833 int KPrinter::minPage() const
834 { return (option("kde-minpage").isEmpty() ? 0 : option("kde-minpage").toInt()); }
835 
836 int KPrinter::maxPage() const
837 { return (option("kde-maxpage").isEmpty() ? 0 : option("kde-maxpage").toInt()); }
838 
839 void KPrinter::setMinMax(int m, int M)
840 { setOption("kde-minpage",TQString::number(m)); setOption("kde-maxpage",TQString::number(M)); }
841 
842 int KPrinter::fromPage() const
843 { return (option("kde-frompage").isEmpty() ? 0 : option("kde-frompage").toInt()); }
844 
845 int KPrinter::toPage() const
846 { return (option("kde-topage").isEmpty() ? 0 : option("kde-topage").toInt()); }
847 
848 void KPrinter::setFromTo(int m, int M)
849 { setOption("kde-frompage",TQString::number(m)); setOption("kde-topage",TQString::number(M)); setOption("kde-range",(m>0 && M>0 ? TQString("%1-%2").arg(m).arg(M) : TQString::fromLatin1(""))); }
850 
851 // if no page size defined, use the localized one
852 KPrinter::PageSize KPrinter::pageSize() const
853 { return (option("kde-pagesize").isEmpty() ? (PageSize)TDEGlobal::locale()->pageSize() : (PageSize)option("kde-pagesize").toInt()); }
854 
855 KPrinter::PageSetType KPrinter::pageSet() const
856 { return (option("kde-pageset").isEmpty() ? AllPages : (PageSetType)(option("kde-pageset").toInt())); }
857 
858 int KPrinter::currentPage() const
859 { return (option("kde-currentpage").isEmpty() ? 0 : option("kde-currentpage").toInt()); }
860 
861 void KPrinter::setCurrentPage(int p)
862 { setOption("kde-currentpage",TQString::number(p)); }
863 
864 TQString KPrinter::printerName() const
865 { return d->m_printername; }
866 
867 void KPrinter::setPrinterName(const TQString& s)
868 { d->m_printername = s; }
869 
870 TQString KPrinter::printProgram() const
871 { return (option("kde-isspecial") == "1" ? option("kde-special-command") : TQString::null); }
872 
873 void KPrinter::setPrintProgram(const TQString& prg)
874 {
875  if (prg.isNull())
876  {
877  setOption("kde-isspecial", "0");
878  d->m_options.remove("kde-special-command");
879  }
880  else
881  {
882  TQString s(prg);
883  if (s.find("%in") == -1)
884  s.append(" %in");
885  setOutputToFile( s.find( "%out" ) != -1 );
886  setOption("kde-isspecial", "1");
887  setOption("kde-special-command", s);
888  }
889 }
890 
891 TQString KPrinter::printerSelectionOption() const
892 { return TQString::fromLatin1(""); }
893 
894 void KPrinter::setPrinterSelectionOption(const TQString&)
895 {}
896 
897 const TQMap<TQString,TQString>& KPrinter::options() const
898 { return d->m_options; }
899 
900 TQString KPrinter::searchName() const
901 { return d->m_searchname; }
902 
903 void KPrinter::setSearchName(const TQString& s)
904 { d->m_searchname = s; }
905 
906 bool KPrinter::newPage()
907 {
908  d->m_pagenumber++;
909  d->m_impl->statusMessage(i18n("Generating print data: page %1").arg(d->m_pagenumber), this);
910  return d->m_wrapper->newPage();
911 }
912 
913 TQString KPrinter::outputFileName() const
914 { return option("kde-outputfilename"); }
915 
916 void KPrinter::setOutputFileName(const TQString& f)
917 { setOption("kde-outputfilename",f); setOutputToFile(!f.isEmpty()); }
918 
919 bool KPrinter::outputToFile() const
920 { return (option("kde-outputtofile") == "1" || (option("kde-isspecial") == "1" && option("kde-special-command").isEmpty())); }
921 
922 void KPrinter::setOutputToFile(bool on)
923 {
924  setOption("kde-outputtofile",(on ? "1" : "0"));
925  if (on)
926  {
927  setOption("kde-special-command",TQString::null);
928  setOption("kde-isspecial","1");
929  }
930 }
931 
932 bool KPrinter::abort()
933 { return d->m_wrapper->abort(); }
934 
935 bool KPrinter::aborted() const
936 { return d->m_wrapper->aborted(); }
937 
938 void KPrinter::setMargins(TQSize m)
939 {
940  setMargins( m.height(), m.width(), m.height(), m.width() );
941 }
942 
943 void KPrinter::setMargins( uint top, uint left, uint bottom, uint right )
944 {
945  d->m_wrapper->setMargins( top, left, bottom, right );
946  setOption( "kde-margin-top", TQString::number( top ), true );
947  setOption( "kde-margin-left", TQString::number( left ), true );
948  setOption( "kde-margin-bottom", TQString::number( bottom ), true );
949  setOption( "kde-margin-right", TQString::number( right ), true );
950 }
951 
952 // FIXME: remove for 4.0
953 TQSize KPrinter::realPageSize() const
954 {
955  kdWarning( 500 ) << "KPrinter::realPageSize() is obsolete, do not use" << endl;
956  if ( d->m_pagesize )
957  return d->m_pagesize->pageSize();
958  else
959  return TQSize();
960 }
961 
962 void KPrinter::setRealPageSize(DrPageSize *p)
963 {
964  if ( p )
965  {
966  kdDebug( 500 ) << "Page size: width =" << p->pageWidth() << endl;
967  kdDebug( 500 ) << "Page size: height =" << p->pageHeight() << endl;
968  kdDebug( 500 ) << "Page size: left =" << p->leftMargin() << endl;
969  kdDebug( 500 ) << "Page size: top =" << p->topMargin() << endl;
970  kdDebug( 500 ) << "Page size: right =" << p->rightMargin() << endl;
971  kdDebug( 500 ) << "Page size: bottom =" << p->bottomMargin() << endl;
972  }
973  else
974  kdDebug( 500 ) << "Resetting page size" << endl;
975 
976  /* we copy the page size structure internally
977  * as the original object is owned by the driver
978  * that control its destrution */
979  delete d->m_pagesize;
980  d->m_pagesize = 0;
981  if ( p )
982  d->m_pagesize = new DrPageSize( *p );
983 }
984 
985 // FIXME: remove for 4.0
986 void KPrinter::setRealPageSize( TQSize )
987 {
988  kdWarning( 500 ) << "KPrinter::setRealPageSize(TQSize) is obsolete, do not use (no effect)" << endl;
989 }
990 
991 // FIXME: remove for 4.0
992 void KPrinter::setRealDrawableArea( const TQRect& )
993 {
994  kdWarning( 500 ) << "KPrinter::setRealDrawableArea(TQRect) is obsolete, do not use (no effect)" << endl;
995 }
996 
997 // FIXME: remove for 4.0
998 TQRect KPrinter::realDrawableArea() const
999 {
1000  kdWarning( 500 ) << "KPrinter::realDrawableArea() is obsolete, do not use" << endl;
1001  if ( d->m_pagesize )
1002  return d->m_pagesize->pageRect();
1003  else
1004  return TQRect();
1005 }
1006 
1007 TQString KPrinter::errorMessage() const
1008 { return d->m_errormsg; }
1009 
1010 void KPrinter::setErrorMessage(const TQString& msg)
1011 { d->m_errormsg = msg; }
1012 
1013 /* we're using a builtin member to store this state because we don't
1014  * want to keep it from object to object. So there's no need to use
1015  * the TQMap structure to store this
1016  */
1017 void KPrinter::setPreviewOnly(bool on)
1018 { d->m_previewonly = on; }
1019 
1020 bool KPrinter::previewOnly() const
1021 { return d->m_previewonly; }
1022 
1023 void KPrinter::setDocFileName(const TQString& s)
1024 { d->m_docfilename = s; }
1025 
1026 TQString KPrinter::docFileName() const
1027 { return d->m_docfilename; }
1028 
1029 void KPrinter::setDocDirectory( const TQString& s )
1030 { d->m_docdirectory = s; }
1031 
1032 TQString KPrinter::docDirectory() const
1033 { return ( d->m_docdirectory.isEmpty() ? TQDir::homeDirPath() : d->m_docdirectory ); }
1034 
1035 void KPrinter::setResolution(int dpi)
1036 {
1037  d->m_wrapper->setResolution(dpi);
1038  d->m_defaultres = dpi;
1039 }
1040 
1041 int KPrinter::resolution() const
1042 { return d->m_wrapper->resolution(); }
1043 
1044 void KPrinter::setUsePrinterResolution( bool on )
1045 { d->m_useprinterres = on; }
KPrinter::collate
CollateType collate() const
Returns the collate status of the current KPrinter.
Definition: kprinter.cpp:827
KPrinter::setResolution
void setResolution(int dpi)
Set the resolution of the current KPrinter object.
Definition: kprinter.cpp:1035
KPrinter::setErrorMessage
void setErrorMessage(const TQString &msg)
Sets the last error message.
Definition: kprinter.cpp:1010
KPrinter::errorMessage
TQString errorMessage() const
Returns the last error message issued by the print system.
Definition: kprinter.cpp:1007
KPrinter::option
const TQString & option(const TQString &key) const
Starts the add printer wizard.
Definition: kprinter.cpp:785
KPrinter::options
const TQMap< TQString, TQString > & options() const
Returns the complete set of print options from the KPrinter object.
Definition: kprinter.cpp:897
KPrinter::ColorMode
ColorMode
Defines the color mode of the printer.
Definition: kprinter.h:152
KPrinter::setMargins
void setMargins(TQSize m)
Not used yet.
Definition: kprinter.cpp:938
KPrinter::setDocFileName
void setDocFileName(const TQString &filename)
Set the default document filename.
Definition: kprinter.cpp:1023
KPrinter::autoConfigure
bool autoConfigure(const TQString &prname=TQString::null, TQWidget *parent=0)
Configure the KPrinter object to be used with the printer named prname.
Definition: kprinter.cpp:667
KPrinter::ApplicationType
ApplicationType
Defines the type of the application, this affects the GUI of the print dialog:
Definition: kprinter.h:126
KPrinter::addDialogPage
static void addDialogPage(KPrintDialogPage *_page)
Adds a customized page to the print dialog.
Definition: kprinter.cpp:250
KPrinter::abort
bool abort()
See TQPrinter::abort().
Definition: kprinter.cpp:932
KPrinter::setDocName
void setDocName(const TQString &)
See TQPrinter::setDocName().
Definition: kprinter.cpp:794
KPrinter::docFileName
TQString docFileName() const
Get the default document filename, that is the default basename used for the output file...
Definition: kprinter.cpp:1026
KPrinter::setPreviewOnly
void setPreviewOnly(bool on)
Sets the KPrinter object to preview mode if on is true.
Definition: kprinter.cpp:1017
KPrinter::fullPage
bool fullPage() const
See TQPrinter::fullPage().
Definition: kprinter.cpp:803
KPrinter::setPrinterSelectionOption
void setPrinterSelectionOption(const TQString &)
See TQPrinter::setPrinterSelectionOption().
Definition: kprinter.cpp:894
KPrinter::currentPage
int currentPage() const
Returns the current page number.
Definition: kprinter.cpp:858
KPrinter::setOptions
void setOptions(const TQMap< TQString, TQString > &opts)
Sets the option set in one operation.
Definition: kprinter.cpp:622
KPrinter::setPrintProgram
void setPrintProgram(const TQString &cmd)
Sets the command line to use when printing.
Definition: kprinter.cpp:873
KPrinter::setColorMode
void setColorMode(ColorMode)
See TQPrinter::setColorMode().
Definition: kprinter.cpp:812
KPrinter::minPage
int minPage() const
See TQPrinter::minPage().
Definition: kprinter.cpp:833
KPrinter::setCollate
void setCollate(CollateType type)
Sets the collate status for the current KPrinter to type.
Definition: kprinter.cpp:830
KPrinter::realDrawableArea
TQRect realDrawableArea() const
DO NOT USE, WILL BE REMOVED.
Definition: kprinter.cpp:998
KPrinter::setPageSelection
static void setPageSelection(PageSelectionType _mode)
Sets the page selection mode of the application.
Definition: kprinter.cpp:255
KPrinter::setMinMax
void setMinMax(int, int)
See TQPrinter::setMinMax().
Definition: kprinter.cpp:839
KPrinter
This class is the main interface to access the TDE print framework.
Definition: kprinter.h:88
KPrinter::orientation
Orientation orientation() const
See TQPrinter::orientation().
Definition: kprinter.cpp:818
KPrinter::previewOnly
bool previewOnly() const
Returns the preview-only state for this KPrinter object.
Definition: kprinter.cpp:1020
KPrinter::removeStandardPage
static void removeStandardPage(int p)
Removes a standard page from the print dialog.
Definition: kprinter.cpp:245
KPrinter::docName
TQString docName() const
See TQPrinter::docName().
Definition: kprinter.cpp:791
KPrinter::setRealPageSize
void setRealPageSize(TQSize p)
DO NOT USE, WILL BE REMOVED.
Definition: kprinter.cpp:986
KPrinter::KPrinter
KPrinter(bool restore=true, TQPrinter::PrinterMode m=TQPrinter::ScreenResolution)
Constructor.
Definition: kprinter.cpp:123
KPrinter::setUsePrinterResolution
void setUsePrinterResolution(bool on)
Define the KPrinter object to use the actual printer resolution.
Definition: kprinter.cpp:1044
KPrinter::setDocDirectory
void setDocDirectory(const TQString &dir)
Set the default document directory.
Definition: kprinter.cpp:1029
KPrinter::initOptions
void initOptions(const TQMap< TQString, TQString > &opts)
For internal use only.
Definition: kprinter.cpp:645
KPrinter::printFiles
bool printFiles(const TQStringList &files, bool removeafter=false, bool startviewer=true)
Prints the files given in argument.
Definition: kprinter.cpp:358
KPrinter::pageSelection
static PageSelectionType pageSelection()
Returns the page selection mode of the current application.
Definition: kprinter.cpp:260
KPrinter::PageSetType
PageSetType
Defines the page set to print:
Definition: kprinter.h:137
KPrinter::PageOrder
PageOrder
Defines the page order of the print job.
Definition: kprinter.h:162
KPrinter::translateQtOptions
void translateQtOptions()
Definition: kprinter.cpp:296
KPrinter::setup
bool setup(TQWidget *parent=0, const TQString &caption=TQString::null, bool forceExpand=false)
Sets up the KPrinter object using the print dialog, returns true if the user clicked OK...
Definition: kprinter.cpp:219
KPrinter::setFromTo
void setFromTo(int, int)
Sets the first and last page to be printed.
Definition: kprinter.cpp:848
KPrinter::pageOrder
PageOrder pageOrder() const
See TQPrinter::pageOrder().
Definition: kprinter.cpp:821
KPrinter::margins
TQSize margins() const
See TQPrinter::margins().
Definition: kprinter.cpp:550
KPrinter::PageSelectionType
PageSelectionType
Defines whether the application can perform page selection itself or not.
Definition: kprinter.h:116
KPrinter::aborted
bool aborted() const
See TQPrinter::aborted(.)
Definition: kprinter.cpp:935
KPrinter::realPageSize
TQSize realPageSize() const
Returns the page size in dot unit ( 1 dot = 1/72th in ).
Definition: kprinter.cpp:953
KPrinter::setApplicationType
static void setApplicationType(ApplicationType type)
Sets the application type concerning the print dialog.
Definition: kprinter.cpp:265
KPrinter::setPageOrder
void setPageOrder(PageOrder)
See TQPrinter::setPageOrder().
Definition: kprinter.cpp:824
KPrinter::printProgram
TQString printProgram() const
Returns the print program as set by setPrintProgram() or by the print dialog if a special printer has...
Definition: kprinter.cpp:870
KPrinter::setPrinterName
void setPrinterName(const TQString &)
See TQPrinter::setPrinterName().
Definition: kprinter.cpp:867
KPrinter::newPage
bool newPage()
See TQPrinter::newPage().
Definition: kprinter.cpp:906
KPrinter::setOrientation
void setOrientation(Orientation)
See TQPrinter::setOrientation().
Definition: kprinter.cpp:600
KPrinter::setPageSize
void setPageSize(PageSize)
See TQPrinter::setPageSize().
Definition: kprinter.cpp:615
KPrinter::setCreator
void setCreator(const TQString &)
See TQPrinter::setCreator().
Definition: kprinter.cpp:800
KPrinter::resolution
int resolution() const
Resturns the resolution of the current KPrinter object.
Definition: kprinter.cpp:1041
KPrinter::outputFileName
TQString outputFileName() const
See TQPrinter::outputFileName().
Definition: kprinter.cpp:913
KPrinter::pageSize
PageSize pageSize() const
See TQPrinter::pageSize().
Definition: kprinter.cpp:852
KPrinter::pageList
TQValueList< int > pageList() const
Returns the page list to be printed, correpsonding to the options selected by the user...
Definition: kprinter.cpp:470
KPrinter::~KPrinter
~KPrinter()
Destructor.
Definition: kprinter.cpp:129
KPrinter::setNumCopies
void setNumCopies(int n)
See TQPrinter::setNumCopies().
Definition: kprinter.cpp:815
KPrintDialogPage
This class is intended to be used as base class for customized print dialog page. ...
Definition: kprintdialogpage.h:90
KPrinter::maxPage
int maxPage() const
See TQPrinter::maxPage().
Definition: kprinter.cpp:836
KPrinter::outputToFile
bool outputToFile() const
See TQPrinter::outputToFile().
Definition: kprinter.cpp:919
KPrinter::CollateType
CollateType
Defines the collate property of the printer (if supported by the print system):
Definition: kprinter.h:145
KPrinter::numCopies
int numCopies() const
See TQPrinter::numCopies().
Definition: kprinter.cpp:543
KPrinter::toPage
int toPage() const
Returns the last page to be printed.
Definition: kprinter.cpp:845
KPrinter::docDirectory
TQString docDirectory() const
Get the default document directory, that is the directory used for any output file.
Definition: kprinter.cpp:1032
KPrinter::fromPage
int fromPage() const KDE_DEPRECATED
Returns the first page to be printed.
Definition: kprinter.cpp:842
KPrinter::printerName
TQString printerName() const
See TQPrinter::printerName().
Definition: kprinter.cpp:864
KPrinter::applicationType
static ApplicationType applicationType()
Returns the application type concerning the print dialog.
Definition: kprinter.cpp:270
KPrinter::PageSize
PageSize
Defines the paper size to use.
Definition: kprinter.h:167
KPrinter::creator
TQString creator() const
See TQPrinter::creator().
Definition: kprinter.cpp:797
KPrinter::setCurrentPage
void setCurrentPage(int p=0)
Sets the current page number.
Definition: kprinter.cpp:861
KPrinter::setOutputFileName
void setOutputFileName(const TQString &)
See TQPrinter::setOutputFileName().
Definition: kprinter.cpp:916
KPrinter::pageSet
PageSetType pageSet() const
Returns the page set of the current KPrinter object.
Definition: kprinter.cpp:855
KPrinter::setRealDrawableArea
void setRealDrawableArea(const TQRect &r)
DO NOT USE, WILL BE REMOVED.
Definition: kprinter.cpp:992
KPrinter::implementation
KPrinterImpl * implementation() const
For internal use only.
Definition: kprinter.cpp:782
KPrinter::setSearchName
void setSearchName(const TQString &n)
Sets the search name of the KPrinter object.
Definition: kprinter.cpp:903
KPrinter::addStandardPage
static void addStandardPage(int p)
Adds a standard page to the print dialog.
Definition: kprinter.cpp:240
KPrinter::printerSelectionOption
TQString printerSelectionOption() const
See TQPrinter::printerSelectionOption().
Definition: kprinter.cpp:891
KPrinter::setOption
void setOption(const TQString &key, const TQString &value)
Adds or modifies an option in the KPrinter object.
Definition: kprinter.cpp:788
KPrinter::searchName
TQString searchName() const
Returns the search name of the printer selected by the user.
Definition: kprinter.cpp:900
KPrinter::colorMode
ColorMode colorMode() const
See TQPrinter::colorMode().
Definition: kprinter.cpp:809
KPrinter::setFullPage
void setFullPage(bool)
See TQPrinter::setFullPage().
Definition: kprinter.cpp:806
KPrinter::Orientation
Orientation
Defines the orientation of the paper.
Definition: kprinter.h:157
KPrinter::setOutputToFile
void setOutputToFile(bool)
See TQPrinter::setOutputToFile().
Definition: kprinter.cpp:922

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.