21 #ifndef PRINTPLUGINBASE_H
22 #define PRINTPLUGINBASE_H
24 #ifndef KORG_NOPRINTER
26 #include <tqdatetime.h>
28 #include <calendar/plugin.h>
29 #include <libkcal/incidence.h>
44 enum PrintType { Incidence = 100, Day=200, Week=300, Month=400, Todolist=1000, Journallist=2000 };
55 mCalendar(0), mConfig(0) {}
58 typedef TQPtrList<PrintPlugin> List;
59 static int interfaceVersion() {
return 2; }
60 static TQString serviceType() {
return "KOrganizer/PrintPlugin"; }
62 virtual void setKOrgCoreHelper( KOrg::CoreHelper*helper ) { mCoreHelper = helper; }
63 virtual void setConfig( TDEConfig *cfg ) { mConfig = cfg; }
64 virtual void setCalendar(
KCal::Calendar *cal ) { mCalendar = cal; }
65 virtual void setSelectedIncidences( KCal::Incidence::List inc ) { mSelectedIncidences = inc; }
66 virtual KCal::Incidence::List selectedIncidences()
const {
return mSelectedIncidences; }
76 virtual TQString
info() = 0;
93 TQWidget *configWidget( TQWidget *w )
95 if ( !mConfigWidget ) {
96 mConfigWidget = createConfigWidget( w );
103 virtual TQWidget *createConfigWidget( TQWidget * ) = 0;
108 virtual void doPrint( KPrinter *printer ) = 0;
152 TQWidget *mConfigWidget;
153 KOrg::CoreHelper *mCoreHelper;
158 KCal::Incidence::List mSelectedIncidences;
162 class PrintPluginFactory :
public PluginFactory
Base class of KOrganizer printer class.
Base class for KOrganizer printing classes.
virtual void doPrint(KPrinter *printer)=0
Actually do the printing.
virtual void setSettingsWidget()
Set configuration widget to reflect settings of current object.
virtual void setDateRange(const TQDate &from, const TQDate &to)
Set date range which should be printed.
virtual TQString description()=0
Returns short description of print format.
virtual KPrinter::Orientation defaultOrientation()
Orientation of printout.
virtual bool enabled()
Returns true if the plugin should be enabled; false otherwise.
virtual void doLoadConfig()
Load complete config.
virtual TQString info()=0
Returns long description of print format.
virtual void doSaveConfig()
Save complete config.
virtual int sortID()
Returns the sort ID of the plugin.
KPrinter * mPrinter
The printer object.
virtual void readSettingsWidget()
Read settings from configuration widget and apply them to current object.