• 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
  • whatsnext
whatsnextprint.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 "whatsnextprint.h"
26 
27 class WhatsNextPrintFactory : public KOrg::PrintPluginFactory
28 {
29  public:
30  KOrg::PrintPlugin *createPluginFactory() { return new CalPrintWhatsNext; }
31 };
32 
33 K_EXPORT_PLUGIN( WhatsNextPrintFactory )
34 
35 /**************************************************************
36  * Print What's Next
37  **************************************************************/
38 
39 QWidget *CalPrintWhatsNext::createConfigWidget( QWidget *w )
40 {
41  return new CalPrintWhatsNextConfig( w );
42 }
43 
44 void CalPrintWhatsNext::readSettingsWidget()
45 {
46  CalPrintWhatsNextConfig *cfg =
47  dynamic_cast<CalPrintWhatsNextConfig*>( ( QWidget* )mConfigWidget );
48  if ( cfg ) {
49  mFromDate = cfg->mFromDate->date();
50  mToDate = cfg->mToDate->date();
51  }
52 }
53 
54 void CalPrintWhatsNext::setSettingsWidget()
55 {
56  CalPrintWhatsNextConfig *cfg =
57  dynamic_cast<CalPrintWhatsNextConfig*>( ( QWidget* )mConfigWidget );
58  if ( cfg ) {
59  cfg->mFromDate->setDate( mFromDate );
60  cfg->mToDate->setDate( mToDate );
61  }
62 }
63 
64 void CalPrintWhatsNext::loadConfig()
65 {
66  if ( mConfig ) {
67  KConfigGroup config( mConfig, "Whatsnextprint" );
68  //TODO: Read in settings
69  }
70  setSettingsWidget();
71 }
72 
73 void CalPrintWhatsNext::saveConfig()
74 {
75  kDebug();
76 
77  readSettingsWidget();
78  if ( mConfig ) {
79  KConfigGroup config( mConfig, "Whatsnextprint" );
80  //TODO: Write out settings
81  }
82 }
83 
84 void CalPrintWhatsNext::setDateRange( const QDate &from, const QDate &to )
85 {
86  CalPrintPluginBase::setDateRange( from, to );
87  CalPrintWhatsNextConfig *cfg =
88  dynamic_cast<CalPrintWhatsNextConfig*>( ( QWidget* )mConfigWidget );
89  if ( cfg ) {
90  cfg->mFromDate->setDate( from );
91  cfg->mToDate->setDate( to );
92  }
93 }
94 
95 void CalPrintWhatsNext::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 }
KOrg::PrintPlugin::mFromDate
QDate mFromDate
Definition: printplugin.h:172
CalPrintWhatsNext::setSettingsWidget
virtual void setSettingsWidget()
Set configuration widget to reflect settings of current object.
Definition: whatsnextprint.cpp:54
QWidget
KOrg::PrintPluginFactory::createPluginFactory
virtual PrintPlugin * createPluginFactory()=0
CalPrintWhatsNext
Definition: whatsnextprint.h:33
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
CalPrintWhatsNext::print
virtual void print(QPainter &p, int width, int height)
Actually do the printing.
Definition: whatsnextprint.cpp:95
whatsnextprint.h
KOrg::PrintPlugin::mToDate
QDate mToDate
Definition: printplugin.h:173
CalPrintWhatsNext::setDateRange
virtual void setDateRange(const QDate &from, const QDate &to)
Set date range which should be printed.
Definition: whatsnextprint.cpp:84
KOrg::PrintPluginFactory
Definition: printplugin.h:186
KOrg::PrintPlugin::mConfig
KConfig * mConfig
Definition: printplugin.h:183
CalPrintWhatsNext::loadConfig
virtual void loadConfig()
Load print format configuration from config file.
Definition: whatsnextprint.cpp:64
K_EXPORT_PLUGIN
K_EXPORT_PLUGIN(KOrganizerFactory(createAboutData())) KOrganizerPart
Definition: korganizer_part.cpp:49
CalPrintWhatsNextConfig
Definition: whatsnextprint.h:78
KOrg::PrintPlugin::mConfigWidget
QPointer< QWidget > mConfigWidget
Definition: printplugin.h:176
CalPrintWhatsNext::readSettingsWidget
virtual void readSettingsWidget()
Read settings from configuration widget and apply them to current object.
Definition: whatsnextprint.cpp:44
CalPrintWhatsNext::saveConfig
virtual void saveConfig()
Write print format configuration to config file.
Definition: whatsnextprint.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