• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kaddressbook

  • KABPrinting
  • PrintStyle
Public Member Functions | Protected Member Functions | List of all members
KABPrinting::PrintStyle Class Referenceabstract

#include <printstyle.h>

Inheritance diagram for KABPrinting::PrintStyle:
Inheritance graph
[legend]

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

PrintStyle::PrintStyle ( PrintingWizard *  wizard)
explicit

Creates a new print style.

The wizard the style belongs to.

Definition at line 35 of file printstyle.cpp.

PrintStyle::~PrintStyle ( )
virtual

Destroys the print style.

Definition at line 42 of file printstyle.cpp.

Member Function Documentation

void PrintStyle::addPage ( QWidget *  page,
const QString &  title 
)
protected

Adds an additional page to the printing wizard, e.g.

a configuration page for the style.

Parameters
pageThe page widget.
tileThe 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.

virtual void KABPrinting::PrintStyle::print ( const KABC::Addressee::List &  contacts,
PrintProgress *  progress 
)
pure virtual

This method must be reimplemented to actually print something.

Parameters
contactsThe filtered and sorted list of contacts.
progressThe object to inform the user about the progress of printing.

Implemented in KABPrinting::CompactStyle, KABPrinting::MikesStyle, KABPrinting::DetailledPrintStyle, KABPrinting::RingBinderPrintStyle, and KABPrinting::GrantleePrintStyle.

void PrintStyle::setPreferredSortOptions ( ContactFields::Field  field,
Qt::SortOrder  sortOrder = Qt::AscendingOrder 
)
protected

Sets the preferred sort options for this printing style.

Definition at line 112 of file printstyle.cpp.

bool PrintStyle::setPreview ( const QString &  fileName)
protected

Loads the preview image from the kaddressbook data directory.

Parameters
fileNameThe 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.

void PrintStyle::setPreview ( const QPixmap &  image)
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.

PrintingWizard * PrintStyle::wizard ( ) const
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:
  • printstyle.h
  • printstyle.cpp
This file is part of the KDE documentation.
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.

kaddressbook

Skip menu "kaddressbook"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal