-rw-r--r-- | korganizer/calprinter.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/korganizer/calprinter.h b/korganizer/calprinter.h index 7b58f4f..e065779 100644 --- a/korganizer/calprinter.h +++ b/korganizer/calprinter.h | |||
@@ -1,142 +1,144 @@ | |||
1 | //Added by qt3to4: | ||
2 | #include <QLabel> | ||
1 | /* | 3 | /* |
2 | This file is part of KOrganizer. | 4 | This file is part of KOrganizer. |
3 | 5 | ||
4 | Copyright (c) 1998 Preston Brown | 6 | Copyright (c) 1998 Preston Brown |
5 | 7 | ||
6 | This program is free software; you can redistribute it and/or modify | 8 | 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 | 9 | 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 | 10 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 11 | (at your option) any later version. |
10 | 12 | ||
11 | This program is distributed in the hope that it will be useful, | 13 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 16 | GNU General Public License for more details. |
15 | 17 | ||
16 | You should have received a copy of the GNU General Public License | 18 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 19 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 21 | ||
20 | As a special exception, permission is given to link this program | 22 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 23 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 24 | without including the source code for Qt in the source distribution. |
23 | */ | 25 | */ |
24 | #ifndef _CALPRINTER_H | 26 | #ifndef _CALPRINTER_H |
25 | #define _CALPRINTER_H | 27 | #define _CALPRINTER_H |
26 | 28 | ||
27 | // #define KORG_NOPRINTER | 29 | // #define KORG_NOPRINTER |
28 | 30 | ||
29 | #ifndef KORG_NOPRINTER | 31 | #ifndef KORG_NOPRINTER |
30 | 32 | ||
31 | #include <qptrlist.h> | 33 | #include <q3ptrlist.h> |
32 | 34 | ||
33 | #include <kdialogbase.h> | 35 | #include <kdialogbase.h> |
34 | 36 | ||
35 | #include <korganizer/baseview.h> | 37 | #include <korganizer/baseview.h> |
36 | 38 | ||
37 | #include "calprintbase.h" | 39 | #include "calprintbase.h" |
38 | 40 | ||
39 | using namespace KCal; | 41 | using namespace KCal; |
40 | 42 | ||
41 | class QVButtonGroup; | 43 | class Q3VButtonGroup; |
42 | class QWidgetStack; | 44 | class Q3WidgetStack; |
43 | class KPrinter; | 45 | class KPrinter; |
44 | class CalPrintDialog; | 46 | class CalPrintDialog; |
45 | class KConfig; | 47 | class KConfig; |
46 | class QComboBox; | 48 | class QComboBox; |
47 | class QLabel; | 49 | class QLabel; |
48 | 50 | ||
49 | 51 | ||
50 | /** | 52 | /** |
51 | CalPrinter is a class for printing Calendars. It can print in several | 53 | CalPrinter is a class for printing Calendars. It can print in several |
52 | different formats (day, week, month). It also provides a way for setting | 54 | different formats (day, week, month). It also provides a way for setting |
53 | up the printer and remembering these preferences. | 55 | up the printer and remembering these preferences. |
54 | */ | 56 | */ |
55 | class CalPrinter : public QObject, public KOrg::CalPrinterBase | 57 | class CalPrinter : public QObject, public KOrg::CalPrinterBase |
56 | { | 58 | { |
57 | Q_OBJECT | 59 | Q_OBJECT |
58 | 60 | ||
59 | public: | 61 | public: |
60 | enum ePrintOrientation { | 62 | enum ePrintOrientation { |
61 | eOrientPlugin=0, | 63 | eOrientPlugin=0, |
62 | eOrientPrinter, | 64 | eOrientPrinter, |
63 | eOrientPortrait, | 65 | eOrientPortrait, |
64 | eOrientLandscape | 66 | eOrientLandscape |
65 | }; | 67 | }; |
66 | public: | 68 | public: |
67 | /** | 69 | /** |
68 | \param par parent widget for dialogs | 70 | \param par parent widget for dialogs |
69 | \param cal calendar to be printed | 71 | \param cal calendar to be printed |
70 | */ | 72 | */ |
71 | CalPrinter( QWidget *par, Calendar *cal ); | 73 | CalPrinter( QWidget *par, Calendar *cal ); |
72 | virtual ~CalPrinter(); | 74 | virtual ~CalPrinter(); |
73 | 75 | ||
74 | void init( KPrinter *printer, Calendar *calendar ); | 76 | void init( KPrinter *printer, Calendar *calendar ); |
75 | 77 | ||
76 | void setupPrinter(); | 78 | void setupPrinter(); |
77 | 79 | ||
78 | /** | 80 | /** |
79 | Set date range to be printed. | 81 | Set date range to be printed. |
80 | 82 | ||
81 | \param start Start date | 83 | \param start Start date |
82 | \param end End date | 84 | \param end End date |
83 | */ | 85 | */ |
84 | void setDateRange( const QDate &start, const QDate &end ); | 86 | void setDateRange( const QDate &start, const QDate &end ); |
85 | 87 | ||
86 | public slots: | 88 | public slots: |
87 | void updateConfig(); | 89 | void updateConfig(); |
88 | 90 | ||
89 | private slots: | 91 | private slots: |
90 | void doPrint( CalPrintBase *selectedStyle, bool preview ); | 92 | void doPrint( CalPrintBase *selectedStyle, bool preview ); |
91 | 93 | ||
92 | public: | 94 | public: |
93 | void preview( PrintType type, const QDate &fd, const QDate &td ); | 95 | void preview( PrintType type, const QDate &fd, const QDate &td ); |
94 | void print( PrintType type, const QDate &fd, const QDate &td ); | 96 | void print( PrintType type, const QDate &fd, const QDate &td ); |
95 | 97 | ||
96 | protected: | 98 | protected: |
97 | QPtrList<CalPrintBase> mPrintPlugins; | 99 | Q3PtrList<CalPrintBase> mPrintPlugins; |
98 | 100 | ||
99 | private: | 101 | private: |
100 | KPrinter *mPrinter; | 102 | KPrinter *mPrinter; |
101 | Calendar *mCalendar; | 103 | Calendar *mCalendar; |
102 | QWidget *mParent; | 104 | QWidget *mParent; |
103 | KConfig *mConfig; | 105 | KConfig *mConfig; |
104 | 106 | ||
105 | CalPrintDialog *mPrintDialog; | 107 | CalPrintDialog *mPrintDialog; |
106 | }; | 108 | }; |
107 | 109 | ||
108 | class CalPrintDialog : public KDialogBase | 110 | class CalPrintDialog : public KDialogBase |
109 | { | 111 | { |
110 | Q_OBJECT | 112 | Q_OBJECT |
111 | public: | 113 | public: |
112 | CalPrintDialog( QPtrList<CalPrintBase> plugins, KPrinter *p, | 114 | CalPrintDialog( Q3PtrList<CalPrintBase> plugins, KPrinter *p, |
113 | QWidget *parent = 0, const char *name = 0 ); | 115 | QWidget *parent = 0, const char *name = 0 ); |
114 | virtual ~CalPrintDialog(); | 116 | virtual ~CalPrintDialog(); |
115 | CalPrintBase *selectedPlugin(); | 117 | CalPrintBase *selectedPlugin(); |
116 | CalPrinter::ePrintOrientation orientation() { return mOrientation; } | 118 | CalPrinter::ePrintOrientation orientation() { return mOrientation; } |
117 | 119 | ||
118 | public slots: | 120 | public slots: |
119 | void setPrintType( int ); | 121 | void setPrintType( int ); |
120 | void setPreview( bool ); | 122 | void setPreview( bool ); |
121 | 123 | ||
122 | protected slots: | 124 | protected slots: |
123 | void slotOk(); | 125 | void slotOk(); |
124 | void setupPrinter(); | 126 | void setupPrinter(); |
125 | void setPrinterLabel(); | 127 | void setPrinterLabel(); |
126 | signals: | 128 | signals: |
127 | void okClicked(); | 129 | void okClicked(); |
128 | private: | 130 | private: |
129 | KPrinter *mPrinter; | 131 | KPrinter *mPrinter; |
130 | QVButtonGroup *mTypeGroup; | 132 | Q3VButtonGroup *mTypeGroup; |
131 | QWidgetStack *mConfigArea; | 133 | Q3WidgetStack *mConfigArea; |
132 | QPtrList<CalPrintBase> mPrintPlugins; | 134 | Q3PtrList<CalPrintBase> mPrintPlugins; |
133 | QLabel *mPrinterLabel; | 135 | QLabel *mPrinterLabel; |
134 | QString mPreviewText; | 136 | QString mPreviewText; |
135 | QComboBox *mOrientationSelection; | 137 | QComboBox *mOrientationSelection; |
136 | 138 | ||
137 | CalPrinter::ePrintOrientation mOrientation; | 139 | CalPrinter::ePrintOrientation mOrientation; |
138 | }; | 140 | }; |
139 | 141 | ||
140 | #endif | 142 | #endif |
141 | 143 | ||
142 | #endif | 144 | #endif |