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

KDE's Doxygen guidelines are available online.