From 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kaddressbook/printing/printingwizard.h | 115 +++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 kaddressbook/printing/printingwizard.h (limited to 'kaddressbook/printing/printingwizard.h') diff --git a/kaddressbook/printing/printingwizard.h b/kaddressbook/printing/printingwizard.h new file mode 100644 index 000000000..528aac71f --- /dev/null +++ b/kaddressbook/printing/printingwizard.h @@ -0,0 +1,115 @@ +/* + This file is part of KAddressBook. + Copyright (c) 1996-2002 Mirko Boehm + Tobias Koenig + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#ifndef PRINTINGWIZARD_H +#define PRINTINGWIZARD_H + +#include +#include + +#include + +#include "common/filter.h" +#include "kabc/addressbook.h" +#include "printstyle.h" + +#include "selectionpage.h" +#include "stylepage.h" + + +class KPrinter; +class QVBoxLayout; + +namespace KABPrinting { + +/** + The PrintingWizard combines pages common for all print styles + and those provided by the respective style. +*/ +class PrintingWizard : public KWizard +{ + Q_OBJECT + + public: + /** + Construct a printing wizard. Give the addressbook instance to print. + */ + PrintingWizard( KPrinter *printer, + KABC::AddressBook* ab, + const QStringList& selection, + QWidget *parent = 0, const char *name = 0 ); + ~PrintingWizard(); + + /** + Modify this method to add a new PrintStyle. + */ + void registerStyles(); + + /** + Perform the actual printing. + */ + void print(); + + /** + Retrieve the document object. + */ + KABC::AddressBook *addressBook(); + + /** + Retrieve the printer to be used. + */ + KPrinter* printer(); + + protected slots: + /** + A print style has been selected. The argument is the index + in the cbStyle combo and in styles. + */ + void slotStyleSelected(int); + + protected: + QPtrList mStyleFactories; + QPtrList mStyleList; + Filter::List mFilters; + KPrinter *mPrinter; + KABC::AddressBook *mAddressBook; + QStringList mSelection; + PrintStyle *mStyle; + + StylePage *mStylePage; + SelectionPage *mSelectionPage; + + /** + Overloaded accept slot. This is used to do the actual + printing without having the wizard disappearing + before. What happens is actually up to the print style, + since it does the printing. It could display a progress + window, for example (hint, hint). + */ + void accept(); +}; + +} + +#endif -- cgit v1.2.1