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