• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

korganizer

  • sources
  • kde-4.12
  • kdepim
  • korganizer
  • plugins
  • printing
  • itemlist
itemlistprint.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
5 
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.
10 
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.
15 
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.
19 
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.
23 */
24 
25 #include "itemlistprint.h"
26 
27 class ItemListPrintFactory : public KOrg::PrintPluginFactory
28 {
29  public:
30  KOrg::PrintPlugin *createPluginFactory() { return new CalPrintItemList; }
31 };
32 
33 K_EXPORT_PLUGIN( ItemListPrintFactory )
34 
35 /**************************************************************
36  * Print Item List
37  **************************************************************/
38 
39 QWidget *CalPrintItemList::createConfigWidget( QWidget *w )
40 {
41  return new CalPrintItemListConfig( w );
42 }
43 
44 void CalPrintItemList::readSettingsWidget()
45 {
46  CalPrintItemListConfig *cfg =
47  dynamic_cast<CalPrintItemListConfig*>( ( QWidget* )mConfigWidget );
48  if ( cfg ) {
49  mFromDate = cfg->mFromDate->date();
50  mToDate = cfg->mToDate->date();
51  }
52 }
53 
54 void CalPrintItemList::setSettingsWidget()
55 {
56  CalPrintItemListConfig *cfg =
57  dynamic_cast<CalPrintItemListConfig*>( ( QWidget* )mConfigWidget );
58  if ( cfg ) {
59  cfg->mFromDate->setDate( mFromDate );
60  cfg->mToDate->setDate( mToDate );
61  }
62 }
63 
64 void CalPrintItemList::loadConfig()
65 {
66  if ( mConfig ) {
67  KConfigGroup config( mConfig, "Itemlistprint" );
68  //TODO: Read in settings
69  }
70  setSettingsWidget();
71 }
72 
73 void CalPrintItemList::saveConfig()
74 {
75  kDebug();
76 
77  readSettingsWidget();
78  if ( mConfig ) {
79  KConfigGroup config( mConfig, "Itemlistprint" );
80  //TODO: Write out settings
81  }
82 }
83 
84 void CalPrintItemList::setDateRange( const QDate &from, const QDate &to )
85 {
86  CalPrintPluginBase::setDateRange( from, to );
87  CalPrintItemListConfig *cfg =
88  dynamic_cast<CalPrintItemListConfig*>( ( QWidget* )mConfigWidget );
89  if ( cfg ) {
90  cfg->mFromDate->setDate( from );
91  cfg->mToDate->setDate( to );
92  }
93 }
94 
95 void CalPrintItemList::print( QPainter &p, int width, int height )
96 {
97  Q_UNUSED( p );
98  Q_UNUSED( width );
99  Q_UNUSED( height );
100  //TODO: Print something!
101 }
102 
KOrg::PrintPlugin::mFromDate
QDate mFromDate
Definition: printplugin.h:172
QWidget
CalPrintItemList::print
virtual void print(QPainter &p, int width, int height)
Actually do the printing.
Definition: itemlistprint.cpp:95
KOrg::PrintPluginFactory::createPluginFactory
virtual PrintPlugin * createPluginFactory()=0
itemlistprint.h
KOrg::PrintPlugin::setDateRange
virtual void setDateRange(const QDate &from, const QDate &to)
Set date range which should be printed.
Definition: printplugin.h:165
KOrg::PrintPlugin
Base class for KOrganizer printing classes.
Definition: printplugin.h:62
CalPrintItemListConfig
Definition: itemlistprint.h:77
CalPrintItemList::loadConfig
virtual void loadConfig()
Load print format configuration from config file.
Definition: itemlistprint.cpp:64
KOrg::PrintPlugin::mToDate
QDate mToDate
Definition: printplugin.h:173
KOrg::PrintPluginFactory
Definition: printplugin.h:186
KOrg::PrintPlugin::mConfig
KConfig * mConfig
Definition: printplugin.h:183
CalPrintItemList::setDateRange
virtual void setDateRange(const QDate &from, const QDate &to)
Set date range which should be printed.
Definition: itemlistprint.cpp:84
K_EXPORT_PLUGIN
K_EXPORT_PLUGIN(KOrganizerFactory(createAboutData())) KOrganizerPart
Definition: korganizer_part.cpp:49
CalPrintItemList::setSettingsWidget
virtual void setSettingsWidget()
Set configuration widget to reflect settings of current object.
Definition: itemlistprint.cpp:54
KOrg::PrintPlugin::mConfigWidget
QPointer< QWidget > mConfigWidget
Definition: printplugin.h:176
CalPrintItemList::readSettingsWidget
virtual void readSettingsWidget()
Read settings from configuration widget and apply them to current object.
Definition: itemlistprint.cpp:44
CalPrintItemList
Definition: itemlistprint.h:33
CalPrintItemList::saveConfig
virtual void saveConfig()
Write print format configuration to config file.
Definition: itemlistprint.cpp:73
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

korganizer

Skip menu "korganizer"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal