korganizer Library API Documentation

calprinter.h

00001 /* 00002 This file is part of KOrganizer. 00003 00004 Copyright (c) 1998 Preston Brown 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 00020 As a special exception, permission is given to link this program 00021 with any edition of Qt, and distribute the resulting executable, 00022 without including the source code for Qt in the source distribution. 00023 */ 00024 #ifndef _CALPRINTER_H 00025 #define _CALPRINTER_H 00026 00027 // #define KORG_NOPRINTER 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
KDE Logo
This file is part of the documentation for korganizer Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Oct 21 19:46:55 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003