• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

PIMPrint Library

  • sources
  • kde-4.14
  • kdepim
  • pimprint
  • calendar
calprinttodos.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the PimPrint library.
3  *
4  * Copyright (C) 2013 Allen Winter <winter@kde.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to the
18  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #include "calprinttodos.h"
23 
24 #include <KCalCore/Todo>
25 
26 #include <KGlobal>
27 #include <KLocale>
28 #include <KWordWrap>
29 
30 using namespace PimPrint::Calendar;
31 
32 //@cond PRIVATE
33 // The Todo positioning structure
34 class PimPrint::Calendar::CalPrintTodos::TodoParentStart
35 {
36 public:
37  TodoParentStart(const QRect &pt = QRect(), bool hasLine = false, bool page = true)
38  : mRect(pt), mHasLine(hasLine), mSamePage(page)
39  {
40  }
41 
42  QRect mRect;
43  bool mHasLine;
44  bool mSamePage;
45 };
46 
47 class PimPrint::Calendar::CalPrintTodos::Private
48 {
49 public:
50  Private()
51  : mTodoType(AllTodos),
52  mHeaderText(i18nc("@title", "To-do List")),
53  mSortField(KCalCore::TodoSortSummary),
54  mSortDirection(KCalCore::SortDirectionAscending)
55  {
56  }
57 
58  QDate mStartDate; // starting date of print TODO(set a default?)
59  QDate mEndDate; // ending date of print TODO (set a default?)
60  TodoTypes mTodoType; // type of to-dos to print
61  QString mHeaderText; // string for the header text
62  KCalCore::TodoSortField mSortField; // sort on this field
63  KCalCore::SortDirection mSortDirection; // sort in this direction
64 };
65 //@endcond
66 
67 CalPrintTodos::CalPrintTodos(QPrinter *printer)
68  : CalPrintBase(printer), d(new PimPrint::Calendar::CalPrintTodos::Private)
69 {
70  //TODO:
71  // set the calendar and calendar system
72 
73  // Set default print style
74  setPrintStyle(CalPrintBase::TodoList);
75 
76  // Set default Info options
77  setInfoOptions(0);
78 
79  // Set default Type options
80  setTypeOptions(0);
81 
82  // Set default Range options
83  setRangeOptions(0);
84 
85  // Set default Extra options
86  setExtraOptions(0);
87 }
88 
89 CalPrintTodos::~CalPrintTodos()
90 {
91  delete d;
92 }
93 
94 void CalPrintTodos::setStartDate(const QDate &date)
95 {
96  d->mStartDate = date;
97 }
98 
99 QDate CalPrintTodos::startDate() const
100 {
101  return d->mStartDate;
102 }
103 
104 void CalPrintTodos::setEndDate(const QDate &date)
105 {
106  d->mEndDate = date;
107 }
108 
109 QDate CalPrintTodos::endDate() const
110 {
111  return d->mEndDate;
112 }
113 
114 void CalPrintTodos::setHeaderText(const QString &text)
115 {
116  d->mHeaderText = text;
117 }
118 
119 QString CalPrintTodos::headerText() const
120 {
121  return d->mHeaderText;
122 }
123 
124 void CalPrintTodos::setSortField(const KCalCore::TodoSortField &sortField)
125 {
126  d->mSortField = sortField;
127 }
128 
129 KCalCore::TodoSortField CalPrintTodos::sortField() const
130 {
131  return d->mSortField;
132 }
133 
134 void CalPrintTodos::setSortDirection(const KCalCore::SortDirection &sortDirection)
135 {
136  d->mSortDirection = sortDirection;
137 }
138 
139 KCalCore::SortDirection CalPrintTodos::sortDirection() const
140 {
141  return d->mSortDirection;
142 }
143 
144 void CalPrintTodos::print(QPainter &p)
145 {
146  // TODO: Find a good way to guarantee a nicely designed output
147  int pospriority = 0;
148  int possummary = 100;
149  int posdue = pageWidth() - 65;
150  int poscomplete = posdue - 70; //Complete column is to right of the Due column
151  int lineSpacing = 15;
152 
153  QRect headerBox(0, 0, pageWidth(), headerHeight());
154  QRect footerBox(0, pageHeight() - footerHeight(), pageWidth(), footerHeight());
155  int height = pageHeight() - footerHeight();
156 
157  // Draw the First Page Header
158  drawHeader(p, headerBox, d->mHeaderText, d->mStartDate, QDate());
159 
160  // Draw the Column Headers
161  int currentLinePos = headerHeight() + 5;
162  QString outStr;
163  QFont oldFont(p.font());
164 
165  p.setFont(QFont(QLatin1String("sans-serif"), 9, QFont::Bold));
166  lineSpacing = p.fontMetrics().lineSpacing();
167  currentLinePos += lineSpacing;
168  if (infoOptions().testFlag(CalPrintBase::InfoPriority)) {
169  outStr += i18nc("@title", "Priority");
170  p.drawText(pospriority, currentLinePos - 2, outStr);
171  } else {
172  pospriority = -1;
173  }
174 
175  outStr.truncate(0);
176  outStr += i18nc("@label to-do summary", "Title");
177  p.drawText(possummary, currentLinePos - 2, outStr);
178 
179  if (infoOptions().testFlag(CalPrintBase::InfoPercentDone)) {//TODO: should be true by default
180  if (!infoOptions().testFlag(CalPrintBase::InfoDueDate)) {//TODO: should be true by default
181  // Print Percent Complete in the Due Date column
182  poscomplete = posdue;
183  }
184  outStr.truncate(0);
185  outStr += i18nc("@label to-do percentage complete", "Complete");
186  p.drawText(poscomplete, currentLinePos - 2, outStr);
187  } else {
188  poscomplete = -1;
189  }
190 
191  if (infoOptions().testFlag(CalPrintBase::InfoDueDate)) {//TODO: should be true by default
192  outStr.truncate(0);
193  outStr += i18nc("@label to-do due date", "Due");
194  p.drawText(posdue, currentLinePos - 2, outStr);
195  } else {
196  posdue = -1;
197  }
198 
199  p.setFont(QFont(QLatin1String("sans-serif"), 10));
200 
201  KCalCore::Todo::List todoList;
202  KCalCore::Todo::List tempList;
203 
204  // Create list of to-dos which will be printed
205  todoList = printCalendar()->todos(d->mSortField, d->mSortDirection);
206  switch (d->mTodoType) {
207  case AllTodos:
208  break;
209  case Completed: //TODO: IMPLEMENT
210  break;
211  case NotStarted: // TODO: IMPLEMENT
212  break;
213  case OpenEnded: // TODO: IMPLEMENT
214  break;
215  case OverDue: // TODO: IMPLEMENT
216  break;
217  case InProgressTodos:
218  Q_FOREACH (const KCalCore::Todo::Ptr &todo, todoList) {
219  Q_ASSERT(todo);
220  if (!todo->isCompleted()) {
221  tempList.append(todo);
222  }
223  }
224  todoList = tempList;
225  break;
226  case DueDateRangeTodos:
227  Q_FOREACH (const KCalCore::Todo::Ptr &todo, todoList) {
228  Q_ASSERT(todo);
229  if (todo->hasDueDate()) {
230  if (todo->dtDue().date() >= d->mStartDate && todo->dtDue().date() <= d->mEndDate) {
231  tempList.append(todo);
232  }
233  } else {
234  tempList.append(todo);
235  }
236  }
237  todoList = tempList;
238  break;
239  }
240 
241  const bool printConf = typeOptions().testFlag(
242  CalPrintBase::TypeConfidential); //TODO should be false by default
243  const bool printPrivate = typeOptions().testFlag(
244  CalPrintBase::TypePrivate); //TODO should be false by default
245 
246  // Print to-dos
247  int count = 0;
248  Q_FOREACH (const KCalCore::Todo::Ptr &todo, todoList) {
249  if ((!printConf && todo->secrecy() == KCalCore::Incidence::SecrecyConfidential) ||
250  (!printPrivate && todo->secrecy() == KCalCore::Incidence::SecrecyPrivate)) {
251  continue;
252  }
253  // Skip sub-to-dos. They will be printed recursively in drawTodo()
254  if (todo->relatedTo().isEmpty()) { //review(AKONADI_PORT)
255  count++;
256  drawTodo(count, todo, p,
257  pospriority, possummary, posdue, poscomplete,
258  0, 0, currentLinePos, pageWidth(), height, todoList, 0);
259  }
260  }
261 
262  if (extraOptions().testFlag(CalPrintBase::ExtraFooter)) {
263  drawFooter(p, footerBox);
264  }
265  p.setFont(oldFont);
266 }
267 
268 void CalPrintTodos::drawTodo(int &count, const KCalCore::Todo::Ptr &todo, QPainter &p,
269  int posPriority, int posSummary,
270  int posDueDt, int posPercentComplete,
271  int level, int x, int &y,
272  int width, int pageHeight,
273  const KCalCore::Todo::List &todoList,
274  TodoParentStart *r)
275 {
276  QString outStr;
277  const KLocale *local = KGlobal::locale(); //TODO: set in ctor
278  QRect rect;
279  TodoParentStart startpt;
280  // This list keeps all starting points of the parent to-dos so the connection
281  // lines of the tree can easily be drawn (needed if a new page is started)
282  static QList<TodoParentStart *> startPoints;
283  if (level < 1) {
284  startPoints.clear();
285  }
286 
287  y += 10;
288 
289  // Compute the right hand side of the to-do box
290  int rhs = posPercentComplete;
291  if (rhs < 0) {
292  rhs = posDueDt; //not printing percent completed
293  }
294  if (rhs < 0) {
295  rhs = x + width; //not printing due dates either
296  }
297 
298  int left = posSummary + (level * 10);
299 
300  // If this is a sub-to-do, r will not be 0, and we want the LH side
301  // of the priority line up to the RH side of the parent to-do's priority
302  bool showPriority = posPriority >= 0;
303  int lhs = posPriority;
304  if (r) {
305  lhs = r->mRect.right() + 1;
306  }
307 
308  outStr.setNum(todo->priority());
309  rect = p.boundingRect(lhs, y + 10, 5, -1, Qt::AlignCenter, outStr);
310  // Make it a more reasonable size
311  rect.setWidth(18);
312  rect.setHeight(18);
313 
314  // Draw a checkbox
315  p.setBrush(QBrush(Qt::NoBrush));
316  p.drawRect(rect);
317  if (todo->isCompleted()) {
318  // cross out the rectangle for completed to-dos
319  p.drawLine(rect.topLeft(), rect.bottomRight());
320  p.drawLine(rect.topRight(), rect.bottomLeft());
321  }
322  lhs = rect.right() + 3;
323 
324  // Priority
325  if (todo->priority() > 0 && showPriority) {
326  p.drawText(rect, Qt::AlignCenter, outStr);
327  }
328  startpt.mRect = rect; //save for later
329 
330  // Connect the dots
331  if (extraOptions().testFlag(CalPrintBase::ExtraConnectSubTodos)) {//TODO should be true by default
332  if (r && level > 0) {
333  int bottom;
334  int center(r->mRect.left() + (r->mRect.width() / 2));
335  int to(rect.top() + (rect.height() / 2));
336  int endx(rect.left());
337  p.drawLine(center, to, endx, to); // side connector
338  if (r->mSamePage) {
339  bottom = r->mRect.bottom() + 1;
340  } else {
341  bottom = 0;
342  }
343  p.drawLine(center, bottom, center, to);
344  }
345  }
346 
347  // summary
348  outStr = todo->summary();
349  rect = p.boundingRect(lhs, rect.top(), (rhs - (left + rect.width() + 5)),
350  -1, Qt::TextWordWrap, outStr);
351 
352  QRect newrect;
353  QFont newFont(p.font());
354  QFont oldFont(p.font());
355  if (extraOptions().testFlag(CalPrintBase::ExtraStrikeDoneTodos) &&
356  todo->isCompleted()) {//TODO: should be false by default
357  newFont.setStrikeOut(true);
358  p.setFont(newFont);
359  }
360  p.drawText(rect, Qt::TextWordWrap, outStr, &newrect);
361  p.setFont(oldFont);
362  // due date
363  if (todo->hasDueDate() && posDueDt >= 0) {
364  outStr = local->formatDate(todo->dtDue().toLocalZone().date(), KLocale::ShortDate);
365  rect = p.boundingRect(posDueDt, y, x + width, -1,
366  Qt::AlignTop | Qt::AlignLeft, outStr);
367  p.drawText(rect, Qt::AlignTop | Qt::AlignLeft, outStr);
368  }
369 
370  // percentage completed
371  bool showPercentComplete = posPercentComplete >= 0;
372  if (showPercentComplete) {
373  int lwidth = 24;
374  int lheight = 12;
375  //first, draw the progress bar
376  int progress = (int)((lwidth * todo->percentComplete()) / 100.0 + 0.5);
377 
378  p.setBrush(QBrush(Qt::NoBrush));
379  p.drawRect(posPercentComplete, y + 3, lwidth, lheight);
380  if (progress > 0) {
381  p.setBrush(QColor(128, 128, 128));
382  p.drawRect(posPercentComplete, y + 3, progress, lheight);
383  }
384 
385  //now, write the percentage
386  outStr = i18nc("@item the percent completed of a to-do", "%1%", todo->percentComplete());
387  rect = p.boundingRect(posPercentComplete + lwidth + 3, y, x + width, -1,
388  Qt::AlignTop | Qt::AlignLeft, outStr);
389  p.drawText(rect, Qt::AlignTop | Qt::AlignLeft, outStr);
390  }
391 
392  const bool printConf = typeOptions().testFlag(
393  CalPrintBase::TypeConfidential); //TODO should be false by default
394  const bool printPrivate = typeOptions().testFlag(
395  CalPrintBase::TypePrivate); //TODO should be false by default
396 
397  y += 10;
398 
399  // Make a list of all the sub-to-dos related to this to-do.
400  KCalCore::Todo::List t;
401  KCalCore::Incidence::List relations = printCalendar()->relations(todo->uid());
402 
403  Q_FOREACH (const KCalCore::Incidence::Ptr &incidence, relations) {
404  // In the future, to-dos might also be related to events
405  // Manually check if the sub-to-do is in the list of to-dos to print
406  // The problem is that relations() does not apply filters, so
407  // we need to compare manually with the complete filtered list!
408  KCalCore::Todo::Ptr subtodo = incidence.dynamicCast<KCalCore::Todo>();
409  if (!subtodo) {
410  continue;
411  }
412 #ifdef AKONADI_PORT_DISABLED
413  if (subtodo && todoList.contains(subtodo)) {
414 #else
415  bool subtodoOk = false;
416  if (subtodo) {
417  Q_FOREACH (const KCalCore::Todo::Ptr &tt, todoList) {
418  if (tt == subtodo) {
419  subtodoOk = true;
420  break;
421  }
422  }
423  }
424  if (subtodoOk) {
425 #endif
426  if ((!printConf && subtodo->secrecy() == KCalCore::Incidence::SecrecyConfidential) ||
427  (!printPrivate && subtodo->secrecy() == KCalCore::Incidence::SecrecyPrivate)) {
428  continue;
429  }
430  t.append(subtodo);
431  }
432  }
433 
434  // has sub-todos?
435  startpt.mHasLine = (relations.size() > 0);
436  startPoints.append(&startpt);
437 
438  // description
439  if (infoOptions().testFlag(CalPrintBase::InfoDescription) && //TODO: should be false by default
440  !todo->description().isEmpty()) {
441  y = newrect.bottom() + 5;
442  drawTodoLines(p, todo->description(), left, y,
443  width - (left + 10 - x), pageHeight,
444  todo->descriptionIsRich(),
445  startPoints);
446  } else {
447  y += 10;
448  }
449 
450  // Sort the sub-to-dos and print them
451 #ifdef AKONADI_PORT_DISABLED
452  KCalCore::Todo::List sl = printCalendar()->sortTodos(&t, d->mSortField, d->mSortDirection);
453 #else
454  KCalCore::Todo::List tl;
455  Q_FOREACH (const KCalCore::Todo::Ptr &todo, t) {
456  tl.append(todo);
457  }
458  KCalCore::Todo::List sl = printCalendar()->sortTodos(tl, d->mSortField, d->mSortDirection);
459 #endif
460 
461  int subcount = 0;
462  Q_FOREACH (const KCalCore::Todo::Ptr &isl, sl) {
463  count++;
464  if (++subcount == sl.size()) {
465  startpt.mHasLine = false;
466  }
467  drawTodo(count, isl, p,
468  posPriority, posSummary, posDueDt, posPercentComplete,
469  level + 1, x, y, width, pageHeight, todoList, &startpt);
470  }
471  startPoints.removeAll(&startpt);
472 }
473 
474 void CalPrintTodos::drawTodoLines(QPainter &p,
475  const QString &description,
476  int x, int &y,
477  int width, int pageHeight,
478  bool richTextDescription,
479  QList<TodoParentStart *> &startPoints)
480 {
481  QString plainDesc = (richTextDescription) ? toPlainText(description) : description;
482 
483  QRect textrect(0, 0, width, -1);
484  int flags = Qt::AlignLeft;
485  QFontMetrics fm = p.fontMetrics(); //TODO: set in ctor
486 
487  QStringList lines = plainDesc.split(QLatin1Char('\n'));
488  for (int currentLine = 0; currentLine < lines.count(); currentLine++) {
489  // split paragraphs into lines
490  KWordWrap *ww = KWordWrap::formatText(fm, textrect, flags, lines[currentLine]);
491  QStringList textLine = ww->wrappedString().split(QLatin1Char('\n'));
492  delete ww;
493 
494  // print each individual line
495  for (int lineCount = 0; lineCount < textLine.count(); lineCount++) {
496  if (y >= pageHeight) {
497  if (extraOptions().testFlag(CalPrintBase::ExtraConnectSubTodos)) {//TODO should be true by default
498  for (int i = 0; i < startPoints.size(); ++i) {
499  TodoParentStart *rct;
500  rct = startPoints.at(i);
501  int start = rct->mRect.bottom() + 1;
502  int center = rct->mRect.left() + (rct->mRect.width() / 2);
503  int to = y;
504  if (!rct->mSamePage) {
505  start = 0;
506  }
507  if (rct->mHasLine) {
508  p.drawLine(center, start, center, to);
509  }
510  rct->mSamePage = false;
511  }
512  }
513  y = 0;
514  thePrinter()->newPage();
515  }
516  y += fm.height();
517  p.drawText(x, y, textLine[lineCount]);
518  }
519  }
520 }
PimPrint::Calendar::CalPrintBase::ExtraStrikeDoneTodos
Definition: calprintbase.h:307
QList::clear
void clear()
PimPrint::Calendar::CalPrintBase::InfoPriority
Definition: calprintbase.h:278
PimPrint::Calendar::CalPrintBase::setPrintStyle
void setPrintStyle(const Style style)
Sets the printing Style.
Definition: calprintbase.cpp:193
PimPrint::Calendar::CalPrintBase::setExtraOptions
void setExtraOptions(ExtraOptions flags)
Sets extra options for printing.
Definition: calprintbase.cpp:361
QRect::topRight
QPoint topRight() const
PimPrint::Calendar::CalPrintTodos::Completed
Definition: calprinttodos.h:74
QString::truncate
void truncate(int position)
PimPrint::Calendar::CalPrintBase::ExtraConnectSubTodos
Definition: calprintbase.h:308
PimPrint::Calendar::CalPrintBase::thePrinter
QPrinter * thePrinter() const
Returns a pointer to the currently set QPrinter.
Definition: calprintbase.cpp:168
QRect::right
int right() const
QPrinter
PimPrint::Calendar::CalPrintTodos::sortDirection
KCalCore::SortDirection sortDirection() const
Returns the current sorting direction.
Definition: calprinttodos.cpp:139
PimPrint::Calendar::CalPrintTodos::setEndDate
void setEndDate(const QDate &date)
Sets the printout ending date.
Definition: calprinttodos.cpp:104
QString::split
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
PimPrint::Calendar::CalPrintBase::TodoList
Definition: calprintbase.h:131
QPainter::font
const QFont & font() const
QFont
PimPrint::Calendar::CalPrintBase::typeOptions
TypeOptions typeOptions() const
Returns the current type option flags.
Definition: calprintbase.cpp:346
PimPrint::Calendar::CalPrintTodos::sortField
KCalCore::TodoSortField sortField() const
Returns the current sorting field.
Definition: calprinttodos.cpp:129
QList::at
const T & at(int i) const
PimPrint::Calendar::CalPrintBase::extraOptions
ExtraOptions extraOptions() const
Returns the current extra option flags.
Definition: calprintbase.cpp:366
PimPrint::Calendar::CalPrintTodos
Definition: calprinttodos.h:35
QRect::bottomRight
QPoint bottomRight() const
PimPrint::Calendar::CalPrintTodos::setStartDate
void setStartDate(const QDate &date)
Sets the printout starting date.
Definition: calprinttodos.cpp:94
QRect::bottomLeft
QPoint bottomLeft() const
PimPrint::Calendar::CalPrintBase::pageWidth
int pageWidth() const
Returns the current printed page width.
QRect::height
int height() const
QBrush
QFontMetrics
PimPrint::Calendar::CalPrintTodos::setHeaderText
void setHeaderText(const QString &text)
Sets the text for the print header.
Definition: calprinttodos.cpp:114
QPainter::drawLine
void drawLine(const QLineF &line)
PimPrint::Calendar::CalPrintTodos::CalPrintTodos
CalPrintTodos(QPrinter *printer)
Definition: calprinttodos.cpp:67
PimPrint::Calendar::CalPrintTodos::~CalPrintTodos
virtual ~CalPrintTodos()
Definition: calprinttodos.cpp:89
QList::size
int size() const
PimPrint::Calendar::CalPrintTodos::startDate
QDate startDate() const
Returns the current print starting date.
PimPrint::Calendar::CalPrintTodos::DueDateRangeTodos
Definition: calprinttodos.h:79
PimPrint::Calendar::CalPrintTodos::print
void print(QPainter &p)
Definition: calprinttodos.cpp:144
PimPrint::Calendar::CalPrintTodos::headerText
QString headerText() const
Returns the current header text string.
PimPrint::Calendar::CalPrintTodos::OverDue
Definition: calprinttodos.h:78
QPainter::drawRect
void drawRect(const QRectF &rectangle)
QRect
QPainter::setFont
void setFont(const QFont &font)
QList::count
int count(const T &value) const
QList::append
void append(const T &value)
PimPrint::Calendar::CalPrintBase::TypePrivate
Definition: calprintbase.h:291
QPainter::boundingRect
QRectF boundingRect(const QRectF &rectangle, int flags, const QString &text)
QRect::top
int top() const
PimPrint::Calendar::CalPrintBase::InfoDescription
Definition: calprintbase.h:274
PimPrint::Calendar::CalPrintTodos::setSortDirection
void setSortDirection(const KCalCore::SortDirection &sortDirection)
Sets the sorting direction.
Definition: calprinttodos.cpp:134
PimPrint::Calendar::CalPrintTodos::setSortField
void setSortField(const KCalCore::TodoSortField &sortField)
Sets the sorting to-do property.
Definition: calprinttodos.cpp:124
QRect::left
int left() const
QPainter
QRect::setWidth
void setWidth(int width)
QList::removeAll
int removeAll(const T &value)
PimPrint::Calendar::CalPrintTodos::endDate
QDate endDate() const
Returns the current print ending date.
PimPrint::Calendar::CalPrintBase::ExtraFooter
Definition: calprintbase.h:309
PimPrint::Calendar::CalPrintBase::infoOptions
InfoOptions infoOptions() const
Returns the current information option flags.
Definition: calprintbase.cpp:336
PimPrint::Calendar::CalPrintBase::drawFooter
int drawFooter(QPainter &p, const QRect &box) const
Draws a page footer containing the printing date and possibly other things, like a page number...
Definition: calprintbase.cpp:568
QPainter::setBrush
void setBrush(const QBrush &brush)
PimPrint::Calendar::CalPrintBase
Definition: calprintbase.h:67
PimPrint::Calendar::CalPrintBase::printCalendar
KCalCore::Calendar::Ptr printCalendar() const
Returns a pointer to the currently set print calendar.
Definition: calprintbase.cpp:178
QPainter::drawText
void drawText(const QPointF &position, const QString &text)
QDate
QString
QList
QColor
QStringList
PimPrint::Calendar::CalPrintBase::setRangeOptions
void setRangeOptions(RangeOptions flags)
Sets time-range options for printing.
Definition: calprintbase.cpp:351
QLatin1Char
PimPrint::Calendar::CalPrintBase::headerHeight
int headerHeight() const
Returns the current height of the page header.
to
Definition: calprinttodos.h:28
QPrinter::newPage
bool newPage()
PimPrint::Calendar::CalPrintBase::setInfoOptions
void setInfoOptions(InfoOptions flags)
Sets information options for printing.
Definition: calprintbase.cpp:331
PimPrint::Calendar::CalPrintBase::drawHeader
int drawHeader(QPainter &p, const QRect &box, const QString &title, const QDate &leftMonth=QDate(), const QDate &rightMonth=QDate(), const bool expand=false, const QColor &backColor=QColor()) const
Draws the gray header bar of the printout to the QPainter.
Definition: calprintbase.cpp:497
PimPrint::Calendar::CalPrintTodos::TodoTypes
TodoTypes
Various types of to-dos that can be printed.
Definition: calprinttodos.h:72
calprinttodos.h
PimPrint::Calendar::CalPrintBase::footerHeight
int footerHeight() const
Returns the current height of the page footer.
QRect::width
int width() const
QLatin1String
PimPrint::Calendar::CalPrintTodos::InProgressTodos
Definition: calprinttodos.h:75
QString::setNum
QString & setNum(short n, int base)
QPainter::fontMetrics
QFontMetrics fontMetrics() const
QRect::setHeight
void setHeight(int height)
PimPrint::Calendar::CalPrintBase::setTypeOptions
void setTypeOptions(TypeOptions flags)
Sets type options for printing.
Definition: calprintbase.cpp:341
QFontMetrics::height
int height() const
QRect::bottom
int bottom() const
QRect::topLeft
QPoint topLeft() const
QStringList::split
QStringList split(const QString &sep, const QString &str, bool allowEmptyEntries)
QFont::setStrikeOut
void setStrikeOut(bool enable)
PimPrint::Calendar::CalPrintBase::pageHeight
int pageHeight() const
Returns the current printed page height.
PimPrint::Calendar::CalPrintTodos::NotStarted
Definition: calprinttodos.h:76
PimPrint::Calendar::CalPrintBase::toPlainText
QString toPlainText(const QString &htmlText) const
Converts possible rich text to plain text.
Definition: calprintbase.cpp:1342
PimPrint::Calendar::CalPrintTodos::OpenEnded
Definition: calprinttodos.h:77
PimPrint::Calendar::CalPrintTodos::AllTodos
Definition: calprinttodos.h:73
PimPrint::Calendar::CalPrintBase::InfoPercentDone
Definition: calprintbase.h:280
QFontMetrics::lineSpacing
int lineSpacing() const
PimPrint::Calendar::CalPrintBase::TypeConfidential
Definition: calprintbase.h:290
PimPrint::Calendar::CalPrintBase::InfoDueDate
Definition: calprintbase.h:279
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

PIMPrint Library

Skip menu "PIMPrint Library"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal