kaddressbook
#include <printstyle.h>
Public Member Functions | |
PrintStyle (PrintingWizard *wizard) | |
virtual | ~PrintStyle () |
void | hidePages () |
ContactFields::Field | preferredSortField () const |
Qt::SortOrder | preferredSortOrder () const |
const QPixmap & | preview () const |
virtual void | print (const KABC::Addressee::List &contacts, PrintProgress *progress)=0 |
void | showPages () |
Protected Member Functions | |
void | addPage (QWidget *page, const QString &title) |
void | setPreferredSortOptions (ContactFields::Field, Qt::SortOrder sortOrder=Qt::AscendingOrder) |
bool | setPreview (const QString &fileName) |
void | setPreview (const QPixmap &image) |
PrintingWizard * | wizard () const |
Detailed Description
The abstract interface to the PrintingWizards style objects.
To implement a print style, derive from this class and read the information in printingwizard.h to see how this two pieces work together. Basically, the print style gets the contacts it is supposed to print from the PrintingWizard is will not change this set - neither its content nor its order.
To register your new style in the printing wizard, you need to define a PrintStyleFactory that handles how your objects are created and deleted. See the existing print styles for examples.
A print style should have a preview image that gives the user a basic impression on how it will look. Add this image to the printing folder and edit CMakeLists.txt to have it installed along with kaddressbook. Load it using setPreview( const QString& ).
Your print style is supposed to add its options as pages to the printing wizard. The method wizard() gives you a pointer to the wizard object.
Definition at line 67 of file printstyle.h.
Constructor & Destructor Documentation
|
explicit |
Creates a new print style.
The wizard the style belongs to.
Definition at line 35 of file printstyle.cpp.
|
virtual |
Destroys the print style.
Definition at line 42 of file printstyle.cpp.
Member Function Documentation
|
protected |
Adds an additional page to the printing wizard, e.g.
a configuration page for the style.
- Parameters
-
page The page widget. tile The page title.
Definition at line 80 of file printstyle.cpp.
void PrintStyle::hidePages | ( | ) |
Hides all style specific pages in the printing wizard.
Definition at line 105 of file printstyle.cpp.
ContactFields::Field PrintStyle::preferredSortField | ( | ) | const |
Returns the preferred contact field that shall be used for sorting.
Definition at line 118 of file printstyle.cpp.
Qt::SortOrder PrintStyle::preferredSortOrder | ( | ) | const |
Returns the preferred order that shall be used for sorting.
Definition at line 123 of file printstyle.cpp.
const QPixmap & PrintStyle::preview | ( | ) | const |
This method should be reimplemented to provide a preview of what the printed page will look like.
An invalid pixmap is returned by default, which means no preview is available.
Definition at line 46 of file printstyle.cpp.
|
pure virtual |
This method must be reimplemented to actually print something.
- Parameters
-
contacts The filtered and sorted list of contacts. progress The object to inform the user about the progress of printing.
Implemented in KABPrinting::CompactStyle, KABPrinting::MikesStyle, KABPrinting::DetailledPrintStyle, KABPrinting::RingBinderPrintStyle, and KABPrinting::GrantleePrintStyle.
|
protected |
Sets the preferred sort options for this printing style.
Definition at line 112 of file printstyle.cpp.
|
protected |
Loads the preview image from the kaddressbook data directory.
- Parameters
-
fileName The name of the preview image in the "printing" subdirectory without any prefix.
- Returns
- Whether the image was loaded successfully.
Definition at line 56 of file printstyle.cpp.
|
protected |
Sets the preview image
.
Definition at line 51 of file printstyle.cpp.
void PrintStyle::showPages | ( | ) |
Show all style specific pages in the printing wizard.
Definition at line 93 of file printstyle.cpp.
|
protected |
Returns the printing wizard that is responsible for this style.
Definition at line 75 of file printstyle.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.