korganizer
calprinter.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _CALPRINTER_H
00026 #define _CALPRINTER_H
00027
00028 #ifndef KORG_NOPRINTER
00029
00030 #include <qptrlist.h>
00031 #include <kdialogbase.h>
00032 #include <korganizer/baseview.h>
00033 #include <korganizer/printplugin.h>
00034 #include <kdepimmacros.h>
00035
00036 namespace KOrg {
00037 class CoreHelper;
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 class CalPrintHelper;
00049
00050
00056 class KDE_EXPORT CalPrinter : public QObject, public KOrg::CalPrinterBase
00057 {
00058 Q_OBJECT
00059
00060 public:
00061 enum ePrintOrientation {
00062 eOrientPlugin=0,
00063 eOrientPrinter,
00064 eOrientPortrait,
00065 eOrientLandscape
00066 };
00067 public:
00073 CalPrinter( QWidget *par, Calendar *cal, KOrg::CoreHelper *helper );
00074 virtual ~CalPrinter();
00075
00076 void init( KPrinter *printer, Calendar *calendar );
00077
00084 void setDateRange( const QDate &start, const QDate &end );
00085
00086 public slots:
00087 void updateConfig();
00088
00089 private slots:
00090 void doPrint( KOrg::PrintPlugin *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 KPrinter *printer() const;
00097 Calendar *calendar() const;
00098 KConfig *config() const;
00099
00100 protected:
00101 KOrg::PrintPlugin::List mPrintPlugins;
00102
00103 private:
00104 KPrinter *mPrinter;
00105 Calendar *mCalendar;
00106 QWidget *mParent;
00107 KConfig *mConfig;
00108 KOrg::CoreHelper *mCoreHelper;
00109 CalPrintHelper *mHelper;
00110 CalPrintDialog *mPrintDialog;
00111 };
00112
00113 class CalPrintDialog : public KDialogBase
00114 {
00115 Q_OBJECT
00116 public:
00117 CalPrintDialog( KOrg::PrintPlugin::List plugins, KPrinter *p,
00118 QWidget *parent = 0, const char *name = 0 );
00119 virtual ~CalPrintDialog();
00120 KOrg::PrintPlugin *selectedPlugin();
00121 CalPrinter::ePrintOrientation orientation() { return mOrientation; }
00122
00123 public slots:
00124 void setPrintType( int );
00125 void setPreview( bool );
00126
00127 protected slots:
00128 void slotOk();
00129
00130 private:
00131 KPrinter *mPrinter;
00132 QVButtonGroup *mTypeGroup;
00133 QWidgetStack *mConfigArea;
00134 KOrg::PrintPlugin::List mPrintPlugins;
00135 QString mPreviewText;
00136 QComboBox *mOrientationSelection;
00137
00138 CalPrinter::ePrintOrientation mOrientation;
00139 };
00140
00141 #endif
00142
00143 #endif
|