calprinter.h
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 _CALPRINTER_H
00025 #define _CALPRINTER_H
00026
00027
00028
00029 #ifndef KORG_NOPRINTER
00030
00031 #include <qptrlist.h>
00032
00033 #include <kdialogbase.h>
00034
00035 #include <korganizer/baseview.h>
00036
00037 #include "calprintbase.h"
00038
00039 using namespace KCal;
00040
00041 class QVButtonGroup;
00042 class QWidgetStack;
00043 class KPrinter;
00044 class CalPrintDialog;
00045 class KConfig;
00046 class QComboBox;
00047 class QLabel;
00048
00049
00055 class CalPrinter : public QObject, public KOrg::CalPrinterBase
00056 {
00057 Q_OBJECT
00058
00059 public:
00060 enum ePrintOrientation {
00061 eOrientPlugin=0,
00062 eOrientPrinter,
00063 eOrientPortrait,
00064 eOrientLandscape
00065 };
00066 public:
00071 CalPrinter( QWidget *par, Calendar *cal );
00072 virtual ~CalPrinter();
00073
00074 void init( KPrinter *printer, Calendar *calendar );
00075
00076 void setupPrinter();
00077
00084 void setDateRange( const QDate &start, const QDate &end );
00085
00086 public slots:
00087 void updateConfig();
00088
00089 private slots:
00090 void doPrint( CalPrintBase *selectedStyle, bool preview );
00091
00092 public:
00093 void preview( PrintType type, const QDate &fd, const QDate &td );
00094 void print( PrintType type, const QDate &fd, const QDate &td );
00095
00096 protected:
00097 QPtrList<CalPrintBase> mPrintPlugins;
00098
00099 private:
00100 KPrinter *mPrinter;
00101 Calendar *mCalendar;
00102 QWidget *mParent;
00103 KConfig *mConfig;
00104
00105 CalPrintDialog *mPrintDialog;
00106 };
00107
00108 class CalPrintDialog : public KDialogBase
00109 {
00110 Q_OBJECT
00111 public:
00112 CalPrintDialog( QPtrList<CalPrintBase> plugins, KPrinter *p,
00113 QWidget *parent = 0, const char *name = 0 );
00114 virtual ~CalPrintDialog();
00115 CalPrintBase *selectedPlugin();
00116 CalPrinter::ePrintOrientation orientation() { return mOrientation; }
00117
00118 public slots:
00119 void setPrintType( int );
00120 void setPreview( bool );
00121
00122 protected slots:
00123 void slotOk();
00124 void setupPrinter();
00125 void setPrinterLabel();
00126
00127 private:
00128 KPrinter *mPrinter;
00129 QVButtonGroup *mTypeGroup;
00130 QWidgetStack *mConfigArea;
00131 QPtrList<CalPrintBase> mPrintPlugins;
00132 QLabel *mPrinterLabel;
00133 QString mPreviewText;
00134 QComboBox *mOrientationSelection;
00135
00136 CalPrinter::ePrintOrientation mOrientation;
00137 };
00138
00139 #endif
00140
00141 #endif
This file is part of the documentation for korganizer Library Version 3.2.2.