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 CalPrintDialog;
00044 class KConfig;
00045 class QComboBox;
00046 class QLabel;
00047
00053 class KDE_EXPORT CalPrinter : public QObject, public KOrg::CalPrinterBase
00054 {
00055 Q_OBJECT
00056
00057 public:
00058 enum ePrintOrientation {
00059 eOrientPlugin=0,
00060 eOrientPrinter,
00061 eOrientPortrait,
00062 eOrientLandscape
00063 };
00064 public:
00070 CalPrinter( QWidget *par, Calendar *cal, KOrg::CoreHelper *helper );
00071 virtual ~CalPrinter();
00072
00073 void init( Calendar *calendar );
00074
00081 void setDateRange( const QDate &start, const QDate &end );
00082
00083 public slots:
00084 void updateConfig();
00085
00086 private slots:
00087 void doPrint( KOrg::PrintPlugin *selectedStyle, CalPrinter::ePrintOrientation dlgorientation, bool preview = false );
00088
00089 public:
00090 void print( int type, const QDate &fd, const QDate &td,
00091 Incidence::List selectedIncidences = Incidence::List(), bool preview = false );
00092
00093 Calendar *calendar() const;
00094 KConfig *config() const;
00095
00096 protected:
00097 KOrg::PrintPlugin::List mPrintPlugins;
00098
00099 private:
00100 Calendar *mCalendar;
00101 QWidget *mParent;
00102 KConfig *mConfig;
00103 KOrg::CoreHelper *mCoreHelper;
00104 };
00105
00106 class CalPrintDialog : public KDialogBase
00107 {
00108 Q_OBJECT
00109 public:
00110 CalPrintDialog( KOrg::PrintPlugin::List plugins,
00111 QWidget *parent = 0, const char *name = 0 );
00112 virtual ~CalPrintDialog();
00113 KOrg::PrintPlugin *selectedPlugin();
00114 void setOrientation( CalPrinter::ePrintOrientation orientation );
00115 CalPrinter::ePrintOrientation orientation() { return mOrientation; }
00116
00117 public slots:
00118 void setPrintType( int );
00119 void setPreview( bool );
00120
00121 protected slots:
00122 void slotOk();
00123
00124 private:
00125 QVButtonGroup *mTypeGroup;
00126 QWidgetStack *mConfigArea;
00127 QMap<int, KOrg::PrintPlugin*> mPluginIDs;
00128 QString mPreviewText;
00129 QComboBox *mOrientationSelection;
00130
00131 CalPrinter::ePrintOrientation mOrientation;
00132 };
00133
00134 #endif
00135
00136 #endif
|