\section{KPrint\-Dialog\-Page Class Reference}
\label{classKPrintDialogPage}\index{KPrintDialogPage@{KPrintDialogPage}}
This class is intended to be used as base class for customized print dialog page. Base class for customized print dialog pages.  


{\tt \#include $<$kprintdialogpage.h$>$}

Inheritance diagram for KPrint\-Dialog\-Page:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=65pt]{classKPrintDialogPage__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KPrint\-Dialog\-Page:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=81pt]{classKPrintDialogPage__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KPrint\-Dialog\-Page} ({\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
{\bf KPrint\-Dialog\-Page} (KMPrinter $\ast$pr, Dr\-Main $\ast$dr=0, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
virtual {\bf $\sim$KPrint\-Dialog\-Page} ()
\item 
virtual void {\bf get\-Options} ({\bf QMap}$<$ {\bf QString}, {\bf QString} $>$ \&opts, bool incldef=false)
\item 
virtual void {\bf set\-Options} (const {\bf QMap}$<$ {\bf QString}, {\bf QString} $>$ \&opts)
\item 
virtual bool {\bf is\-Valid} ({\bf QString} \&msg)
\item 
int {\bf id} () const 
\item 
void {\bf set\-Id} (int ID)
\item 
{\bf QString} {\bf title} () const 
\item 
void {\bf set\-Title} (const {\bf QString} \&txt)
\item 
bool {\bf only\-Real\-Printers} () const 
\item 
void {\bf set\-Only\-Real\-Printers} (bool on=true)
\item 
Dr\-Main $\ast$ {\bf driver} ()
\item 
KMPrinter $\ast$ {\bf printer} ()
\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
KMPrinter $\ast$ {\bf m\_\-printer}\label{classKPrintDialogPage_p0}

\item 
Dr\-Main $\ast$ {\bf m\_\-driver}\label{classKPrintDialogPage_p1}

\item 
int {\bf m\_\-ID}\label{classKPrintDialogPage_p2}

\item 
{\bf QString} {\bf m\_\-title}\label{classKPrintDialogPage_p3}

\item 
bool {\bf m\_\-onlyreal}\label{classKPrintDialogPage_p4}

\end{CompactItemize}


\subsection{Detailed Description}
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 KPrint\-Dialog\-Page and reimplementing the 3 virtual functions get\-Options, set\-Options and {\bf is\-Valid()}{\rm (p.\,\pageref{classKPrintDialogPage_a5})}. The print options will be stored in the {\bf KPrinter}{\rm (p.\,\pageref{classKPrinter})} object, and will be accessible via {\bf KPrinter::option()}{\rm (p.\,\pageref{classKPrinter_a59})}. The option name should follow the form \char`\"{}kde-appname-optionname\char`\"{} for internal reasons.



\footnotesize\begin{verbatim} #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;
 }
\end{verbatim}
\normalsize


\begin{Desc}
\item[See also:]{\bf KPrinter}{\rm (p.\,\pageref{classKPrinter})} \end{Desc}




Definition at line 90 of file kprintdialogpage.h.

\subsection{Constructor \& Destructor Documentation}
\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!KPrintDialogPage@{KPrintDialogPage}}
\index{KPrintDialogPage@{KPrintDialogPage}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPrint\-Dialog\-Page::KPrint\-Dialog\-Page ({\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKPrintDialogPage_a0}


Standard constructor. 



Definition at line 23 of file kprintdialogpage.cpp.\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!KPrintDialogPage@{KPrintDialogPage}}
\index{KPrintDialogPage@{KPrintDialogPage}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPrint\-Dialog\-Page::KPrint\-Dialog\-Page (KMPrinter $\ast$ {\em pr}, Dr\-Main $\ast$ {\em dr} = {\tt 0}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKPrintDialogPage_a1}


Modified constructor. 

For internal use only.

Definition at line 28 of file kprintdialogpage.cpp.\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!~KPrintDialogPage@{$\sim$KPrintDialogPage}}
\index{~KPrintDialogPage@{$\sim$KPrintDialogPage}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPrint\-Dialog\-Page::$\sim${\bf KPrint\-Dialog\-Page} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKPrintDialogPage_a2}


Destructor. 



Definition at line 33 of file kprintdialogpage.cpp.

\subsection{Member Function Documentation}
\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!getOptions@{getOptions}}
\index{getOptions@{getOptions}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPrint\-Dialog\-Page::get\-Options ({\bf QMap}$<$ {\bf QString}, {\bf QString} $>$ \& {\em opts}, bool {\em incldef} = {\tt false})\hspace{0.3cm}{\tt  [virtual]}}\label{classKPrintDialogPage_a3}


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

If {\tt incldef} is true, include also options with default values, otherwise discard them. Reimplement this function in subclasses. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em opts}]the option set to fill \item[{\em incldef}]if true, include also options with default values \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-Options()}{\rm (p.\,\pageref{classKPrintDialogPage_a4})}\end{Desc}


Definition at line 41 of file kprintdialogpage.cpp.\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!setOptions@{setOptions}}
\index{setOptions@{setOptions}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPrint\-Dialog\-Page::set\-Options (const {\bf QMap}$<$ {\bf QString}, {\bf QString} $>$ \& {\em opts})\hspace{0.3cm}{\tt  [virtual]}}\label{classKPrintDialogPage_a4}


This function is called to update the current page with the options contained in {\tt opts}. 

Reimplement it in subclasses. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em opts}]the structure containing the options to update the page\end{description}
\end{Desc}


Definition at line 37 of file kprintdialogpage.cpp.\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!isValid@{isValid}}
\index{isValid@{isValid}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KPrint\-Dialog\-Page::is\-Valid ({\bf QString} \& {\em msg})\hspace{0.3cm}{\tt  [virtual]}}\label{classKPrintDialogPage_a5}


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

When returning false, {\tt msg} should contain an error message explaining what is wrong in the selected options. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em msg}]should contain an error message when returning false \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]valid status\end{Desc}


Definition at line 45 of file kprintdialogpage.cpp.\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!id@{id}}
\index{id@{id}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KPrint\-Dialog\-Page::id () const\hspace{0.3cm}{\tt  [inline]}}\label{classKPrintDialogPage_a6}


Get the ID of the page. 

Not used yet. \begin{Desc}
\item[Returns:]the page ID \end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-Id()}{\rm (p.\,\pageref{classKPrintDialogPage_a7})}\end{Desc}


Definition at line 135 of file kprintdialogpage.h.\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!setId@{setId}}
\index{setId@{setId}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPrint\-Dialog\-Page::set\-Id (int {\em ID})\hspace{0.3cm}{\tt  [inline]}}\label{classKPrintDialogPage_a7}


Set the ID of the page. 

Not used yet. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ID}]the ID number \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf id()}{\rm (p.\,\pageref{classKPrintDialogPage_a6})}\end{Desc}


Definition at line 141 of file kprintdialogpage.h.\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!title@{title}}
\index{title@{title}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KPrint\-Dialog\-Page::title () const\hspace{0.3cm}{\tt  [inline]}}\label{classKPrintDialogPage_a8}


Get the page title. 

\begin{Desc}
\item[Returns:]the page title \end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-Title()}{\rm (p.\,\pageref{classKPrintDialogPage_a9})}\end{Desc}


Definition at line 147 of file kprintdialogpage.h.\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!setTitle@{setTitle}}
\index{setTitle@{setTitle}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPrint\-Dialog\-Page::set\-Title (const {\bf QString} \& {\em txt})\hspace{0.3cm}{\tt  [inline]}}\label{classKPrintDialogPage_a9}


Set the page title. 

This title will be used as tab name for this page in the print dialog. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em txt}]the page title \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf title()}{\rm (p.\,\pageref{classKPrintDialogPage_a8})}\end{Desc}


Definition at line 154 of file kprintdialogpage.h.\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!onlyRealPrinters@{onlyRealPrinters}}
\index{onlyRealPrinters@{onlyRealPrinters}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KPrint\-Dialog\-Page::only\-Real\-Printers () const\hspace{0.3cm}{\tt  [inline]}}\label{classKPrintDialogPage_a10}


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. \begin{Desc}
\item[Returns:]true if the page should be disabled for non real printers \end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-Only\-Real\-Printers()}{\rm (p.\,\pageref{classKPrintDialogPage_a11})}\end{Desc}


Definition at line 164 of file kprintdialogpage.h.\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!setOnlyRealPrinters@{setOnlyRealPrinters}}
\index{setOnlyRealPrinters@{setOnlyRealPrinters}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPrint\-Dialog\-Page::set\-Only\-Real\-Printers (bool {\em on} = {\tt true})\hspace{0.3cm}{\tt  [inline]}}\label{classKPrintDialogPage_a11}


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. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em on}]if true, then the page will be disabled if a non real printer is selected \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf only\-Real\-Printers()}{\rm (p.\,\pageref{classKPrintDialogPage_a10})}\end{Desc}


Definition at line 172 of file kprintdialogpage.h.\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!driver@{driver}}
\index{driver@{driver}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Dr\-Main$\ast$ KPrint\-Dialog\-Page::driver ()\hspace{0.3cm}{\tt  [inline]}}\label{classKPrintDialogPage_a12}


For internal use only. 



Definition at line 176 of file kprintdialogpage.h.\index{KPrintDialogPage@{KPrint\-Dialog\-Page}!printer@{printer}}
\index{printer@{printer}!KPrintDialogPage@{KPrint\-Dialog\-Page}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KMPrinter$\ast$ KPrint\-Dialog\-Page::printer ()\hspace{0.3cm}{\tt  [inline]}}\label{classKPrintDialogPage_a13}


For internal use only. 



Definition at line 180 of file kprintdialogpage.h.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kprintdialogpage.h\item 
kprintdialogpage.cpp\end{CompactItemize}
