CalendarSupport

calprintpluginbase.h
1/*
2 SPDX-FileCopyrightText: 1998 Preston Brown <pbrown@kde.org>
3 SPDX-FileCopyrightText: 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
4 SPDX-FileCopyrightText: 2008 Ron Goodheart <rong.dev@gmail.com>
5 SPDX-FileCopyrightText: 2012-2013 Allen Winter <winter@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
8*/
9
10#pragma once
11
12#include "calendarsupport_export.h"
13#include "printplugin.h"
14
15#include <KCalendarCore/Calendar>
16#include <KCalendarCore/Event>
17#include <KCalendarCore/Todo>
18
19#include <QDateTime>
20#include <QPainter>
21
22class PrintCellItem;
23class QWidget;
24
25#define PORTRAIT_HEADER_HEIGHT 80 // header height, for portrait orientation
26#define LANDSCAPE_HEADER_HEIGHT 54 // header height, for landscape orientation
27#define SUBHEADER_HEIGHT 28 // subheader height, for all orientations
28#define PORTRAIT_FOOTER_HEIGHT 16 // footer height, for portrait orientation
29#define LANDSCAPE_FOOTER_HEIGHT 14 // footer height, for landscape orientation
30#define MARGIN_SIZE 36 // margins, for all orientations
31#define PADDING_SIZE 7 // padding between the various top-level boxes
32#define BOX_BORDER_WIDTH 2 // width of the border of all top-level boxes
33#define EVENT_BORDER_WIDTH 0 // with of the border of all incidence boxes
34
35#define TIMELINE_WIDTH 50 // width of timeline (day and timetable)
36
37namespace CalendarSupport
38{
39/**
40 Base class for Calendar printing classes. Each sub class represents one
41 calendar print format.
42*/
44{
45public:
46 enum DisplayFlags { Text = 0x0001, TimeBoxes = 0x0002 };
47
48public:
49 /**
50 Constructor
51 */
53 ~CalPrintPluginBase() override;
54
55 /**
56 Returns widget for configuring the print format.
57 */
59
60 /**
61 Actually do the printing.
62
63 @param p QPainter the print result is painted to
64 @param width Width of printable area
65 @param height Height of printable area
66 */
67
68 virtual void print(QPainter &p, int width, int height) = 0;
69 /**
70 Start printing.
71 */
72 void doPrint(QPrinter *printer) override;
73
74 void doLoadConfig() override;
75
76 void doSaveConfig() override;
77
78 /** HELPER FUNCTIONS */
79public:
80 [[nodiscard]] bool useColors() const;
81 void setUseColors(bool useColors);
82
83 [[nodiscard]] bool printFooter() const;
84 void setPrintFooter(bool printFooter);
85
86 /**
87 Determines the column of the given weekday ( 1=Monday, 7=Sunday ), taking the
88 start of the week setting into account as given in kcontrol.
89 @param weekday Index of the weekday
90 */
91 static int weekdayColumn(int weekday);
92
93 QPageLayout::Orientation orientation() const;
94
95 /** Returns the height of the page header. If the height was explicitly
96 set using setHeaderHeight, that value is returned, otherwise a
97 default value based on the printer orientation.
98 @return height of the page header of the printout
99 */
100 [[nodiscard]] int headerHeight() const;
101 void setHeaderHeight(const int height);
102
103 int subHeaderHeight() const;
104 void setSubHeaderHeight(const int height);
105 /** Returns the height of the page footer. If the height was explicitly
106 set using setFooterHeight, that value is returned, otherwise a
107 default value based on the printer orientation.
108 @return height of the page footer of the printout
109 */
110 [[nodiscard]] int footerHeight() const;
111 void setFooterHeight(const int height);
112
113 [[nodiscard]] int margin() const;
114 void setMargin(const int margin);
115
116 [[nodiscard]] int padding() const;
117 void setPadding(const int margin);
118
119 [[nodiscard]] int borderWidth() const;
120 void setBorderWidth(const int border);
121
122 /*****************************************************************
123 ** PRINTING HELPER FUNCTIONS **
124 *****************************************************************/
125public:
126 /**
127 Draw a box with given width at the given coordinates.
128 @param p The printer to be used
129 @param linewidth The border width of the box
130 @param rect The rectangle of the box
131 */
132 static void drawBox(QPainter &p, int linewidth, QRect rect);
133 /**
134 Draw a shaded box with given width at the given coordinates.
135 @param p The printer to be used
136 @param linewidth The border width of the box
137 @param brush The brush to fill the box
138 @param rect The rectangle of the box
139 */
140 static void drawShadedBox(QPainter &p, int linewidth, const QBrush &brush, QRect rect);
141
142 /**
143 Print the given string (event summary) in the given rectangle. Margins
144 and justification (centered or not) are automatically adjusted.
145 @param p QPainter of the printout
146 @param box Coordinates of the surrounding event box
147 @param str The text to be printed in the box
148 */
149 void printEventString(QPainter &p, QRect box, const QString &str, int flags = -1);
150
151 /**
152 Print the box for the given event with the given string.
153 @param p QPainter of the printout
154 @param linewidth is the width of the line used to draw the box, ignored if less than 1.
155 @param box Coordinates of the event's box
156 @param incidence The incidence (if available), from which the category
157 color will be deduced, if applicable.
158 @param str The string to print inside the box
159 @param flags is a bitwise OR of Qt::AlignmentFlags and Qt::TextFlags values.
160 */
161 void showEventBox(QPainter &p, int linewidth, QRect box, const KCalendarCore::Incidence::Ptr &incidence, const QString &str, int flags = -1);
162
163 /**
164 Draw a subheader box with a shaded background and the given string
165 @param p QPainter of the printout
166 @param str Text to be printed inside the box
167 @param box Coordinates of the box
168 */
169 void drawSubHeaderBox(QPainter &p, const QString &str, QRect box);
170
171 /**
172 Draw an event box with vertical text.
173 @param p QPainter of the printout
174 @param linewidth is the width of the line used to draw the box, ignored if less than 1.
175 @param box Coordinates of the box
176 @param str ext to be printed inside the box
177 @param flags is a bitwise OR of Qt::AlignmentFlags and Qt::TextFlags values.
178 */
179 void drawVerticalBox(QPainter &p, int linewidth, QRect box, const QString &str, int flags = -1);
180
181 /**
182 Draw a component box with a heading (printed in bold).
183 @param p QPainter of the printout
184 @param box Coordinates of the box
185 @param caption Caption string to be printed inside the box
186 @param contents Normal text contents of the box. If contents.isNull(),
187 then no text will be printed, only the caption.
188 @param sameLine Whether the contents should start on the same line as
189 the caption (the space below the caption text will be
190 used as indentation in the subsequent lines) or on the
191 next line (no indentation of the contents)
192 @param expand Whether to expand the box vertically to fit the
193 whole text in it.
194 @param rickContents Whether contents contains rich text.
195 @return The bottom of the printed box. If expand==true, the bottom of
196 the drawn box is returned, if expand==false, the vertical
197 end of the printed contents inside the box is returned.
198 If you want to print some custom graphics or text below
199 the contents, use the return value as the top-value of your
200 custom contents in that case.
201 */
203 QRect box,
204 const QString &caption,
205 const QString &contents,
206 bool sameLine,
207 bool expand,
208 const QFont &captionFont,
209 const QFont &textFont,
210 bool richContents = false);
211
212 /**
213 Draw the gray header bar of the printout to the QPainter.
214 It prints the given text and optionally one or two small
215 month views, as specified by the two QDate. The printed
216 text can also contain a line feed.
217 If month2 is invalid, only the month that contains month1
218 is printed.
219 E.g. the filofax week view draws just the current month,
220 while the month view draws the previous and the next month.
221 @param p QPainter of the printout
222 @param title The string printed as the title of the page
223 (e.g. the date, date range or todo list title)
224 @param month1 Date specifying the month for the left one of
225 the small month views in the title bar. If left
226 empty, only month2 will be printed (or none,
227 it that is invalid as well).
228 @param month2 Date specifying the month for the right one of
229 the small month views in the title bar. If left
230 empty, only month1 will be printed (or none,
231 it that is invalid as well).
232 @param box coordinates of the title bar
233 @param expand Whether to expand the box vertically to fit the
234 whole title in it.
235 @param backColor background color for the header box.
236 @return The bottom of the printed box. If expand==false, this
237 is box.bottom, otherwise it is larger than box.bottom
238 and matches the y-coordinate of the surrounding rectangle.
239 */
240 int drawHeader(QPainter &p, const QString &title, QDate month1, QDate month2, QRect box, bool expand = false, QColor backColor = QColor());
241
242 /**
243 Draw a page footer containing the printing date and possibly
244 other things, like a page number.
245 @param p QPainter of the printout
246 @param box coordinates of the footer
247 @return The bottom of the printed box.
248 */
249 int drawFooter(QPainter &p, QRect box);
250
251 /**
252 Draw a small calendar with the days of a month into the given area.
253 Used for example in the title bar of the sheet.
254 @param p QPainter of the printout
255 @param qd Arbitrary Date within the month to be printed.
256 @param box coordinates of the small calendar
257 */
258 void drawSmallMonth(QPainter &p, QDate qd, QRect box);
259
260 /**
261 Draw a horizontal bar with the weekday names of the given date range
262 in the given area of the painter.
263 This is used for the weekday-bar on top of the timetable view and the month view.
264 @param p QPainter of the printout
265 @param fromDate First date of the printed dates
266 @param toDate Last date of the printed dates
267 @param box coordinates of the box for the days of the week
268 */
269 void drawDaysOfWeek(QPainter &p, QDate fromDate, QDate toDate, QRect box);
270
271 /**
272 Draw a single weekday name in a box inside the given area of the painter.
273 This is called in a loop by drawDaysOfWeek.
274 @param p QPainter of the printout
275 @param qd Date of the printed day
276 @param box coordinates of the weekbox
277 */
278 void drawDaysOfWeekBox(QPainter &p, QDate qd, QRect box);
279
280 /**
281 Draw a (vertical) time scale from time fromTime to toTime inside the
282 given area of the painter. Every hour will have a one-pixel line over
283 the whole width, every half-hour the line will only span the left half
284 of the width. This is used in the day and timetable print styles
285 @param p QPainter of the printout
286 @param fromTime Start time of the time range to display
287 @param toTime End time of the time range to display
288 @param box coordinates of the timeline
289 */
290 void drawTimeLine(QPainter &p, QTime fromTime, QTime toTime, QRect box);
291
292 /**
293 Draw the agenda box for the day print style (the box showing all events of that day).
294 Also draws a grid with half-hour spacing of the grid lines.
295 Does NOT draw allday events. Use drawAllDayBox for allday events.
296
297 Obeys configuration options #mExcludeConfidential, #excludePrivate.
298 @param p QPainter of the printout
299 @param eventList The list of the events that are supposed to be printed
300 inside this box
301 @param qd The date of the currently printed day
302 @param expandable If true, the start and end times are adjusted to include
303 the whole range of all events of that day, not just of the given time range.
304 The height of the box will not be affected by this (but the height
305 of one hour will be scaled down so that the whole range fits into
306 the box. fromTime and toTime receive the actual time range printed
307 by this function).
308 @param fromTime Start of the time range to be printed. Might be adjusted
309 to include all events if expandable==true
310 @param toTime End of the time range to be printed. Might be adjusted
311 to include all events if expandable==true
312 @param box coordinates of the agenda day box.
313 @param includeDescription Whether to print the event description as well.
314 @param includeCategories Whether to print the event categories (tags) as well.
315 @param excludeTime Whether the time is printed in the detail area.
316 @param workDays List of workDays
317 */
319 const KCalendarCore::Event::List &eventList,
320 QDate qd,
321 bool expandable,
322 QTime fromTime,
323 QTime toTime,
324 QRect box,
325 bool includeDescription,
326 bool includeCategories,
327 bool excludeTime,
328 const QList<QDate> &workDays);
329
330 void drawAgendaItem(PrintCellItem *item,
331 QPainter &p,
332 const QDateTime &startPrintDate,
333 const QDateTime &endPrintDate,
334 float minlen,
335 QRect box,
336 bool includeDescription,
337 bool includeCategories,
338 bool excludeTime);
339
340 /**
341 Draw the box containing a list of all events of the given day (with their times,
342 of course). Used in the Filofax and the month print style.
343
344 Obeys configuration options #mExcludeConfidential, #mExcludePrivate, #mShowNoteLines, #mUseColors.
345 @param p QPainter of the printout
346 @param qd The date of the currently printed day. All events of the calendar
347 that appear on that day will be printed.
348 @param fromTime Start time of the time range to display
349 @param toTime End time of the time range to display
350 @param box coordinates of the day box.
351 @param fullDate Whether the title bar of the box should contain the full
352 date string or just a short.
353 @param printRecurDaily Whether daily recurring incidences should be printed.
354 @param printRecurWeekly Whether weekly recurring incidences should be printed.
355 @param singleLineLimit Whether Incidence text wraps or truncates.
356 @param includeDescription Whether to print the event description as well.
357 @param includeCategories Whether to print the event categories (tags) as well.
358 */
359 void drawDayBox(QPainter &p,
360 QDate qd,
361 QTime fromTime,
362 QTime toTime,
363 QRect box,
364 bool fullDate = false,
365 bool printRecurDaily = true,
366 bool printRecurWeekly = true,
367 bool singleLineLimit = true,
368 bool includeDescription = false,
369 bool includeCategories = false);
370
371 /**
372 Draw the month table of the month containing the date qd. Each day gets one
373 box (using drawDayBox) that contains a list of all events on that day. They are arranged
374 in a matrix, with the first column being the first day of the
375 week (so it might display some days of the previous and the next month).
376 Above the matrix there is a bar showing the weekdays (drawn using drawDaysOfWeek).
377
378 Obeys configuration options #mExcludeConfidential, #mExcludePrivate, #mShowNoteLines, #mUseColors.
379 @param p QPainter of the printout
380 @param qd Arbitrary date within the month to be printed.
381 @param fromTime Start time of the displayed time range
382 @param toTime End time of the displayed time range
383 @param weeknumbers Whether the week numbers are printed left of each row of the matrix
384 @param recurDaily Whether daily recurring incidences should be printed.
385 @param recurWeekly Whether weekly recurring incidences should be printed.
386 @param singleLineLimit Whether Incidence text wraps or truncates.
387 @param includeDescription Whether descriptions are printed.
388 @param includeCategories Whether to print the event categories (tags) as well.
389 @param box coordinates of the month.
390 */
391 void drawMonthTable(QPainter &p,
392 QDate qd,
393 QTime fromTime,
394 QTime toTime,
395 bool weeknumbers,
396 bool recurDaily,
397 bool recurWeekly,
398 bool singleLineLimit,
399 bool includeDescription,
400 bool includeCategories,
401 QRect box);
402
403 /**
404 Draw a vertical representation of the month containing the date dt. Each
405 day gets one line.
406
407 Obeys configuration options #mExcludeConfidential, #excludePrivate.
408 @param p QPainter of the printout
409 @param dt Arbitrary date within the month to be printed
410 @param box coordinates of the box reserved for the month
411 @param maxdays Days to print. If a value of -1 is given, the number of days
412 is deduced from the month. If maxdays is larger than the
413 number of days in the month, the remaining boxes are
414 shaded to indicate they are not days of the month.
415 @param subDailyFlags Bitfield consisting of DisplayFlags flags to determine
416 how events that do not cross midnight should be printed.
417 @param holidaysFlags Bitfield consisting of DisplayFlags flags to determine
418 how holidays should be printed.
419 */
420 void drawMonth(QPainter &p, QDate dt, QRect box, int maxdays = -1, int subDailyFlags = TimeBoxes, int holidaysFlags = Text);
421
422 /**
423 Internal class representing the start of a todo.
424 */
425 class TodoParentStart;
426
427 /**
428 Draws single to-do and its (indented) sub-to-dos, optionally connects them
429 by a tree-like line, and optionally shows due date, summary, description
430 and priority.
431 @param count The number of the currently printed to-do (count will be
432 incremented for each to-do drawn)
433 @param todo The to-do to be printed. It's sub-to-dos are recursively drawn,
434 so drawTodo should only be called on the to-dos of the highest level.
435 @param p QPainter of the printout
436 @param sortField Specifies on which attribute of the todo you want to sort.
437 @param sortDir Specifies if you want to sort ascending or descending.
438 @param connectSubTodos Whether sub-to-dos shall be connected with
439 their parent by a line (tree-like).
440 @param strikeoutCompleted Whether completed to-dos should be printed with
441 strike-out summaries.
442 @param desc Whether to print the whole description of the to-do
443 (the summary is always printed).
444 @param posPriority x-coordinate where the priority is supposed to be
445 printed. If negative, no priority will be printed.
446 @param posSummary x-coordinate where the summary of the to-do is supposed
447 to be printed.
448 @param posCategories x-coordinate where the categories (tags) should be
449 printed. If negative, no categories will be printed.
450 @param posStartDt x-coordinate where the due date is supposed to the be
451 printed. If negative, no start date will be printed.
452 @param posDueDt x-coordinate where the due date is supposed to the be
453 printed. If negative, no due date will be printed.
454 @param posPercentComplete x-coordinate where the percentage complete is
455 supposed to be printed. If negative, percentage complete will not be printed.
456 @param level Level of the current to-do in the to-do hierarchy (0 means
457 highest level of printed to-dos, 1 are their sub-to-dos, etc.)
458 @param x x-coordinate of the upper left coordinate of the first to-do.
459 @param y y-coordinate of the upper left coordinate of the first to-do.
460 @param width width of the whole to-do list.
461 @param pageHeight Total height allowed for the to-do list on a page.
462 If an to-do would be below that line, a new page is started.
463 @param todoList Contains a list of sub-todos for the specified @p todo .
464 @param r Internal (used when printing sub-to-dos to give information
465 about its parent)
466 */
467 void drawTodo(int &count,
468 const KCalendarCore::Todo::Ptr &todo,
469 QPainter &p,
472 bool connectSubTodos,
473 bool strikeoutCompleted,
474 bool desc,
475 int posPriority,
476 int posSummary,
477 int posCategories,
478 int posStartDt,
479 int posDueDt,
480 int posPercentComplete,
481 int level,
482 int x,
483 int &y,
484 int width,
485 int pageHeight,
486 const KCalendarCore::Todo::List &todoList,
487 TodoParentStart *r);
488
489 /**
490 Draws text lines splitting on page boundaries.
491 @param p QPainter of the printout
492 @param x x-coordinate of the upper left coordinate of the first item
493 @param y y-coordinate of the upper left coordinate of the first item
494 @param width width of the whole list
495 @param pageHeight size of the page. A new page is started when the
496 text reaches the end of the page.
497 */
498 void drawTextLines(QPainter &p, const QString &entry, int x, int &y, int width, int pageHeight, bool richTextEntry);
499
500 void drawSplitHeaderRight(QPainter &p, QDate fd, QDate td, QDate cd, int width, int height);
501
502 /**
503 Draws dotted lines for notes in a box.
504 @param p QPainter of the printout
505 @param box coordinates of the box where the lines will be placed
506 @param startY starting y-coordinate for the first line
507 */
508 void drawNoteLines(QPainter &p, QRect box, int startY);
509
510protected:
511 QTime dayStart() const;
512 QColor categoryBgColor(const KCalendarCore::Incidence::Ptr &incidence) const;
513
514 void drawIncidence(QPainter &p,
515 QRect dayBox,
516 const QString &time,
517 const QString &summary,
518 const QString &description,
519 int &textY,
520 bool singleLineLimit,
521 bool includeDescription,
522 bool richDescription);
523
524 QString toPlainText(const QString &htmlText);
525
526 void drawTodoLines(QPainter &p,
527 const QString &entry,
528 int x,
529 int &y,
530 int width,
531 int pageHeight,
532 bool richTextEntry,
533 QList<TodoParentStart *> &startPoints,
534 bool connectSubTodos);
535
536 KCalendarCore::Event::Ptr holidayEvent(QDate date) const;
537
538protected:
539 bool mUseColors; /**< Whether or not to use event category colors to draw the events. */
540 bool mPrintFooter; /**< Whether or not to print a footer at the bottoms of pages. */
541 bool mShowNoteLines; /**< Whether or not to print horizontal lines in note areas. */
542 bool mExcludeConfidential; /**< Whether or not to print incidences with secrecy "confidential". */
543 bool mExcludePrivate; /**< Whether or not to print incidences with secrecy "private". */
544 int mHeaderHeight;
545 int mSubHeaderHeight;
546 int mFooterHeight;
547 int mMargin;
548 int mPadding;
549 int mBorder;
550
551 static const QColor sHolidayBackground;
552
553private:
554 QColor categoryColor(const QStringList &categories) const;
555
556 /**
557 * Sets the QPainter's brush and pen color according to the Incidence's category.
558 */
559 void setColorsByIncidenceCategory(QPainter &p, const KCalendarCore::Incidence::Ptr &incidence) const;
560
561 QString holidayString(QDate date) const;
562
563 /**
564 * Returns a nice QColor for text, give the input color &c.
565 */
566 QColor getTextColor(const QColor &c) const;
567};
568}
Base class for Calendar printing classes.
int drawHeader(QPainter &p, const QString &title, QDate month1, QDate month2, QRect box, bool expand=false, QColor backColor=QColor())
Draw the gray header bar of the printout to the QPainter.
int drawBoxWithCaption(QPainter &p, QRect box, const QString &caption, const QString &contents, bool sameLine, bool expand, const QFont &captionFont, const QFont &textFont, bool richContents=false)
Draw a component box with a heading (printed in bold).
int footerHeight() const
Returns the height of the page footer.
static void drawShadedBox(QPainter &p, int linewidth, const QBrush &brush, QRect rect)
Draw a shaded box with given width at the given coordinates.
bool mExcludePrivate
Whether or not to print incidences with secrecy "private".
void drawAgendaDayBox(QPainter &p, const KCalendarCore::Event::List &eventList, QDate qd, bool expandable, QTime fromTime, QTime toTime, QRect box, bool includeDescription, bool includeCategories, bool excludeTime, const QList< QDate > &workDays)
Draw the agenda box for the day print style (the box showing all events of that day).
void drawTodo(int &count, const KCalendarCore::Todo::Ptr &todo, QPainter &p, KCalendarCore::TodoSortField sortField, KCalendarCore::SortDirection sortDir, bool connectSubTodos, bool strikeoutCompleted, bool desc, int posPriority, int posSummary, int posCategories, int posStartDt, int posDueDt, int posPercentComplete, int level, int x, int &y, int width, int pageHeight, const KCalendarCore::Todo::List &todoList, TodoParentStart *r)
Draws single to-do and its (indented) sub-to-dos, optionally connects them by a tree-like line,...
bool mShowNoteLines
Whether or not to print horizontal lines in note areas.
virtual void print(QPainter &p, int width, int height)=0
Actually do the printing.
void drawVerticalBox(QPainter &p, int linewidth, QRect box, const QString &str, int flags=-1)
Draw an event box with vertical text.
static void drawBox(QPainter &p, int linewidth, QRect rect)
Draw a box with given width at the given coordinates.
void drawDaysOfWeekBox(QPainter &p, QDate qd, QRect box)
Draw a single weekday name in a box inside the given area of the painter.
void showEventBox(QPainter &p, int linewidth, QRect box, const KCalendarCore::Incidence::Ptr &incidence, const QString &str, int flags=-1)
Print the box for the given event with the given string.
void drawTextLines(QPainter &p, const QString &entry, int x, int &y, int width, int pageHeight, bool richTextEntry)
Draws text lines splitting on page boundaries.
int headerHeight() const
Returns the height of the page header.
void drawSmallMonth(QPainter &p, QDate qd, QRect box)
Draw a small calendar with the days of a month into the given area.
void drawMonth(QPainter &p, QDate dt, QRect box, int maxdays=-1, int subDailyFlags=TimeBoxes, int holidaysFlags=Text)
Draw a vertical representation of the month containing the date dt.
void drawSubHeaderBox(QPainter &p, const QString &str, QRect box)
Draw a subheader box with a shaded background and the given string.
void printEventString(QPainter &p, QRect box, const QString &str, int flags=-1)
Print the given string (event summary) in the given rectangle.
int drawFooter(QPainter &p, QRect box)
Draw a page footer containing the printing date and possibly other things, like a page number.
bool mExcludeConfidential
Whether or not to print incidences with secrecy "confidential".
void doSaveConfig() override
Save complete configuration.
void doPrint(QPrinter *printer) override
Start printing.
void doLoadConfig() override
Load complete configuration.
void drawDayBox(QPainter &p, QDate qd, QTime fromTime, QTime toTime, QRect box, bool fullDate=false, bool printRecurDaily=true, bool printRecurWeekly=true, bool singleLineLimit=true, bool includeDescription=false, bool includeCategories=false)
Draw the box containing a list of all events of the given day (with their times, of course).
void drawMonthTable(QPainter &p, QDate qd, QTime fromTime, QTime toTime, bool weeknumbers, bool recurDaily, bool recurWeekly, bool singleLineLimit, bool includeDescription, bool includeCategories, QRect box)
Draw the month table of the month containing the date qd.
void drawDaysOfWeek(QPainter &p, QDate fromDate, QDate toDate, QRect box)
Draw a horizontal bar with the weekday names of the given date range in the given area of the painter...
static int weekdayColumn(int weekday)
Determines the column of the given weekday ( 1=Monday, 7=Sunday ), taking the start of the week setti...
bool mPrintFooter
Whether or not to print a footer at the bottoms of pages.
bool useColors() const
HELPER FUNCTIONS.
void drawNoteLines(QPainter &p, QRect box, int startY)
Draws dotted lines for notes in a box.
void drawTimeLine(QPainter &p, QTime fromTime, QTime toTime, QRect box)
Draw a (vertical) time scale from time fromTime to toTime inside the given area of the painter.
bool mUseColors
Whether or not to use event category colors to draw the events.
QWidget * createConfigWidget(QWidget *) override
Returns widget for configuring the print format.
Base class for Calendar printing classes.
Definition printplugin.h:33
virtual QString description() const =0
Returns short description of print format.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:16:32 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.