calprintbase.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
#ifndef CALPRINTBASE_H
00026
#define CALPRINTBASE_H
00027
00028
00029
#ifndef KORG_NOPRINTER
00030
00031
#include <qwidget.h>
00032
#include <qdatetime.h>
00033
#include <kprinter.h>
00034
#include <libkcal/event.h>
00035
00036
class PrintCellItem;
00037
00038
namespace KCal {
00039
class Calendar;
00040
class Todo;
00041 }
00042
00043
using namespace KCal;
00044
00049 class CalPrintBase :
public QObject
00050 {
00051 Q_OBJECT
00052
public:
00060
CalPrintBase( KPrinter *pr, Calendar *cal, KConfig *cfg );
00061
virtual ~
CalPrintBase();
00062
00066
virtual QString
description() = 0;
00070
virtual QString
longDescription() = 0;
00071
00075
virtual QWidget *
configWidget( QWidget * );
00076
00084
virtual void print( QPainter &p,
int width,
int height ) = 0;
00088
virtual void doPrint();
00089
00096 virtual KPrinter::Orientation
orientation() {
return KPrinter::Portrait; }
00097
00101
virtual void loadConfig() = 0;
00105
virtual void saveConfig() = 0;
00106
00110
void doLoadConfig();
00114
void doSaveConfig();
00115
00116
00117
public slots:
00121 virtual void readSettingsWidget() {}
00125 virtual void setSettingsWidget() {}
00126
00130 virtual void setDateRange(
const QDate &from,
const QDate &to )
00131 {
00132 mFromDate = from;
00133 mToDate = to;
00134 }
00135
00136
protected:
00137
int weekdayColumn(
int weekday );
00138
00139 QDate mFromDate;
00140 QDate mToDate;
00141
bool mUseColors;
00142
00143
public:
00147
class TodoParentStart;
00148
00149
protected:
00175
void drawHeader( QPainter &p, QString title,
00176
const QDate &month1,
const QDate &month2,
00177
int x,
int y,
int width,
int height );
00188
void drawSmallMonth( QPainter &p,
const QDate &qd,
00189
int x,
int y,
int width,
int height );
00190
00199
void drawDaysOfWeek( QPainter &p,
00200
const QDate &fromDate,
const QDate &toDate,
00201
int x,
int y,
int width,
int height );
00208
void drawDaysOfWeekBox( QPainter &p,
const QDate &qd,
00209
int x,
int y,
int width,
int height );
00219
void drawTimeLine( QPainter &p,
00220
const QTime &fromTime,
const QTime &toTime,
00221
int x,
int y,
int width,
int height );
00238
void drawAllDayBox( QPainter &p, Event::List &eventList,
00239
const QDate &qd,
bool expandable,
00240
int x,
int y,
int width,
int &height );
00259
void drawAgendaDayBox( QPainter &p, Event::List &eventList,
00260
const QDate &qd,
bool expandable,
00261 QTime &fromTime, QTime &toTime,
00262
int x,
int y,
int width,
int height);
00263
00264
void drawAgendaItem( PrintCellItem *item, QPainter &p,
const QDate &,
00265
const QDateTime &startPrintDate,
00266
const QDateTime &endPrintDate,
00267
float minlen,
int x,
int y,
int width );
00277
void drawDayBox( QPainter &p,
const QDate &qd,
00278
int x,
int y,
int width,
int height,
00279
bool fullDate =
false );
00288
void drawWeek( QPainter &p,
const QDate &qd,
00289
int x,
int y,
int width,
int height );
00304
void drawTimeTable( QPainter &p,
const QDate &fromDate,
const QDate &toDate,
00305 QTime &fromTime, QTime &toTime,
00306
int x,
int y,
int width,
int height );
00307
00318
void drawMonth( QPainter &p,
const QDate &qd,
bool weeknumbers,
00319
int x,
int y,
int width,
int height );
00320
00345
void drawTodo(
int &count, Todo * item, QPainter &p,
bool connectSubTodos,
00346
bool desc,
int pospriority,
int possummary,
int posDueDt,
00347
int level,
int x,
int &y,
int width,
int &height,
00348
int pageHeight, TodoParentStart *r = 0 );
00349
00355
int weekDayColumn(
int weekday );
00356
00357 KPrinter *mPrinter;
00358 Calendar *mCalendar;
00359 KConfig *mConfig;
00360 QWidget *mConfigWidget;
00361
00362
protected:
00363
00364
static int mSubHeaderHeight;
00365
static int mHeaderHeight;
00366
static int mMargin;
00367 };
00368
00369
#endif
00370
00371
#endif
This file is part of the documentation for korganizer Library Version 3.2.2.