• 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 ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

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
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

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::DetailledPrintStyle, KABPrinting::MikesStyle, 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-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:34 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
  • pimprint

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