kaddressbook
printstyle.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef PRINTSTYLE_H
00025 #define PRINTSTYLE_H
00026
00027 #include <qwidget.h>
00028 #include <qstringlist.h>
00029 #include <qpixmap.h>
00030
00031 #include <kabc/field.h>
00032
00033 namespace KABPrinting {
00034
00035 class PrintingWizard;
00036 class PrintProgress;
00037
00060 class PrintStyle : public QObject
00061 {
00062 Q_OBJECT
00063
00064 public:
00065 PrintStyle( PrintingWizard* parent, const char* name = 0 );
00066 virtual ~PrintStyle();
00067
00071 virtual void print( const KABC::Addressee::List &contacts, PrintProgress* ) = 0;
00072
00078 const QPixmap& preview();
00079
00083 void hidePages();
00084
00088 void showPages();
00089
00093 KABC::Field* preferredSortField();
00094
00101 bool preferredSortType();
00102
00103 protected:
00110 bool setPreview( const QString& fileName );
00111
00115 void setPreview( const QPixmap& image );
00116
00120 void setPreferredSortOptions( KABC::Field *field, bool ascending = true );
00121
00125 PrintingWizard *wizard();
00126
00131 void addPage( QWidget *page, const QString &title );
00132
00133 private:
00134 PrintingWizard *mWizard;
00135 QPixmap mPreview;
00136 QPtrList<QWidget> mPageList;
00137 QStringList mPageTitles;
00138
00139 KABC::Field *mSortField;
00140 bool mSortType;
00141 };
00142
00143
00150 class PrintStyleFactory
00151 {
00152 public:
00153 PrintStyleFactory( PrintingWizard* parent, const char* name = 0 );
00154 virtual ~PrintStyleFactory();
00155
00156 virtual PrintStyle *create() const = 0;
00157
00162 virtual QString description() const = 0;
00163
00164 protected:
00165 PrintingWizard* mParent;
00166 const char* mName;
00167 };
00168
00169 }
00170
00171 #endif
|