25 #ifndef KORG_NOPRINTER
27 #include "whatsnextprint.h"
29 #include "calprintpluginbase.h"
30 #include <libkcal/event.h>
31 #include <libkcal/todo.h>
33 #include <libtdepim/kdateedit.h>
34 #include <tdeconfig.h>
37 #include <tqbuttongroup.h>
39 #include "calprintwhatsnextconfig_base.h"
42 class WhatsNextPrintFactory :
public KOrg::PrintPluginFactory {
47 K_EXPORT_COMPONENT_FACTORY( libkorg_whatsnextprint, WhatsNextPrintFactory )
54 TQWidget *CalPrintWhatsNext::createConfigWidget( TQWidget *w )
56 return new CalPrintWhatsNextConfig_Base( w );
59 void CalPrintWhatsNext::readSettingsWidget()
61 CalPrintWhatsNextConfig_Base *cfg =
62 dynamic_cast<CalPrintWhatsNextConfig_Base*
>( mConfigWidget );
64 mFromDate = cfg->mFromDate->date();
65 mToDate = cfg->mToDate->date();
66 mUseDateRange = (cfg->mDateRangeGroup->selectedId() == 1);
70 void CalPrintWhatsNext::setSettingsWidget()
72 CalPrintWhatsNextConfig_Base *cfg =
73 dynamic_cast<CalPrintWhatsNextConfig_Base*
>( mConfigWidget );
75 cfg->mFromDate->setDate( mFromDate );
76 cfg->mToDate->setDate( mToDate );
78 cfg->mDateRangeGroup->setButton( (mUseDateRange)?1:0 );
82 void CalPrintWhatsNext::loadConfig()
85 mUseDateRange = mConfig->readBoolEntry(
"WhatsNextsInRange",
false );
90 void CalPrintWhatsNext::saveConfig()
92 kdDebug(5850) <<
"CalPrintWhatsNext::saveConfig()" << endl;
96 mConfig->writeEntry(
"WhatsNextsInRange", mUseDateRange );
100 void CalPrintWhatsNext::setDateRange(
const TQDate& from,
const TQDate& to )
103 CalPrintWhatsNextConfig_Base *cfg =
104 dynamic_cast<CalPrintWhatsNextConfig_Base*
>( mConfigWidget );
106 cfg->mFromDate->setDate( from );
107 cfg->mToDate->setDate( to );
111 void CalPrintWhatsNext::print( TQPainter &p,
int width,
int height )
Base class for KOrganizer printing classes.
virtual void setDateRange(const TQDate &from, const TQDate &to)
Set date range which should be printed.