printstyle.h
00001 /* -*- C++ -*- 00002 This file declares the abstract print style base class. 00003 00004 the KDE addressbook 00005 00006 $ Author: Mirko Boehm $ 00007 $ Copyright: (C) 1996-2002, Mirko Boehm $ 00008 $ Contact: mirko@kde.org 00009 http://www.kde.org $ 00010 $ License: LGPL with the following explicit clarification: 00011 This code may be linked against any version of the Qt toolkit 00012 from Troll Tech, Norway. $ 00013 00014 $Revision: 1.6 $ 00015 */ 00016 00017 #ifndef PRINTSTYLE_H 00018 #define PRINTSTYLE_H 00019 00020 #include <qwidget.h> 00021 #include <qstringlist.h> 00022 #include <qpixmap.h> 00023 00024 namespace KABPrinting { 00025 00026 class PrintingWizard; 00027 class PrintProgress; 00028 00051 class PrintStyle : public QObject 00052 { 00053 Q_OBJECT 00054 00055 public: 00056 PrintStyle( PrintingWizard* parent, const char* name = 0 ); 00057 virtual ~PrintStyle(); 00058 00062 virtual void print(QStringList contacts, PrintProgress*)=0; 00063 00069 const QPixmap& preview(); 00070 00074 void hidePages(); 00075 00079 void showPages(); 00080 00081 protected: 00093 bool setPreview( const QString& fileName ); 00094 00098 void setPreview( const QPixmap& image ); 00099 00103 PrintingWizard *wizard(); 00104 00109 void addPage( QWidget *page, const QString &title ); 00110 00111 private: 00112 PrintingWizard *mWizard; 00113 QPixmap mPreview; 00114 QPtrList<QWidget> mPageList; 00115 QStringList mPageTitles; 00116 }; 00117 00118 00125 class PrintStyleFactory 00126 { 00127 public: 00128 PrintStyleFactory( PrintingWizard* parent, const char* name = 0 ); 00129 virtual ~PrintStyleFactory(); 00130 virtual PrintStyle *create() = 0; 00131 00136 virtual QString description() = 0; 00137 00138 protected: 00139 PrintingWizard* mParent; 00140 const char* mName; 00141 }; 00142 00143 } 00144 00145 #endif