00001
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 <tqwidget.h>
00028 #include <tqstringlist.h>
00029 #include <tqpixmap.h>
00030
00031 #include <tdeabc/field.h>
00032
00033 namespace KABPrinting {
00034
00035 class PrintingWizard;
00036 class PrintProgress;
00037
00060 class PrintStyle : public TQObject
00061 {
00062 Q_OBJECT
00063
00064
00065 public:
00066 PrintStyle( PrintingWizard* parent, const char* name = 0 );
00067 virtual ~PrintStyle();
00068
00072 virtual void print( const TDEABC::Addressee::List &contacts, PrintProgress* ) = 0;
00073
00079 const TQPixmap& preview();
00080
00084 void hidePages();
00085
00089 void showPages();
00090
00094 TDEABC::Field* preferredSortField();
00095
00102 bool preferredSortType();
00103
00104 protected:
00111 bool setPreview( const TQString& fileName );
00112
00116 void setPreview( const TQPixmap& image );
00117
00121 void setPreferredSortOptions( TDEABC::Field *field, bool ascending = true );
00122
00126 PrintingWizard *wizard();
00127
00132 void addPage( TQWidget *page, const TQString &title );
00133
00134 private:
00135 PrintingWizard *mWizard;
00136 TQPixmap mPreview;
00137 TQPtrList<TQWidget> mPageList;
00138 TQStringList mPageTitles;
00139
00140 TDEABC::Field *mSortField;
00141 bool mSortType;
00142 };
00143
00144
00151 class PrintStyleFactory
00152 {
00153 public:
00154 PrintStyleFactory( PrintingWizard* parent, const char* name = 0 );
00155 virtual ~PrintStyleFactory();
00156
00157 virtual PrintStyle *create() const = 0;
00158
00163 virtual TQString description() const = 0;
00164
00165 protected:
00166 PrintingWizard* mParent;
00167 const char* mName;
00168 };
00169
00170 }
00171
00172 #endif