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

korganizer

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CalPrintPluginBase Class Referenceabstract

#include <calprintpluginbase.h>

Inheritance diagram for CalPrintPluginBase:
Inheritance graph
[legend]

Public Types

enum  DisplayFlags { Text =0x0001, TimeBoxes =0x0002 }
 
- Public Types inherited from KOrg::PrintPlugin
typedef QList< PrintPlugin * > List
 

Public Member Functions

 CalPrintPluginBase ()
 
virtual ~CalPrintPluginBase ()
 
int borderWidth () const
 
const KCalendarSystem * calendarSystem () const
 
QColor categoryBgColor (const Incidence::Ptr &incidence)
 
virtual QWidget * createConfigWidget (QWidget *)
 
QTime dayStart ()
 
void doLoadConfig ()
 
virtual void doPrint (QPrinter *printer)
 
void doSaveConfig ()
 
void drawAgendaDayBox (QPainter &p, const KCalCore::Event::List &eventList, const QDate &qd, bool expandable, const QTime &fromTime, const QTime &toTime, const QRect &box, bool includeDescription, bool excludeTime, bool mExcludeConfidential, bool mExcludePrivate, const QList< QDate > &workDays)
 
void drawAgendaItem (PrintCellItem *item, QPainter &p, const KDateTime &startPrintDate, const KDateTime &endPrintDate, float minlen, const QRect &box, bool includeDescription, bool excludeTime)
 
int drawAllDayBox (QPainter &p, const KCalCore::Event::List &eventList, const QDate &qd, bool expandable, const QRect &box, bool mExcludeConfidential, bool mExcludePrivate)
 
int drawBoxWithCaption (QPainter &p, const QRect &box, const QString &caption, const QString &contents, bool sameLine, bool expand, const QFont &captionFont, const QFont &textFont, bool richContents=false)
 
void drawDayBox (QPainter &p, const QDate &qd, const QTime &fromTime, const QTime &toTime, const QRect &box, bool fullDate=false, bool printRecurDaily=true, bool printRecurWeekly=true, bool singleLineLimit=true, bool showNoteLines=false, bool includeDescription=false, bool excludeDescription=true, bool excludePrivate=true)
 
void drawDays (QPainter &p, const QDate &start, const QDate &end, const QTime &fromTime, const QTime &toTime, const QRect &box, bool singleLineLimit, bool showNoteLines, bool includeDescription, bool excludeConfidential, bool excludePrivate)
 
void drawDaysOfWeek (QPainter &p, const QDate &fromDate, const QDate &toDate, const QRect &box)
 
void drawDaysOfWeekBox (QPainter &p, const QDate &qd, const QRect &box)
 
int drawFooter (QPainter &p, const QRect &box)
 
int drawHeader (QPainter &p, const QString &title, const QDate &month1, const QDate &month2, const QRect &box, bool expand=false, QColor backColor=QColor())
 
void drawJournal (const Journal::Ptr &journal, QPainter &p, int x, int &y, int width, int pageHeight)
 
void drawMonth (QPainter &p, const QDate &dt, const QRect &box, int maxdays=-1, int subDailyFlags=TimeBoxes, int holidaysFlags=Text)
 
void drawMonthTable (QPainter &p, const QDate &qd, const QTime &fromTime, const QTime &toTime, bool weeknumbers, bool recurDaily, bool recurWeekly, bool singleLineLimit, bool showNoteLines, bool includeDescription, bool excludeConfidential, bool excludePrivate, const QRect &box)
 
void drawNoteLines (QPainter &p, const QRect &box, int startY)
 
void drawSmallMonth (QPainter &p, const QDate &qd, const QRect &box)
 
void drawSplitHeaderRight (QPainter &p, const QDate &fd, const QDate &td, const QDate &cd, int width, int height)
 
void drawSubHeaderBox (QPainter &p, const QString &str, const QRect &box)
 
void drawTextLines (QPainter &p, const QString &entry, int x, int &y, int width, int pageHeight, bool richTextEntry)
 
void drawTimeLine (QPainter &p, const QTime &fromTime, const QTime &toTime, const QRect &box)
 
void drawTimeTable (QPainter &p, const QDate &fromDate, const QDate &toDate, bool expandable, const QTime &fromTime, const QTime &toTime, const QRect &box, bool includeDescription, bool excludeTime, bool excludeConfidential, bool excludePrivate)
 
void drawTodo (int &count, const KCalCore::Todo::Ptr &todo, QPainter &p, KCalCore::TodoSortField sortField, KCalCore::SortDirection sortDir, bool connectSubTodos, bool strikeoutCompleted, bool desc, int posPriority, int posSummary, int posDueDt, int posPercentComplete, int level, int x, int &y, int width, int pageHeight, const KCalCore::Todo::List &todoList, TodoParentStart *r, bool excludeConfidential, bool excludePrivate)
 
void drawVerticalBox (QPainter &p, int linewidth, const QRect &box, const QString &str, int flags=-1)
 
void drawWeek (QPainter &p, const QDate &qd, const QTime &fromTime, const QTime &toTime, const QRect &box, bool singleLineLimit, bool showNoteLines, bool includeDescription, bool excludeConfidential, bool excludePrivate)
 
int footerHeight () const
 
int headerHeight () const
 
Event::Ptr holiday (const QDate &dt)
 
QString holidayString (const QDate &dt)
 
virtual void loadConfig ()=0
 
int margin () const
 
QPrinter::Orientation orientation () const
 
int padding () const
 
virtual void print (QPainter &p, int width, int height)=0
 
void printEventString (QPainter &p, const QRect &box, const QString &str, int flags=-1)
 
bool printFooter () const
 
virtual void saveConfig ()=0
 
void setBorderWidth (const int border)
 
void setCalendarSystem (const KCalendarSystem *calsys)
 
void setCategoryColors (QPainter &p, const Incidence::Ptr &incidence)
 
void setFooterHeight (const int height)
 
void setHeaderHeight (const int height)
 
void setKOrgCoreHelper (KOrg::CoreHelper *helper)
 
void setMargin (const int margin)
 
void setPadding (const int margin)
 
void setPrintFooter (bool printFooter)
 
void setSubHeaderHeight (const int height)
 
void setUseColors (bool useColors)
 
void showEventBox (QPainter &p, int linewidth, const QRect &box, const Incidence::Ptr &incidence, const QString &str, int flags=-1)
 
int subHeaderHeight () const
 
bool useColors () const
 
- Public Member Functions inherited from KOrg::PrintPlugin
 PrintPlugin ()
 
virtual ~PrintPlugin ()
 
QWidget * configWidget (QWidget *w)
 
virtual QPrinter::Orientation defaultOrientation ()
 
virtual QString description ()=0
 
virtual bool enabled ()
 
virtual QString groupName ()=0
 
virtual QString info () const =0
 
virtual void readSettingsWidget ()
 
virtual KCalCore::Incidence::List selectedIncidences () const
 
virtual void setCalendar (const Akonadi::ETMCalendar::Ptr &cal)
 
virtual void setConfig (KConfig *cfg)
 
virtual void setDateRange (const QDate &from, const QDate &to)
 
virtual void setSelectedIncidences (KCalCore::Incidence::List inc)
 
virtual void setSettingsWidget ()
 
virtual int sortID ()
 

Static Public Member Functions

static void drawBox (QPainter &p, int linewidth, const QRect &rect)
 
static void drawShadedBox (QPainter &p, int linewidth, const QBrush &brush, const QRect &rect)
 
static int weekdayColumn (int weekday)
 
- Static Public Member Functions inherited from KOrg::PrintPlugin
static int interfaceVersion ()
 
static QString serviceType ()
 

Protected Member Functions

void drawIncidence (QPainter &p, const QRect &dayBox, const QString &time, const QString &summary, const QString &description, int &textY, bool singleLineLimit, bool includeDescription, bool richDescription)
 
void drawTodoLines (QPainter &p, const QString &entry, int x, int &y, int width, int pageHeight, bool richTextEntry, QList< TodoParentStart * > &startPoints, bool connectSubTodos)
 
QString toPlainText (const QString &htmlText)
 

Protected Attributes

int mBorder
 
const KCalendarSystem * mCalSys
 
bool mExcludeConfidential
 
bool mExcludePrivate
 
int mFooterHeight
 
int mHeaderHeight
 
int mMargin
 
int mPadding
 
bool mPrintFooter
 
bool mShowNoteLines
 
int mSubHeaderHeight
 
bool mUseColors
 
- Protected Attributes inherited from KOrg::PrintPlugin
Akonadi::ETMCalendar::Ptr mCalendar
 
KConfig * mConfig
 
QPointer< QWidget > mConfigWidget
 
KOrg::CoreHelper * mCoreHelper
 
QDate mFromDate
 
QPrinter * mPrinter
 
KCalCore::Incidence::List mSelectedIncidences
 
QDate mToDate
 

Detailed Description

Base class for KOrganizer printing classes.

Each sub class represents one calendar print format.

Definition at line 64 of file calprintpluginbase.h.

Member Enumeration Documentation

enum CalPrintPluginBase::DisplayFlags
Enumerator
Text 
TimeBoxes 

Definition at line 67 of file calprintpluginbase.h.

Constructor & Destructor Documentation

CalPrintPluginBase::CalPrintPluginBase ( )

Constructor.

Definition at line 111 of file calprintpluginbase.cpp.

CalPrintPluginBase::~CalPrintPluginBase ( )
virtual

Definition at line 118 of file calprintpluginbase.cpp.

Member Function Documentation

int CalPrintPluginBase::borderWidth ( ) const

Definition at line 381 of file calprintpluginbase.cpp.

const KCalendarSystem * CalPrintPluginBase::calendarSystem ( ) const

Definition at line 305 of file calprintpluginbase.cpp.

QColor CalPrintPluginBase::categoryBgColor ( const Incidence::Ptr &  incidence)

Helper functions to hide the KOrg::CoreHelper.

Definition at line 267 of file calprintpluginbase.cpp.

QWidget * CalPrintPluginBase::createConfigWidget ( QWidget *  w)
virtual

Returns widget for configuring the print format.

Implements KOrg::PrintPlugin.

Reimplemented in CalPrintTodos, CalPrintMonth, CalPrintWeek, CalPrintDay, CalPrintIncidence, CalPrintWhatsNext, CalPrintItemList, CalPrintYear, and CalPrintJournal.

Definition at line 122 of file calprintpluginbase.cpp.

QTime CalPrintPluginBase::dayStart ( )

Definition at line 246 of file calprintpluginbase.cpp.

void CalPrintPluginBase::doLoadConfig ( )
virtual

Load complete config.

This also calls loadConfig() of the derived class.

Reimplemented from KOrg::PrintPlugin.

Definition at line 175 of file calprintpluginbase.cpp.

void CalPrintPluginBase::doPrint ( QPrinter *  printer)
virtual

Start printing.

Implements KOrg::PrintPlugin.

Definition at line 142 of file calprintpluginbase.cpp.

void CalPrintPluginBase::doSaveConfig ( )
virtual

Save complete config.

This also calls saveConfig() of the derived class.

Reimplemented from KOrg::PrintPlugin.

Definition at line 193 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawAgendaDayBox ( QPainter &  p,
const KCalCore::Event::List &  eventList,
const QDate &  qd,
bool  expandable,
const QTime &  fromTime,
const QTime &  toTime,
const QRect &  box,
bool  includeDescription,
bool  excludeTime,
bool  mExcludeConfidential,
bool  mExcludePrivate,
const QList< QDate > &  workDays 
)

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. Does NOT draw allday events. Use drawAllDayBox for allday events.

Parameters
pQPainter of the printout
eventListThe list of the events that are supposed to be printed inside this box
qdThe date of the currently printed day
expandableIf true, the start and end times are adjusted to include the whole range of all events of that day, not just of the given time range. The height of the box will not be affected by this (but the height of one hour will be scaled down so that the whole range fits into the box. fromTime and toTime receive the actual time range printed by this function).
fromTimeStart of the time range to be printed. Might be adjusted to include all events if expandable==true
toTimeEnd of the time range to be printed. Might be adjusted to include all events if expandable==true
boxcoordinates of the agenda day box.
includeDescriptionWhether to print the event description as well.
excludeTimeWhether the time is printed in the detail area.
excludeConfidentialWhether to exclude Incidence marked confidential.
excludePrivateWhether to exclude Incidence marked private.
workDaysList of workDays

Definition at line 858 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawAgendaItem ( PrintCellItem *  item,
QPainter &  p,
const KDateTime &  startPrintDate,
const KDateTime &  endPrintDate,
float  minlen,
const QRect &  box,
bool  includeDescription,
bool  excludeTime 
)

Definition at line 975 of file calprintpluginbase.cpp.

int CalPrintPluginBase::drawAllDayBox ( QPainter &  p,
const KCalCore::Event::List &  eventList,
const QDate &  qd,
bool  expandable,
const QRect &  box,
bool  mExcludeConfidential,
bool  mExcludePrivate 
)

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).

prints the all-day box for the agenda print view.

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 ", ".

Parameters
pQPainter of the printout
eventListThe list of all-day events that are supposed to be printed inside this box
qdThe date of the currently printed day
expandableIf true, height is the height of one single cell, the printout will use as many cells as events in the list and return the total height needed for all of them. If false, height specifies the total height allowed for all events, and the events are displayed in one cell, with their summaries concatenated by ", ".
boxcoordinates of the all day box.
excludeConfidentialWhether to exclude Incidence marked confidential.
excludePrivateWhether to exclude Incidence marked private.
Returns
The height used for the all-day box.

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 799 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawBox ( QPainter &  p,
int  linewidth,
const QRect &  rect 
)
static

Draw a box with given width at the given coordinates.

Parameters
pThe printer to be used
linewidthThe border width of the box
rectThe rectangle of the box

Definition at line 391 of file calprintpluginbase.cpp.

int CalPrintPluginBase::drawBoxWithCaption ( QPainter &  p,
const 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).

Parameters
pQPainter of the printout
boxCoordinates of the box
captionCaption string to be printed inside the box
contentsNormal text contents of the box. If contents.isNull(), then no text will be printed, only the caption.
sameLineWhether the contents should start on the same line as the caption (the space below the caption text will be used as indentation in the subsequent lines) or on the next line (no indentation of the contents)
expandWhether to expand the box vertically to fit the whole text in it.
rickContentsWhether contents contains rich text.
Returns
The bottom of the printed box. If expand==true, the bottom of the drawn box is returned, if expand==false, the vertical end of the printed contents inside the box is returned. If you want to print some custom graphics or text below the contents, use the return value as the top-value of your custom contents in that case.

Definition at line 470 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawDayBox ( QPainter &  p,
const QDate &  qd,
const QTime &  fromTime,
const QTime &  toTime,
const QRect &  box,
bool  fullDate = false,
bool  printRecurDaily = true,
bool  printRecurWeekly = true,
bool  singleLineLimit = true,
bool  showNoteLines = false,
bool  includeDescription = false,
bool  excludeDescription = true,
bool  excludePrivate = true 
)

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.

Parameters
pQPainter of the printout
qdThe date of the currently printed day. All events of the calendar that appear on that day will be printed.
fromTimeStart time of the time range to display
toTimeEnd time of the time range to display
boxcoordinates of the day box.
fullDateWhether the title bar of the box should contain the full date string or just a short.
printRecurDailyWhether daily recurring incidences should be printed.
printRecurWeeklyWhether weekly recurring incidences should be printed.
singleLineLimitWhether Incidence text wraps or truncates.
showNoteLinesWhether note lines are printed.
includeDescriptionWhether to print the event description as well.
excludeConfidentialWhether to exclude Incidence marked confidential.
excludePrivateWhether to exclude Incidence marked private.

Definition at line 1054 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawDays ( QPainter &  p,
const QDate &  start,
const QDate &  end,
const QTime &  fromTime,
const QTime &  toTime,
const QRect &  box,
bool  singleLineLimit,
bool  showNoteLines,
bool  includeDescription,
bool  excludeConfidential,
bool  excludePrivate 
)

Draw the (filofax) table for a bunch of days, using drawDayBox.

Parameters
pQPainter of the printout
startStart date
endEnd date
fromTimeStart time of the displayed time range
toTimeEnd time of the displayed time range
boxcoordinates of the week box.
singleLineLimitWhether Incidence text wraps or truncates.
showNoteLinesWhether note lines are printed.
includeDescriptionWhether to print the event description as well.
excludeConfidentialWhether to exclude Incidence marked confidential.
excludePrivateWhether to exclude Incidence marked private.

Definition at line 1387 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawDaysOfWeek ( QPainter &  p,
const QDate &  fromDate,
const QDate &  toDate,
const QRect &  box 
)

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.

Parameters
pQPainter of the printout
fromDateFirst date of the printed dates
toDateLast date of the printed dates
boxcoordinates of the box for the days of the week

Definition at line 703 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawDaysOfWeekBox ( QPainter &  p,
const QDate &  qd,
const QRect &  box 
)

Draw a single weekday name in a box inside the given area of the painter.

This is called in a loop by drawDaysOfWeek.

Parameters
pQPainter of the printout
qdDate of the printed day
boxcoordinates of the weekbox

Definition at line 721 of file calprintpluginbase.cpp.

int CalPrintPluginBase::drawFooter ( QPainter &  p,
const QRect &  box 
)

Draw a page footer containing the printing date and possibly other things, like a page number.

Parameters
pQPainter of the printout
boxcoordinates of the footer
Returns
The bottom of the printed box.

Definition at line 628 of file calprintpluginbase.cpp.

int CalPrintPluginBase::drawHeader ( QPainter &  p,
const QString &  title,
const QDate &  month1,
const QDate &  month2,
const QRect &  box,
bool  expand = false,
QColor  backColor = QColor() 
)

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.

Parameters
pQPainter of the printout
titleThe string printed as the title of the page (e.g. the date, date range or todo list title)
month1Date specifying the month for the left one of the small month views in the title bar. If left empty, only month2 will be printed (or none, it that is invalid as well).
month2Date specifying the month for the right one of the small month views in the title bar. If left empty, only month1 will be printed (or none, it that is invalid as well).
boxcoordinates of the title bar
expandWhether to expand the box vertically to fit the whole title in it.
backColorbackground color for the header box.
Returns
The bottom of the printed box. If expand==false, this is box.bottom, otherwise it is larger than box.bottom and matches the y-coordinate of the surrounding rectangle.

Definition at line 553 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawIncidence ( QPainter &  p,
const QRect &  dayBox,
const QString &  time,
const QString &  summary,
const QString &  description,
int &  textY,
bool  singleLineLimit,
bool  includeDescription,
bool  richDescription 
)
protected

Definition at line 1233 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawJournal ( const Journal::Ptr &  journal,
QPainter &  p,
int  x,
int &  y,
int  width,
int  pageHeight 
)

Draws single journal item.

Parameters
journalThe item to be printed.
pQPainter of the printout
xx-coordinate of the upper left coordinate of the first item
yy-coordinate of the upper left coordinate of the first item
widthwidth of the whole list
pageHeightTotal height allowed for the list on a page. If an item would be below that line, a new page is started.

Definition at line 2101 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawMonth ( QPainter &  p,
const QDate &  dt,
const QRect &  box,
int  maxdays = -1,
int  subDailyFlags = TimeBoxes,
int  holidaysFlags = Text 
)

Draw a vertical representation of the month containing the date dt.

Each day gets one line.

Parameters
pQPainter of the printout
dtArbitrary date within the month to be printed
boxcoordinates of the box reserved for the month
maxdaysDays to print. If a value of -1 is given, the number of days is deduced from the month. If maxdays is larger than the number of days in the month, the remaining boxes are shaded to indicate they are not days of the month.
subDailyFlagsBitfield consisting of DisplayFlags flags to determine how events that do not cross midnight should be printed.
holidaysFlagsBitfield consisting of DisplayFlags flags to determine how holidays should be printed.

Definition at line 1524 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawMonthTable ( QPainter &  p,
const QDate &  qd,
const QTime &  fromTime,
const QTime &  toTime,
bool  weeknumbers,
bool  recurDaily,
bool  recurWeekly,
bool  singleLineLimit,
bool  showNoteLines,
bool  includeDescription,
bool  excludeConfidential,
bool  excludePrivate,
const QRect &  box 
)

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).

Parameters
pQPainter of the printout
qdArbitrary date within the month to be printed.
fromTimeStart time of the displayed time range
toTimeEnd time of the displayed time range
weeknumbersWhether the week numbers are printed left of each row of the matrix
recurDailyWhether daily recurring incidences should be printed.
recurWeeklyWhether weekly recurring incidences should be printed.
singleLineLimitWhether Incidence text wraps or truncates.
showNoteLinesWhether note lines are printed.
includeDescriptionWhether descriptions are printed.
excludeConfidentialWhether to exclude Incidence marked confidential.
excludePrivateWhether to exclude Incidence marked private.
boxcoordinates of the month.

Definition at line 1738 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawNoteLines ( QPainter &  p,
const QRect &  box,
int  startY 
)

Draws dotted lines for notes in a box.

Parameters
pQPainter of the printout
boxcoordinates of the box where the lines will be placed
startYstarting y-coordinate for the first line

Definition at line 2198 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawShadedBox ( QPainter &  p,
int  linewidth,
const QBrush &  brush,
const QRect &  rect 
)
static

Draw a shaded box with given width at the given coordinates.

Parameters
pThe printer to be used
linewidthThe border width of the box
brushThe brush to fill the box
rectThe rectangle of the box

Definition at line 406 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawSmallMonth ( QPainter &  p,
const QDate &  qd,
const QRect &  box 
)

Draw a small calendar with the days of a month into the given area.

Used for example in the title bar of the sheet.

Parameters
pQPainter of the printout
qdArbitrary Date within the month to be printed.
boxcoordinates of the small calendar

Definition at line 642 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawSplitHeaderRight ( QPainter &  p,
const QDate &  fd,
const QDate &  td,
const QDate &  cd,
int  width,
int  height 
)

Definition at line 2144 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawSubHeaderBox ( QPainter &  p,
const QString &  str,
const QRect &  box 
)

Draw a subheader box with a shaded background and the given string.

Parameters
pQPainter of the printout
strText to be printed inside the box
boxCoordinates of the box

Definition at line 445 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawTextLines ( QPainter &  p,
const QString &  entry,
int  x,
int &  y,
int  width,
int  pageHeight,
bool  richTextEntry 
)

Draws text lines splitting on page boundaries.

Parameters
pQPainter of the printout
xx-coordinate of the upper left coordinate of the first item
yy-coordinate of the upper left coordinate of the first item
widthwidth of the whole list
pageHeightsize of the page. A new page is started when the text reaches the end of the page.

Definition at line 2073 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawTimeLine ( QPainter &  p,
const QTime &  fromTime,
const QTime &  toTime,
const QRect &  box 
)

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

Parameters
pQPainter of the printout
fromTimeStart time of the time range to display
toTimeEnd time of the time range to display
boxcoordinates of the timeline

Definition at line 726 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawTimeTable ( QPainter &  p,
const QDate &  fromDate,
const QDate &  toDate,
bool  expandable,
const QTime &  fromTime,
const QTime &  toTime,
const QRect &  box,
bool  includeDescription,
bool  excludeTime,
bool  excludeConfidential,
bool  excludePrivate 
)

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).

Parameters
pQPainter of the printout
fromDateFirst day to be included in the page
toDateLast day to be included in the page
expandableIf true, the start and end times are adjusted to include the whole range of all events of that day, not just of the given time range.
fromTimeStart time of the displayed time range
toTimeEnd time of the displayed time range
boxcoordinates of the time table.
includeDescriptionWhether to print the event description as well.
excludeTimeWhether the time is printed in the detail area.
excludeConfidentialWhether to exclude Incidence marked confidential.
excludePrivateWhether to exclude Incidence marked private.

Definition at line 1428 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawTodo ( int &  count,
const KCalCore::Todo::Ptr &  todo,
QPainter &  p,
KCalCore::TodoSortField  sortField,
KCalCore::SortDirection  sortDir,
bool  connectSubTodos,
bool  strikeoutCompleted,
bool  desc,
int  posPriority,
int  posSummary,
int  posDueDt,
int  posPercentComplete,
int  level,
int  x,
int &  y,
int  width,
int  pageHeight,
const KCalCore::Todo::List &  todoList,
TodoParentStart *  r,
bool  excludeConfidential,
bool  excludePrivate 
)

Draws single to-do and its (intented) sub-to-dos, optionally connects them by a tree-like line, and optionally shows due date, summary, description and priority.

Parameters
countThe number of the currently printed to-do (count will be incremented for each to-do drawn)
todoThe to-do to be printed. It's sub-to-dos are recursively drawn, so drawTodo should only be called on the to-dos of the highest level.
pQPainter of the printout
sortFieldSpecifies on which attribute of the todo you want to sort.
sortDirSpecifies if you want to sort ascending or descending.
connectSubTodosWhether sub-to-dos shall be connected with their parent by a line (tree-like).
strikeoutCompletedWhether completed to-dos should be printed with strike-out summaries.
descWhether to print the whole description of the to-do (the summary is always printed).
posPriorityx-coordinate where the priority is supposed to be printed. If <0, no priority will be printed.
posSummaryx-coordinate where the summary of the to-do is supposed to be printed.
posDueDtx-coordinate where the due date is supposed to the be printed. If <0, no due date will be printed.
posPercentCompletex-coordinate where the percentage complete is supposed to be printed. If <0, percentage complete will not be printed.
levelLevel of the current to-do in the to-do hierarchy (0 means highest level of printed to-dos, 1 are their sub-to-dos, etc.)
xx-coordinate of the upper left coordinate of the first to-do.
yy-coordinate of the upper left coordinate of the first to-do.
widthwidth of the whole to-do list.
pageHeightTotal height allowed for the to-do list on a page. If an to-do would be below that line, a new page is started.
todoListContains a list of sub-todos for the specified todo .
rInternal (used when printing sub-to-dos to give information about its parent)

Definition at line 1865 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawTodoLines ( QPainter &  p,
const QString &  entry,
int  x,
int &  y,
int  width,
int  pageHeight,
bool  richTextEntry,
QList< TodoParentStart * > &  startPoints,
bool  connectSubTodos 
)
protected

Definition at line 1817 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawVerticalBox ( QPainter &  p,
int  linewidth,
const QRect &  box,
const QString &  str,
int  flags = -1 
)

Draw an event box with vertical text.

Parameters
pQPainter of the printout
linewidthis the width of the line used to draw the box, ignored if less than 1.
boxCoordinates of the box
strext to be printed inside the box
flagsis a bitwise OR of Qt::AlignmentFlags and Qt::TextFlags values.

Definition at line 454 of file calprintpluginbase.cpp.

void CalPrintPluginBase::drawWeek ( QPainter &  p,
const QDate &  qd,
const QTime &  fromTime,
const QTime &  toTime,
const QRect &  box,
bool  singleLineLimit,
bool  showNoteLines,
bool  includeDescription,
bool  excludeConfidential,
bool  excludePrivate 
)

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.

Parameters
pQPainter of the printout
qdArbitrary date within the week to be printed.
fromTimeStart time of the displayed time range
toTimeEnd time of the displayed time range
boxcoordinates of the week box.
singleLineLimitWhether Incidence text wraps or truncates.
showNoteLinesWhether note lines are printed.
includeDescriptionWhether to print the event description as well.
excludeConfidentialWhether to exclude Incidence marked confidential.
excludePrivateWhether to exclude Incidence marked private.

Definition at line 1348 of file calprintpluginbase.cpp.

int CalPrintPluginBase::footerHeight ( ) const

Returns the height of the page footer.

If the height was explicitly set using setFooterHeight, that value is returned, otherwise a default value based on the printer orientation.

Returns
height of the page footer of the printout

Definition at line 341 of file calprintpluginbase.cpp.

int CalPrintPluginBase::headerHeight ( ) const

Returns the height of the page header.

If the height was explicitly set using setHeaderHeight, that value is returned, otherwise a default value based on the printer orientation.

Returns
height of the page header of the printout

Definition at line 315 of file calprintpluginbase.cpp.

Event::Ptr CalPrintPluginBase::holiday ( const QDate &  dt)

Definition at line 287 of file calprintpluginbase.cpp.

QString CalPrintPluginBase::holidayString ( const QDate &  dt)

Definition at line 282 of file calprintpluginbase.cpp.

virtual void CalPrintPluginBase::loadConfig ( )
pure virtual

Load print format configuration from config file.

Implemented in CalPrintTodos, CalPrintMonth, CalPrintWeek, CalPrintDay, CalPrintIncidence, CalPrintWhatsNext, CalPrintItemList, CalPrintJournal, and CalPrintYear.

int CalPrintPluginBase::margin ( ) const

Definition at line 361 of file calprintpluginbase.cpp.

QPrinter::Orientation CalPrintPluginBase::orientation ( ) const

Definition at line 241 of file calprintpluginbase.cpp.

int CalPrintPluginBase::padding ( ) const

Definition at line 371 of file calprintpluginbase.cpp.

virtual void CalPrintPluginBase::print ( QPainter &  p,
int  width,
int  height 
)
pure virtual

Actually do the printing.

Parameters
pQPainter the print result is painted to
widthWidth of printable area
heightHeight of printable area

Implemented in CalPrintTodos, CalPrintMonth, CalPrintWeek, CalPrintDay, CalPrintIncidence, CalPrintWhatsNext, CalPrintItemList, CalPrintJournal, and CalPrintYear.

void CalPrintPluginBase::printEventString ( QPainter &  p,
const QRect &  box,
const QString &  str,
int  flags = -1 
)

Print the given string (event summary) in the given rectangle.

Margins and justification (centered or not) are automatically adjusted.

Parameters
pQPainter of the printout
boxCoordinates of the surrounding event box
strThe text to be printed in the box

Definition at line 415 of file calprintpluginbase.cpp.

bool CalPrintPluginBase::printFooter ( ) const

Definition at line 231 of file calprintpluginbase.cpp.

virtual void CalPrintPluginBase::saveConfig ( )
pure virtual

Write print format configuration to config file.

Implemented in CalPrintTodos, CalPrintMonth, CalPrintWeek, CalPrintDay, CalPrintIncidence, CalPrintWhatsNext, CalPrintItemList, CalPrintJournal, and CalPrintYear.

void CalPrintPluginBase::setBorderWidth ( const int  border)

Definition at line 386 of file calprintpluginbase.cpp.

void CalPrintPluginBase::setCalendarSystem ( const KCalendarSystem *  calsys)

Definition at line 310 of file calprintpluginbase.cpp.

void CalPrintPluginBase::setCategoryColors ( QPainter &  p,
const Incidence::Ptr &  incidence 
)

Definition at line 255 of file calprintpluginbase.cpp.

void CalPrintPluginBase::setFooterHeight ( const int  height)

Definition at line 356 of file calprintpluginbase.cpp.

void CalPrintPluginBase::setHeaderHeight ( const int  height)

Definition at line 326 of file calprintpluginbase.cpp.

void CalPrintPluginBase::setKOrgCoreHelper ( KOrg::CoreHelper *  helper)
virtual

HELPER FUNCTIONS.

Reimplemented from KOrg::PrintPlugin.

Definition at line 213 of file calprintpluginbase.cpp.

void CalPrintPluginBase::setMargin ( const int  margin)

Definition at line 366 of file calprintpluginbase.cpp.

void CalPrintPluginBase::setPadding ( const int  margin)

Definition at line 376 of file calprintpluginbase.cpp.

void CalPrintPluginBase::setPrintFooter ( bool  printFooter)

Definition at line 236 of file calprintpluginbase.cpp.

void CalPrintPluginBase::setSubHeaderHeight ( const int  height)

Definition at line 336 of file calprintpluginbase.cpp.

void CalPrintPluginBase::setUseColors ( bool  useColors)

Definition at line 226 of file calprintpluginbase.cpp.

void CalPrintPluginBase::showEventBox ( QPainter &  p,
int  linewidth,
const QRect &  box,
const Incidence::Ptr &  incidence,
const QString &  str,
int  flags = -1 
)

Print the box for the given event with the given string.

Parameters
pQPainter of the printout
linewidthis the width of the line used to draw the box, ignored if less than 1.
boxCoordinates of the event's box
incidenceThe incidence (if available), from which the category color will be deduced, if applicable.
strThe string to print inside the box
flagsis a bitwise OR of Qt::AlignmentFlags and Qt::TextFlags values.

Definition at line 424 of file calprintpluginbase.cpp.

int CalPrintPluginBase::subHeaderHeight ( ) const

Definition at line 331 of file calprintpluginbase.cpp.

QString CalPrintPluginBase::toPlainText ( const QString &  htmlText)
protected

Definition at line 2217 of file calprintpluginbase.cpp.

bool CalPrintPluginBase::useColors ( ) const

Definition at line 221 of file calprintpluginbase.cpp.

int CalPrintPluginBase::weekdayColumn ( int  weekday)
static

Determines the column of the given weekday ( 1=Monday, 7=Sunday ), taking the start of the week setting into account as given in kcontrol.

Parameters
weekdayIndex of the weekday

Definition at line 2067 of file calprintpluginbase.cpp.

Member Data Documentation

int CalPrintPluginBase::mBorder
protected

Definition at line 657 of file calprintpluginbase.h.

const KCalendarSystem* CalPrintPluginBase::mCalSys
protected

Definition at line 658 of file calprintpluginbase.h.

bool CalPrintPluginBase::mExcludeConfidential
protected

Definition at line 650 of file calprintpluginbase.h.

bool CalPrintPluginBase::mExcludePrivate
protected

Definition at line 651 of file calprintpluginbase.h.

int CalPrintPluginBase::mFooterHeight
protected

Definition at line 654 of file calprintpluginbase.h.

int CalPrintPluginBase::mHeaderHeight
protected

Definition at line 652 of file calprintpluginbase.h.

int CalPrintPluginBase::mMargin
protected

Definition at line 655 of file calprintpluginbase.h.

int CalPrintPluginBase::mPadding
protected

Definition at line 656 of file calprintpluginbase.h.

bool CalPrintPluginBase::mPrintFooter
protected

Definition at line 648 of file calprintpluginbase.h.

bool CalPrintPluginBase::mShowNoteLines
protected

Definition at line 649 of file calprintpluginbase.h.

int CalPrintPluginBase::mSubHeaderHeight
protected

Definition at line 653 of file calprintpluginbase.h.

bool CalPrintPluginBase::mUseColors
protected

Definition at line 647 of file calprintpluginbase.h.


The documentation for this class was generated from the following files:
  • calprintpluginbase.h
  • calprintpluginbase.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

korganizer

Skip menu "korganizer"
  • Main Page
  • Namespace List
  • Namespace Members
  • 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

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