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

tdeprint

Public Member Functions | Protected Attributes | List of all members
KPrintDialogPage Class Reference

#include <kprintdialogpage.h>

Inherits TQWidget.

Inherited by KPCopiesPage, KPDriverPage, KPFileSelectPage, KPFilterPage, KPGeneralPage, KPHpgl2Page, KPImagePage, KPMarginPage, KPPosterPage, KPQtPage, KPSchedulePage, KPTagsPage, and KPTextPage.

Public Member Functions

 KPrintDialogPage (TQWidget *parent=0, const char *name=0)
 
 KPrintDialogPage (KMPrinter *pr, DrMain *dr=0, TQWidget *parent=0, const char *name=0)
 
virtual ~KPrintDialogPage ()
 
virtual void getOptions (TQMap< TQString, TQString > &opts, bool incldef=false)
 
virtual void setOptions (const TQMap< TQString, TQString > &opts)
 
virtual bool isValid (TQString &msg)
 
int id () const
 
void setId (int ID)
 
TQString title () const
 
void setTitle (const TQString &txt)
 
bool onlyRealPrinters () const
 
void setOnlyRealPrinters (bool on=true)
 
DrMain * driver ()
 
KMPrinter * printer ()
 

Protected Attributes

KMPrinter * m_printer
 
DrMain * m_driver
 
int m_ID
 
TQString m_title
 
bool m_onlyreal
 

Detailed Description

This class is intended to be used as base class for customized print dialog page.

One of the feature of the TDE print framework is to allow to customize the print dialog to add some application specific print options. This is done by subclassing KPrintDialogPage and reimplementing the 3 virtual functions getOptions, setOptions and isValid(). The print options will be stored in the KPrinter object, and will be accessible via KPrinter::option(). The option name should follow the form "kde-appname-optionname" for internal reasons.

#include <tdeprint/kprintdialogpage.h>
class MyDialogPage : public KPrintDialogPage
{
public:
MyDialogPage( TQWidget *parent = 0, const char *name = 0 );
//reimplement virtual functions
void getOptions( TQMap<TQString,TQString>& opts, bool incldef = false );
void setOptions( const TQMap<TQString,TQString>& opts );
bool isValid( TQString& msg );
private:
TQComboBox *m_fontcombo;
};
MyDialogPage::MyDialogPage( TQWidget *parent, const char *name )
: KPrintDialogPage( parent, name )
{
setTitle( i18n( "My Page" ) );
}
void MyDialogPage::getOptions( TQMap<TQString,TQString>& opts, bool incldef )
{
if ( incldef || m_fontcombo->currentText() != mydefaultvalue )
opts[ "kde-myapp-fontname" ] = m_fontcombo->currentText();
}
void MyDialogPage::setOptions( const TQMap<TQString,TQString>& opts )
{
TQString fntname = opts[ "kde-myapp-fontname" ];
m_fontcombo->setEditText( fntname );
}
bool MyDialogPage::isValid( TQString& msg)
{
if ( m_fontcombo->currentText().isEmpty() )
{
msg = i18n( "Font name cannot be empty." );
return false;
}
return true;
}
KPrintDialogPage
This class is intended to be used as base class for customized print dialog page.
Definition: kprintdialogpage.h:91
KPrintDialogPage::isValid
virtual bool isValid(TQString &msg)
Returns true if options selected in the page are valid (no conflict), false otherwise.
Definition: kprintdialogpage.cpp:45
KPrintDialogPage::getOptions
virtual void getOptions(TQMap< TQString, TQString > &opts, bool incldef=false)
This function is called to fill the structure opts with the selected options from this dialog page.
Definition: kprintdialogpage.cpp:41
KPrintDialogPage::setOptions
virtual void setOptions(const TQMap< TQString, TQString > &opts)
This function is called to update the current page with the options contained in opts.
Definition: kprintdialogpage.cpp:37

Base class for customized print dialog pages.

See also
KPrinter

Definition at line 90 of file kprintdialogpage.h.

Constructor & Destructor Documentation

◆ KPrintDialogPage() [1/2]

KPrintDialogPage::KPrintDialogPage ( TQWidget *  parent = 0,
const char *  name = 0 
)

Standard constructor.

Definition at line 23 of file kprintdialogpage.cpp.

◆ KPrintDialogPage() [2/2]

KPrintDialogPage::KPrintDialogPage ( KMPrinter *  pr,
DrMain *  dr = 0,
TQWidget *  parent = 0,
const char *  name = 0 
)

Modified constructor.

For internal use only.

Definition at line 28 of file kprintdialogpage.cpp.

◆ ~KPrintDialogPage()

KPrintDialogPage::~KPrintDialogPage ( )
virtual

Destructor.

Definition at line 33 of file kprintdialogpage.cpp.

Member Function Documentation

◆ driver()

DrMain * KPrintDialogPage::driver ( )
inline

For internal use only.

Definition at line 176 of file kprintdialogpage.h.

◆ getOptions()

void KPrintDialogPage::getOptions ( TQMap< TQString, TQString > &  opts,
bool  incldef = false 
)
virtual

This function is called to fill the structure opts with the selected options from this dialog page.

If incldef is true, include also options with default values, otherwise discard them. Reimplement this function in subclasses.

Parameters
optsthe option set to fill
incldefif true, include also options with default values
See also
setOptions()

Definition at line 41 of file kprintdialogpage.cpp.

◆ id()

int KPrintDialogPage::id ( ) const
inline

Get the ID of the page.

Not used yet.

Returns
the page ID
See also
setId()

Definition at line 135 of file kprintdialogpage.h.

◆ isValid()

bool KPrintDialogPage::isValid ( TQString &  msg)
virtual

Returns true if options selected in the page are valid (no conflict), false otherwise.

When returning false, msg should contain an error message explaining what is wrong in the selected options.

Parameters
msgshould contain an error message when returning false
Returns
valid status

Definition at line 45 of file kprintdialogpage.cpp.

◆ onlyRealPrinters()

bool KPrintDialogPage::onlyRealPrinters ( ) const
inline

Tell wether or not the page should be disable if a non real printer (special printer) is selected in the print dialog.

Returns false by default. Application specific pages usually corresponds to printer-independent options, so the page should be kept enabled whatever the selected printer. The default value is then correct and your application doesn't to change anything.

Returns
true if the page should be disabled for non real printers
See also
setOnlyRealPrinters()

Definition at line 164 of file kprintdialogpage.h.

◆ printer()

KMPrinter * KPrintDialogPage::printer ( )
inline

For internal use only.

Definition at line 180 of file kprintdialogpage.h.

◆ setId()

void KPrintDialogPage::setId ( int  ID)
inline

Set the ID of the page.

Not used yet.

Parameters
IDthe ID number
See also
id()

Definition at line 141 of file kprintdialogpage.h.

◆ setOnlyRealPrinters()

void KPrintDialogPage::setOnlyRealPrinters ( bool  on = true)
inline

Change the page state when a non real printer is selected in the print dialog.

Usually, the default value (false) is OK in most cases and you don't need to call this function explicitly.

Parameters
onif true, then the page will be disabled if a non real printer is selected
See also
onlyRealPrinters()

Definition at line 172 of file kprintdialogpage.h.

◆ setOptions()

void KPrintDialogPage::setOptions ( const TQMap< TQString, TQString > &  opts)
virtual

This function is called to update the current page with the options contained in opts.

Reimplement it in subclasses.

Parameters
optsthe structure containing the options to update the page

Definition at line 37 of file kprintdialogpage.cpp.

◆ setTitle()

void KPrintDialogPage::setTitle ( const TQString &  txt)
inline

Set the page title.

This title will be used as tab name for this page in the print dialog.

Parameters
txtthe page title
See also
title()

Definition at line 154 of file kprintdialogpage.h.

◆ title()

TQString KPrintDialogPage::title ( ) const
inline

Get the page title.

Returns
the page title
See also
setTitle()

Definition at line 147 of file kprintdialogpage.h.

Member Data Documentation

◆ m_driver

DrMain* KPrintDialogPage::m_driver
protected

Definition at line 184 of file kprintdialogpage.h.

◆ m_ID

int KPrintDialogPage::m_ID
protected

Definition at line 185 of file kprintdialogpage.h.

◆ m_onlyreal

bool KPrintDialogPage::m_onlyreal
protected

Definition at line 187 of file kprintdialogpage.h.

◆ m_printer

KMPrinter* KPrintDialogPage::m_printer
protected

Definition at line 183 of file kprintdialogpage.h.

◆ m_title

TQString KPrintDialogPage::m_title
protected

Definition at line 186 of file kprintdialogpage.h.


The documentation for this class was generated from the following files:
  • kprintdialogpage.h
  • kprintdialogpage.cpp

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
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.9.4
This website is maintained by Timothy Pearson.