korganizer

calprinter.h
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 1998 Preston Brown <pbrown@kde.org>
5  Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 
21  As a special exception, permission is given to link this program
22  with any edition of TQt, and distribute the resulting executable,
23  without including the source code for TQt in the source distribution.
24 */
25 #ifndef _CALPRINTER_H
26 #define _CALPRINTER_H
27 
28 #ifndef KORG_NOPRINTER
29 
30 #include <tqptrlist.h>
31 #include <kdialogbase.h>
32 #include <korganizer/baseview.h>
33 #include <korganizer/printplugin.h>
34 #include <kdemacros.h>
35 
36 namespace KOrg {
37 class CoreHelper;
38 }
39 using namespace KCal;
40 
41 class TQVButtonGroup;
42 class TQWidgetStack;
43 class CalPrintDialog;
44 class TDEConfig;
45 class TQComboBox;
46 class TQLabel;
47 
53 class TDE_EXPORT CalPrinter : public TQObject, public KOrg::CalPrinterBase
54 {
55  TQ_OBJECT
56 
57 
58  public:
59  enum ePrintOrientation {
60  eOrientPlugin=0,
61  eOrientPrinter,
62  eOrientPortrait,
63  eOrientLandscape
64  };
65  public:
71  CalPrinter( TQWidget *par, Calendar *cal, KOrg::CoreHelper *helper );
72  virtual ~CalPrinter();
73 
74  void init( Calendar *calendar );
75 
82  void setDateRange( const TQDate &start, const TQDate &end );
83 
84  public slots:
85  void updateConfig();
86 
87  private slots:
88  void doPrint( KOrg::PrintPlugin *selectedStyle, CalPrinter::ePrintOrientation dlgorientation, bool preview = false );
89 
90  public:
91  void print( int type, const TQDate &fd, const TQDate &td,
92  Incidence::List selectedIncidences = Incidence::List(), bool preview = false );
93 
94  Calendar *calendar() const;
95  TDEConfig *config() const;
96 
97  protected:
98  KOrg::PrintPlugin::List mPrintPlugins;
99 
100  private:
101  Calendar *mCalendar;
102  TQWidget *mParent;
103  TDEConfig *mConfig;
104  KOrg::CoreHelper *mCoreHelper;
105 };
106 
107 class CalPrintDialog : public KDialogBase
108 {
109  TQ_OBJECT
110 
111  public:
112  CalPrintDialog( KOrg::PrintPlugin::List plugins,
113  TQWidget *parent = 0, const char *name = 0 );
114  virtual ~CalPrintDialog();
115  KOrg::PrintPlugin *selectedPlugin();
116  void setOrientation( CalPrinter::ePrintOrientation orientation );
117  CalPrinter::ePrintOrientation orientation() { return mOrientation; }
118 
119  public slots:
120  void setPrintType( int );
121  void setPreview( bool );
122 
123  protected slots:
124  void slotOk();
125 
126  private:
127  TQVButtonGroup *mTypeGroup;
128  TQWidgetStack *mConfigArea;
129  TQMap<int, KOrg::PrintPlugin*> mPluginIDs;
130  TQString mPreviewText;
131  TQComboBox *mOrientationSelection;
132 
133  CalPrinter::ePrintOrientation mOrientation;
134 };
135 
136 #endif
137 
138 #endif
CalPrinter is a class for printing Calendars.
Definition: calprinter.h:54
Base class of KOrganizer printer class.
Definition: printplugin.h:42
Base class for KOrganizer printing classes.
Definition: printplugin.h:52