2
This file is part of KOrganizer.
4
Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License along
17
with this program; if not, write to the Free Software Foundation, Inc.,
18
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
As a special exception, permission is given to link this program
21
with any edition of Qt, and distribute the resulting executable,
22
without including the source code for Qt in the source distribution.
25
#include "itemlistprint.h"
27
class ItemListPrintFactory : public KOrg::PrintPluginFactory
30
KOrg::PrintPlugin *createPluginFactory() { return new CalPrintItemList; }
33
K_EXPORT_PLUGIN( ItemListPrintFactory )
35
/**************************************************************
37
**************************************************************/
39
QWidget *CalPrintItemList::createConfigWidget( QWidget *w )
41
return new CalPrintItemListConfig( w );
44
void CalPrintItemList::readSettingsWidget()
46
CalPrintItemListConfig *cfg =
47
dynamic_cast<CalPrintItemListConfig*>( ( QWidget* )mConfigWidget );
49
mFromDate = cfg->mFromDate->date();
50
mToDate = cfg->mToDate->date();
54
void CalPrintItemList::setSettingsWidget()
56
CalPrintItemListConfig *cfg =
57
dynamic_cast<CalPrintItemListConfig*>( ( QWidget* )mConfigWidget );
59
cfg->mFromDate->setDate( mFromDate );
60
cfg->mToDate->setDate( mToDate );
64
void CalPrintItemList::loadConfig()
67
KConfigGroup config( mConfig, "Itemlistprint" );
68
//TODO: Read in settings
73
void CalPrintItemList::saveConfig()
79
KConfigGroup config( mConfig, "Itemlistprint" );
80
//TODO: Write out settings
84
void CalPrintItemList::setDateRange( const QDate &from, const QDate &to )
86
CalPrintPluginBase::setDateRange( from, to );
87
CalPrintItemListConfig *cfg =
88
dynamic_cast<CalPrintItemListConfig*>( ( QWidget* )mConfigWidget );
90
cfg->mFromDate->setDate( from );
91
cfg->mToDate->setDate( to );
95
void CalPrintItemList::print( QPainter &p, int width, int height )
100
//TODO: Print something!