kaddressbook Library API Documentation

KABPrinting::PrintStyle Class Reference

The class PrintStyle implements the abstract interface to the PrintingWizards style objects. More...

#include <printstyle.h>

Inheritance diagram for KABPrinting::PrintStyle:

QObject List of all members.

Public Methods

 PrintStyle (PrintingWizard *parent, const char *name=0)
virtual ~PrintStyle ()
virtual void print (KABC::Addressee::List &contacts, PrintProgress *)=0
const QPixmappreview ()
void hidePages ()
void showPages ()
KABC::Field * preferredSortField ()
bool preferredSortType ()

Protected Methods

bool setPreview (const QString &fileName)
void setPreview (const QPixmap &image)
void setPreferredSortOptions (KABC::Field *field, bool ascending=true)
PrintingWizardwizard ()
void addPage (QWidget *page, const QString &title)

Detailed Description

The class PrintStyle implements 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 (right here :-), and edit Makefile.am to have it installed along with kaddressbook. Load it using setPreview(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 60 of file printstyle.h.


Member Function Documentation

virtual void KABPrinting::PrintStyle::print KABC::Addressee::List &    contacts,
PrintProgress  
[pure virtual]
 

Reimplement this method to actually print.

Referenced by KABPrinting::PrintingWizard::print().

const QPixmap & PrintStyle::preview  
 

Reimplement this method to provide a preview of what will be printed.

It returns an invalid QPixmap by default, resulting in a message that no preview is available.

Definition at line 44 of file printstyle.cpp.

Referenced by setPreview(), and KABPrinting::PrintingWizard::slotStyleSelected().

void PrintStyle::hidePages  
 

Hide all style specific pages in the wizard.

Definition at line 99 of file printstyle.cpp.

References QPtrList< QWidget >::first(), and QPtrList< QWidget >::next().

Referenced by KABPrinting::PrintingWizard::slotStyleSelected().

void PrintStyle::showPages  
 

Show all style specific pages in the wizard.

Definition at line 85 of file printstyle.cpp.

References QPtrList< QWidget >::first(), and QPtrList< QWidget >::next().

Referenced by KABPrinting::PrintingWizard::slotStyleSelected().

KABC::Field * PrintStyle::preferredSortField  
 

Returns the preferred sort criterion field.

Definition at line 111 of file printstyle.cpp.

Referenced by KABPrinting::PrintingWizard::slotStyleSelected().

bool PrintStyle::preferredSortType  
 

Returns the preferred sort type.

true = ascending false = descending

Definition at line 116 of file printstyle.cpp.

Referenced by KABPrinting::PrintingWizard::slotStyleSelected().

bool PrintStyle::setPreview const QString   fileName [protected]
 

Load the preview image from the kaddressbook data directory.

The image should be located in the subdirectory "printing". Give only the file name without any prefix as the parameter.

Definition at line 54 of file printstyle.cpp.

References QString::isEmpty(), QPixmap::load(), and preview().

void PrintStyle::setPreview const QPixmap   image [protected]
 

Set the preview image.

Definition at line 49 of file printstyle.cpp.

void PrintStyle::setPreferredSortOptions KABC::Field *    field,
bool    ascending = true
[protected]
 

Set preferred sort options for this printing style.

Definition at line 105 of file printstyle.cpp.

PrintingWizard * PrintStyle::wizard   [protected]
 

Return the wizard object.

Definition at line 72 of file printstyle.cpp.

void PrintStyle::addPage QWidget   page,
const QString   title
[protected]
 

Add additional page to the wizard e.g.

a configuration page for the style.

Definition at line 77 of file printstyle.cpp.

References QPtrList< QWidget >::append(), and QPtrList< QWidget >::find().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kaddressbook Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:38:54 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003