KPrintDialogPage Class Reference
This class is intended to be used as base class for customized print dialog page. Base class for customized print dialog pages. More...
#include <kprintdialogpage.h>
Inheritance diagram for KPrintDialogPage:

Public Member Functions | |
KPrintDialogPage (QWidget *parent=0, const char *name=0) | |
KPrintDialogPage (KMPrinter *pr, DrMain *dr=0, QWidget *parent=0, const char *name=0) | |
virtual | ~KPrintDialogPage () |
virtual void | getOptions (QMap< QString, QString > &opts, bool incldef=false) |
virtual void | setOptions (const QMap< QString, QString > &opts) |
virtual bool | isValid (QString &msg) |
int | id () const |
void | setId (int ID) |
QString | title () const |
void | setTitle (const QString &txt) |
bool | onlyRealPrinters () const |
void | setOnlyRealPrinters (bool on=true) |
DrMain * | driver () |
KMPrinter * | printer () |
Protected Attributes | |
KMPrinter * | m_printer |
DrMain * | m_driver |
int | m_ID |
QString | m_title |
bool | m_onlyreal |
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 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 <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; }
- See also:
- KPrinter
Definition at line 88 of file kprintdialogpage.h.
Constructor & Destructor Documentation
|
Standard constructor.
Definition at line 23 of file kprintdialogpage.cpp. References KPrintDialogPage(). Referenced by KPrintDialogPage(). |
|
Modified constructor. For internal use only. Definition at line 28 of file kprintdialogpage.cpp. References KPrintDialogPage(). |
|
Destructor.
Definition at line 33 of file kprintdialogpage.cpp. |
Member Function Documentation
|
This function is called to fill the structure
If
Definition at line 41 of file kprintdialogpage.cpp. References getOptions(). Referenced by getOptions(). |
|
This function is called to update the current page with the options contained in Reimplement it in subclasses.
Definition at line 37 of file kprintdialogpage.cpp. References setOptions(). Referenced by setOptions(). |
|
Returns true if options selected in the page are valid (no conflict), false otherwise.
When returning false,
Definition at line 45 of file kprintdialogpage.cpp. References isValid(). Referenced by isValid(). |
|
Get the ID of the page. Not used yet.
Definition at line 133 of file kprintdialogpage.h. |
|
Set the ID of the page. Not used yet.
Definition at line 139 of file kprintdialogpage.h. References setId(). Referenced by setId(). |
|
Get the page title.
Definition at line 145 of file kprintdialogpage.h. |
|
Set the page title. This title will be used as tab name for this page in the print dialog.
Definition at line 152 of file kprintdialogpage.h. References setTitle(). Referenced by setTitle(). |
|
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.
Definition at line 162 of file kprintdialogpage.h. |
|
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.
Definition at line 170 of file kprintdialogpage.h. References setOnlyRealPrinters(). Referenced by setOnlyRealPrinters(). |
|
For internal use only.
Definition at line 174 of file kprintdialogpage.h. |
|
For internal use only.
Definition at line 178 of file kprintdialogpage.h. |
The documentation for this class was generated from the following files: