CalPrintBase Class Reference
Base class for KOrganizer printing classes. More...
#include <calprintbase.h>
Inheritance diagram for CalPrintBase:

Public Slots | |
virtual void | readSettingsWidget () |
virtual void | setSettingsWidget () |
virtual void | setDateRange (const QDate &from, const QDate &to) |
Public Methods | |
CalPrintBase (KPrinter *pr, Calendar *cal, KConfig *cfg) | |
virtual | ~CalPrintBase () |
virtual QString | description ()=0 |
virtual QString | longDescription ()=0 |
virtual QWidget * | configWidget (QWidget *) |
virtual void | print (QPainter &p, int width, int height)=0 |
virtual void | doPrint () |
virtual KPrinter::Orientation | orientation () |
virtual void | loadConfig ()=0 |
virtual void | saveConfig ()=0 |
void | doLoadConfig () |
void | doSaveConfig () |
Protected Methods | |
int | weekdayColumn (int weekday) |
void | drawHeader (QPainter &p, QString title, const QDate &month1, const QDate &month2, int x, int y, int width, int height) |
void | drawSmallMonth (QPainter &p, const QDate &qd, int x, int y, int width, int height) |
void | drawDaysOfWeek (QPainter &p, const QDate &fromDate, const QDate &toDate, int x, int y, int width, int height) |
void | drawDaysOfWeekBox (QPainter &p, const QDate &qd, int x, int y, int width, int height) |
void | drawTimeLine (QPainter &p, const QTime &fromTime, const QTime &toTime, int x, int y, int width, int height) |
void | drawAllDayBox (QPainter &p, Event::List &eventList, const QDate &qd, bool expandable, int x, int y, int width, int &height) |
void | drawAgendaDayBox (QPainter &p, Event::List &eventList, const QDate &qd, bool expandable, QTime &fromTime, QTime &toTime, int x, int y, int width, int height) |
void | drawAgendaItem (PrintCellItem *item, QPainter &p, const QDate &, const QDateTime &startPrintDate, const QDateTime &endPrintDate, float minlen, int x, int y, int width) |
void | drawDayBox (QPainter &p, const QDate &qd, int x, int y, int width, int height, bool fullDate=false) |
void | drawWeek (QPainter &p, const QDate &qd, int x, int y, int width, int height) |
void | drawTimeTable (QPainter &p, const QDate &fromDate, const QDate &toDate, QTime &fromTime, QTime &toTime, int x, int y, int width, int height) |
void | drawMonth (QPainter &p, const QDate &qd, bool weeknumbers, int x, int y, int width, int height) |
void | drawTodo (int &count, Todo *item, QPainter &p, bool connectSubTodos, bool desc, int pospriority, int possummary, int posDueDt, int level, int x, int &y, int width, int &height, int pageHeight, TodoParentStart *r=0) |
int | weekDayColumn (int weekday) |
Protected Attributes | |
QDate | mFromDate |
QDate | mToDate |
bool | mUseColors |
KPrinter * | mPrinter |
Calendar * | mCalendar |
KConfig * | mConfig |
QWidget * | mConfigWidget |
Static Protected Attributes | |
int | mSubHeaderHeight = 20 |
int | mHeaderHeight = 72 |
int | mMargin = 36 |
Detailed Description
Base class for KOrganizer printing classes.Each sub class represents one calendar print format.
Definition at line 49 of file calprintbase.h.
Constructor & Destructor Documentation
|
Constructor.
Definition at line 133 of file calprintbase.cpp. |
Member Function Documentation
|
Returns short description of print format.
Referenced by configWidget(), doLoadConfig(), and doSaveConfig(). |
|
Returns long description of print format.
Referenced by configWidget(). |
|
Returns widget for configuring the print format.
Definition at line 144 of file calprintbase.cpp. References description(), longDescription(), QFont::setBold(), QLabel::setFont(), and QFont::setPointSize(). |
|
Actually do the printing.
Referenced by doPrint(). |
|
Start printing.
Definition at line 165 of file calprintbase.cpp. References QPainter::begin(), QPainter::end(), print(), QPainter::setViewport(), and QPainter::viewport(). |
|
Orientation of printout. Default is Portrait. If your plugin wants to use some other orientation as default (e.g. depending on some config settings), implement this function in your subclass and return the desired orientation. Definition at line 96 of file calprintbase.h. |
|
Load print format configuration from config file.
Referenced by doLoadConfig(). |
|
Write print format configuration to config file.
Referenced by doSaveConfig(). |
|
Load complete config. This also calls loadConfig() of the derived class. Definition at line 185 of file calprintbase.cpp. References QDate::currentDate(), description(), and loadConfig(). |
|
Save complete config. This also calls saveConfig() of the derived class. Definition at line 200 of file calprintbase.cpp. References description(), and saveConfig(). |
|
Read settings from configuration widget and apply them to current object.
Definition at line 121 of file calprintbase.h. |
|
Set configuration widget to reflect settings of current object.
Definition at line 125 of file calprintbase.h. |
|
Set date range which should be printed.
Definition at line 130 of file calprintbase.h. Referenced by CalPrinter::setDateRange(). |
|
Draw the gray header bar of the printout to the QPainter. It prints the given text and optionally one or two small month views, as specified by the two QDate. The printed text can also contain a line feed. If month2 is invalid, only the month that contains month1 is printed. E.g. the filofax week view draws just the current month, while the month view draws the previous and the next month.
Definition at line 216 of file calprintbase.cpp. References QPainter::drawRect(), drawSmallMonth(), QPainter::drawText(), QPainter::fillRect(), QDate::isValid(), QDate::month(), QPainter::setFont(), and QDate::year(). |
|
Draw a small calendar with the days of a month into the given area. Used for example in the title bar of the sheet.
Definition at line 253 of file calprintbase.cpp. References QDate::addDays(), QDate::day(), QDate::dayOfWeek(), QPainter::drawLine(), QPainter::drawText(), QDate::month(), QPainter::setFont(), QString::setNum(), QString::upper(), and QDate::year(). Referenced by drawHeader(). |
|
Draw a horizontal bar with the weekday names of the given date range in the given area of the painter. This is used for the weekday-bar on top of the timetable view and the month view.
Definition at line 312 of file calprintbase.cpp. References QDate::addDays(), QDate::daysTo(), and drawDaysOfWeekBox(). Referenced by drawMonth(), and drawTimeTable(). |
|
Draw a single weekday name in a box inside the given area of the painter. This is called in a loop by drawDaysOfWeek.
Definition at line 328 of file calprintbase.cpp. References QPainter::drawRect(), QPainter::drawText(), QPainter::fillRect(), and QPainter::setFont(). Referenced by drawDaysOfWeek(). |
|
Draw a (vertical) time scale from time fromTime to toTime inside the given area of the painter. Every hour will have a one-pixel line over the whole width, every half-hour the line will only span the left half of the width. This is used in the day and timetable print styles
Definition at line 343 of file calprintbase.cpp. References QTime::addSecs(), QPainter::drawLine(), QPainter::drawRect(), QPainter::drawText(), QTime::hour(), QTime::minute(), QTime::secsTo(), QPainter::setFont(), and QString::setNum(). Referenced by drawTimeTable(). |
|
Draw the all-day box for the agenda print view (the box on top which doesn't have a time on the time scale associated). If expandable is set, height is the cell height of a single cell, and the returned height will be the total height used for the all-day events. If !expandable, only one cell will be used, and multiple events are concatenated using ", ".
Definition at line 408 of file calprintbase.cpp. References QPainter::backgroundColor(), QPainter::brush(), QPainter::drawRect(), QPainter::drawText(), QPainter::fillRect(), QString::isEmpty(), QPainter::pen(), QString::remove(), QPainter::setBackgroundColor(), QPainter::setBrush(), and QPainter::setPen(). Referenced by drawTimeTable(). |
|
Draw the agenda box for the day print style (the box showing all events of that day). Also draws a grid with half-hour spacing of the grid lines.
Definition at line 478 of file calprintbase.cpp. References QTime::addSecs(), QPtrList::append(), QPainter::backgroundColor(), QPainter::brush(), QPtrListIterator::current(), QPainter::drawLine(), QPainter::drawRect(), QObject::event(), QTime::hour(), QTime::isValid(), QPainter::pen(), QTime::secsTo(), QPtrList::setAutoDelete(), QPainter::setBackgroundColor(), QPainter::setBrush(), QPainter::setFont(), QPainter::setPen(), and QPtrListIterator::toFirst(). Referenced by drawTimeTable(). |
|
Draw the box containing a list of all events of the given day (with their times, of course). Used in the Filofax and the month print style.
Definition at line 608 of file calprintbase.cpp. References QString::arg(), QDate::day(), QPainter::drawRect(), QPainter::drawText(), QPainter::fillRect(), QPainter::fontMetrics(), QString::isEmpty(), QString::number(), and QPainter::setFont(). |
|
Draw the week (filofax) table of the week containing the date qd. The first three days of the week will be shown in the first column (using drawDayBox), the remaining four in the second column, where the last two days of the week (typically Saturday and Sunday) only get half the height of the other day boxes.
Definition at line 704 of file calprintbase.cpp. References QDate::addDays(), QDate::dayOfWeek(), and drawDayBox(). |
|
Draw the timetable view of the given time range from fromDate to toDate. On the left side the time scale is printed (using drawTimeLine), then each day gets one column (printed using drawAgendaDayBox), and the events are displayed as boxes (like in korganizer's day/week view). The first cell of each column contains the all-day events (using drawAllDayBox with expandable=false). The given time range cannot be expanded to include all events.
Definition at line 739 of file calprintbase.cpp. References QDate::addDays(), QDate::daysTo(), drawAgendaDayBox(), drawAllDayBox(), drawDaysOfWeek(), drawTimeLine(), and QTime::secsTo(). |
|
Draw the month table of the month containing the date qd. Each day gets one box (using drawDayBox) that contains a list of all events on that day. They are arranged in a matrix, with the first column being the first day of the week (so it might display some days of the previous and the next month). Above the matrix there is a bar showing the weekdays (drawn using drawDaysOfWeek).
Definition at line 773 of file calprintbase.cpp. References QDate::addDays(), QDate::dayOfWeek(), QDate::daysInMonth(), drawDayBox(), drawDaysOfWeek(), QPainter::drawText(), QPainter::font(), QDate::month(), QString::number(), QPainter::setFont(), QFont::setPointSize(), QDate::weekNumber(), and QDate::year(). |
|
Draws single todo item and its (intented) subitems, optionally connects them by a tree-like line, and optionally shows due date, summary, description and priority.
Definition at line 817 of file calprintbase.cpp. References QPtrList::append(), QRect::bottom(), QRect::bottomLeft(), QRect::bottomRight(), QPainter::boundingRect(), QPtrList::clear(), QPainter::drawLine(), QPainter::drawRect(), QPainter::drawText(), QPtrList::first(), QPainter::font(), QRect::height(), QRect::left(), QPtrList::next(), QPtrList::remove(), QPainter::setFont(), QRect::setHeight(), QString::setNum(), QFont::setStrikeOut(), QRect::setWidth(), QRect::top(), QRect::topLeft(), QRect::topRight(), QPainter::viewport(), and QRect::width(). |
|
Determines the column of the given weekday ( 1=Monday, 7=Sunday ), taking the start of the week setting into account as given in kcontrol.
|
The documentation for this class was generated from the following files: