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

kaddressbook

  • sources
  • kde-4.12
  • kdepim
  • kaddressbook
  • printing
printstyle.h
Go to the documentation of this file.
1 /*
2  This file is part of KAddressBook.
3  Copyright (c) 1996-2002 Mirko Boehm <mirko@kde.org>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 
19  As a special exception, permission is given to link this program
20  with any edition of Qt, and distribute the resulting executable,
21  without including the source code for Qt in the source distribution.
22 */
23 
24 #ifndef PRINTSTYLE_H
25 #define PRINTSTYLE_H
26 
27 #include "contactfields.h"
28 
29 #include <KABC/Addressee>
30 
31 #include <QtCore/QHash>
32 #include <QtCore/QStringList>
33 #include <QPixmap>
34 #include <QWidget>
35 
36 class KPageWidgetItem;
37 
38 namespace KABPrinting {
39 
40 class PrintingWizard;
41 class PrintProgress;
42 
67 class PrintStyle : public QObject
68 {
69  Q_OBJECT
70 
71  public:
77  explicit PrintStyle( PrintingWizard *wizard );
78 
82  virtual ~PrintStyle();
83 
90  virtual void print( const KABC::Addressee::List &contacts, PrintProgress *progress ) = 0;
91 
99  const QPixmap &preview() const;
100 
104  void hidePages();
105 
109  void showPages();
110 
114  ContactFields::Field preferredSortField() const;
115 
119  Qt::SortOrder preferredSortOrder() const;
120 
121  protected:
129  bool setPreview( const QString &fileName );
130 
134  void setPreview( const QPixmap &image );
135 
139  void setPreferredSortOptions( ContactFields::Field,
140  Qt::SortOrder sortOrder = Qt::AscendingOrder );
141 
145  PrintingWizard *wizard() const;
146 
154  void addPage( QWidget *page, const QString &title );
155 
156  private:
157  PrintingWizard *mWizard;
158  QPixmap mPreview;
159  QList<QWidget*> mPageList;
160  QHash<QWidget*, KPageWidgetItem*> mPageItems;
161  QStringList mPageTitles;
162 
163  ContactFields::Field mSortField;
164  Qt::SortOrder mSortOrder;
165 };
166 
171 class PrintStyleFactory
172 {
173  public:
174  explicit PrintStyleFactory( PrintingWizard *parent );
175  virtual ~PrintStyleFactory();
176 
177  virtual PrintStyle *create() const = 0;
178 
183  virtual QString description() const = 0;
184 
185  protected:
186  PrintingWizard *mParent;
187 };
188 
189 }
190 
191 #endif
KABPrinting::PrintStyleFactory::PrintStyleFactory
PrintStyleFactory(PrintingWizard *parent)
Definition: printstyle.cpp:128
KABPrinting::PrintStyleFactory::~PrintStyleFactory
virtual ~PrintStyleFactory()
Definition: printstyle.cpp:133
KABPrinting::PrintStyle::~PrintStyle
virtual ~PrintStyle()
Destroys the print style.
Definition: printstyle.cpp:42
KABPrinting::PrintStyleFactory::mParent
PrintingWizard * mParent
Definition: printstyle.h:186
contactfields.h
KABPrinting::PrintStyle::showPages
void showPages()
Show all style specific pages in the printing wizard.
Definition: printstyle.cpp:93
KABPrinting::PrintStyleFactory::create
virtual PrintStyle * create() const =0
KABPrinting::PrintingWizard
The PrintingWizard combines pages common for all print styles and those provided by the respective st...
Definition: printingwizard.h:55
QObject
KABPrinting::PrintStyle::setPreferredSortOptions
void setPreferredSortOptions(ContactFields::Field, Qt::SortOrder sortOrder=Qt::AscendingOrder)
Sets the preferred sort options for this printing style.
Definition: printstyle.cpp:112
KABPrinting::PrintStyleFactory::description
virtual QString description() const =0
Overload this method to provide a one-liner description for your print style.
KABPrinting::PrintStyle::addPage
void addPage(QWidget *page, const QString &title)
Adds an additional page to the printing wizard, e.g.
Definition: printstyle.cpp:80
KABPrinting::PrintStyle::PrintStyle
PrintStyle(PrintingWizard *wizard)
Creates a new print style.
Definition: printstyle.cpp:35
KABPrinting::PrintStyle::setPreview
bool setPreview(const QString &fileName)
Loads the preview image from the kaddressbook data directory.
Definition: printstyle.cpp:56
KABPrinting::PrintStyle::preferredSortOrder
Qt::SortOrder preferredSortOrder() const
Returns the preferred order that shall be used for sorting.
Definition: printstyle.cpp:123
KABPrinting::PrintStyle
The abstract interface to the PrintingWizards style objects.
Definition: printstyle.h:67
KABPrinting::PrintStyle::hidePages
void hidePages()
Hides all style specific pages in the printing wizard.
Definition: printstyle.cpp:105
KABPrinting::PrintStyle::wizard
PrintingWizard * wizard() const
Returns the printing wizard that is responsible for this style.
Definition: printstyle.cpp:75
KABPrinting::PrintStyle::print
virtual void print(const KABC::Addressee::List &contacts, PrintProgress *progress)=0
This method must be reimplemented to actually print something.
KABPrinting::PrintProgress
This defines a simple widget to display print progress information.
Definition: printprogress.h:41
KABPrinting::PrintStyleFactory
The factories are used to have all object of the respective print style created in one place...
Definition: printstyle.h:171
KABPrinting::PrintStyle::preview
const QPixmap & preview() const
This method should be reimplemented to provide a preview of what the printed page will look like...
Definition: printstyle.cpp:46
ContactFields::Field
Field
Describes the standard fields that are available for every contact.
Definition: contactfields.h:33
KABPrinting::PrintStyle::preferredSortField
ContactFields::Field preferredSortField() const
Returns the preferred contact field that shall be used for sorting.
Definition: printstyle.cpp:118
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:51 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