.PP
.TH "KPrintDialogPage" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeprint Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KPrintDialogPage \- This class is intended to be used as base class for customized print dialog page. Base class for customized print dialog pages.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kprintdialogpage.h>\fP
.PP
Inherits \fBQWidget\fP.
.PP
Inherited by KPCopiesPage, KPDriverPage, KPFileSelectPage, KPFilterPage, KPGeneralPage, KPHpgl2Page, KPImagePage, KPMarginPage, KPPosterPage, KPQtPage, KPSchedulePage, KPTagsPage, and KPTextPage.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKPrintDialogPage\fP (\fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "\fBKPrintDialogPage\fP (KMPrinter *pr, DrMain *dr=0, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "virtual \fB~KPrintDialogPage\fP ()"
.br
.ti -1c
.RI "virtual void \fBgetOptions\fP (\fBQMap\fP< \fBQString\fP, \fBQString\fP > &opts, bool incldef=false)"
.br
.ti -1c
.RI "virtual void \fBsetOptions\fP (const \fBQMap\fP< \fBQString\fP, \fBQString\fP > &opts)"
.br
.ti -1c
.RI "virtual bool \fBisValid\fP (\fBQString\fP &msg)"
.br
.ti -1c
.RI "int \fBid\fP () const "
.br
.ti -1c
.RI "void \fBsetId\fP (int ID)"
.br
.ti -1c
.RI "\fBQString\fP \fBtitle\fP () const "
.br
.ti -1c
.RI "void \fBsetTitle\fP (const \fBQString\fP &txt)"
.br
.ti -1c
.RI "bool \fBonlyRealPrinters\fP () const "
.br
.ti -1c
.RI "void \fBsetOnlyRealPrinters\fP (bool on=true)"
.br
.ti -1c
.RI "DrMain * \fBdriver\fP ()"
.br
.ti -1c
.RI "KMPrinter * \fBprinter\fP ()"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "KMPrinter * \fBm_printer\fP"
.br
.ti -1c
.RI "DrMain * \fBm_driver\fP"
.br
.ti -1c
.RI "int \fBm_ID\fP"
.br
.ti -1c
.RI "\fBQString\fP \fBm_title\fP"
.br
.ti -1c
.RI "bool \fBm_onlyreal\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
This class is intended to be used as base class for customized print dialog page. Base class for customized print dialog pages. 

One of the feature of the KDE 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 \fBisValid()\fP. The print options will be stored in the \fBKPrinter\fP object, and will be accessible via \fBKPrinter::option()\fP. The option name should follow the form 'kde-appname-optionname' for internal reasons.
.PP
.PP
.nf
 #include <kdeprint/kprintdialogpage.h>

 class MyDialogPage : public KPrintDialogPage
 {
 public:
   MyDialogPage( QWidget *parent = 0, const char *name = 0 );

   //reimplement virtual functions
   void getOptions( QMap<QString,QString>& opts, bool incldef = false );
   void setOptions( const QMap<QString,QString>& opts );
   bool isValid( QString& msg );

 private:
   QComboBox *m_fontcombo;
 }

 MyDialogPage::MyDialogPage( QWidget *parent, const char *name )
 : KPrintDialogPage( parent, name )
 {
   setTitle( i18n( 'My Page' ) );
 }

 void MyDialogPage::getOptions( QMap<QString,QString>& opts, bool incldef )
 {
   if ( incldef || m_fontcombo->currentText() != mydefaultvalue )
     opts[ 'kde-myapp-fontname' ] = m_fontcombo->currentText();
 }

 void MyDialogPage::setOptions( const QMap<QString,QString>& opts )
 {
   QString fntname = opts[ 'kde-myapp-fontname' ];
   m_fontcombo->setEditText( fntname );
 }

 bool MyDialogPage::isValid( QString& msg)
 {
   if ( m_fontcombo->currentText().isEmpty() )
   {
     msg = i18n( 'Font name cannot be empty.' );
     return false;
   }
   return true;
 }
.fi
.PP
.PP
\fBSee also:\fP
.RS 4
\fBKPrinter\fP 
.RE
.PP

.PP
Definition at line 90 of file kprintdialogpage.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KPrintDialogPage::KPrintDialogPage (\fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Standard constructor. 
.PP

.PP
Definition at line 23 of file kprintdialogpage.cpp.
.SS "KPrintDialogPage::KPrintDialogPage (KMPrinter * pr, DrMain * dr = \fC0\fP, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Modified constructor. 
.PP
For internal use only.
.PP
Definition at line 28 of file kprintdialogpage.cpp.
.SS "KPrintDialogPage::~\fBKPrintDialogPage\fP ()\fC [virtual]\fP"
.PP
Destructor. 
.PP
Definition at line 33 of file kprintdialogpage.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KPrintDialogPage::getOptions (\fBQMap\fP< \fBQString\fP, \fBQString\fP > & opts, bool incldef = \fCfalse\fP)\fC [virtual]\fP"
.PP
This function is called to fill the structure \fCopts\fP with the selected options from this dialog page. 
.PP
If \fCincldef\fP is true, include also options with default values, otherwise discard them. Reimplement this function in subclasses. 
.PP
\fBParameters:\fP
.RS 4
\fIopts\fP the option set to fill 
.br
\fIincldef\fP if true, include also options with default values 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetOptions()\fP
.RE
.PP

.PP
Definition at line 41 of file kprintdialogpage.cpp.
.SS "void KPrintDialogPage::setOptions (const \fBQMap\fP< \fBQString\fP, \fBQString\fP > & opts)\fC [virtual]\fP"
.PP
This function is called to update the current page with the options contained in \fCopts\fP. 
.PP
Reimplement it in subclasses. 
.PP
\fBParameters:\fP
.RS 4
\fIopts\fP the structure containing the options to update the page
.RE
.PP

.PP
Definition at line 37 of file kprintdialogpage.cpp.
.SS "bool KPrintDialogPage::isValid (\fBQString\fP & msg)\fC [virtual]\fP"
.PP
Returns true if options selected in the page are valid (no conflict), false otherwise. 
.PP
When returning false, \fCmsg\fP should contain an error message explaining what is wrong in the selected options. 
.PP
\fBParameters:\fP
.RS 4
\fImsg\fP should contain an error message when returning false 
.RE
.PP
\fBReturns:\fP
.RS 4
valid status
.RE
.PP

.PP
Definition at line 45 of file kprintdialogpage.cpp.
.SS "int KPrintDialogPage::id () const\fC [inline]\fP"
.PP
Get the ID of the page. 
.PP
Not used yet. 
.PP
\fBReturns:\fP
.RS 4
the page ID 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetId()\fP
.RE
.PP

.PP
Definition at line 135 of file kprintdialogpage.h.
.SS "void KPrintDialogPage::setId (int ID)\fC [inline]\fP"
.PP
Set the ID of the page. 
.PP
Not used yet. 
.PP
\fBParameters:\fP
.RS 4
\fIID\fP the ID number 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBid()\fP
.RE
.PP

.PP
Definition at line 141 of file kprintdialogpage.h.
.SS "\fBQString\fP KPrintDialogPage::title () const\fC [inline]\fP"
.PP
Get the page title. 
.PP
\fBReturns:\fP
.RS 4
the page title 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetTitle()\fP
.RE
.PP

.PP
Definition at line 147 of file kprintdialogpage.h.
.SS "void KPrintDialogPage::setTitle (const \fBQString\fP & txt)\fC [inline]\fP"
.PP
Set the page title. 
.PP
This title will be used as tab name for this page in the print dialog. 
.PP
\fBParameters:\fP
.RS 4
\fItxt\fP the page title 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBtitle()\fP
.RE
.PP

.PP
Definition at line 154 of file kprintdialogpage.h.
.SS "bool KPrintDialogPage::onlyRealPrinters () const\fC [inline]\fP"
.PP
Tell wether or not the page should be disable if a non real printer (special printer) is selected in the print dialog. 
.PP
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. 
.PP
\fBReturns:\fP
.RS 4
true if the page should be disabled for non real printers 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetOnlyRealPrinters()\fP
.RE
.PP

.PP
Definition at line 164 of file kprintdialogpage.h.
.SS "void KPrintDialogPage::setOnlyRealPrinters (bool on = \fCtrue\fP)\fC [inline]\fP"
.PP
Change the page state when a non real printer is selected in the print dialog. 
.PP
Usually, the default value (false) is OK in most cases and you don't need to call this function explicitly. 
.PP
\fBParameters:\fP
.RS 4
\fIon\fP if true, then the page will be disabled if a non real printer is selected 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBonlyRealPrinters()\fP
.RE
.PP

.PP
Definition at line 172 of file kprintdialogpage.h.
.SS "DrMain* KPrintDialogPage::driver ()\fC [inline]\fP"
.PP
For internal use only. 
.PP

.PP
Definition at line 176 of file kprintdialogpage.h.
.SS "KMPrinter* KPrintDialogPage::printer ()\fC [inline]\fP"
.PP
For internal use only. 
.PP
Definition at line 180 of file kprintdialogpage.h.

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeprint Library from the source code.
