25 #ifndef CALPRINTPLUGINBASE_H
26 #define CALPRINTPLUGINBASE_H
29 #ifndef KORG_NOPRINTER
31 #include <tqdatetime.h>
33 #include <tdemacros.h>
35 #include <libkcal/event.h>
36 #include <libkcal/todo.h>
37 #include "korganizer/printplugin.h"
38 #include "korganizer/corehelper.h"
48 #define PORTRAIT_HEADER_HEIGHT 72
49 #define LANDSCAPE_HEADER_HEIGHT 54
50 #define SUBHEADER_HEIGHT 20
51 #define PORTRAIT_FOOTER_HEIGHT 16
52 #define LANDSCAPE_FOOTER_HEIGHT 14
53 #define MARGIN_SIZE 36
54 #define PADDING_SIZE 7
55 #define BOX_BORDER_WIDTH 2
56 #define EVENT_BORDER_WIDTH 0
58 #define TIMELINE_WIDTH 50
82 virtual TQWidget *createConfigWidget( TQWidget * );
91 virtual void print( TQPainter &p, int width, int height ) = 0;
95 virtual void doPrint( KPrinter *printer );
117 void setKOrgCoreHelper( KOrg::CoreHelper*helper );
118 bool useColors() const;
119 void setUseColors( bool useColors );
122 TQColor categoryBgColor( Incidence *incidence );
123 TQColor textColor( const TQColor &color );
125 bool isWorkingDay( const TQDate &dt );
126 TQString holidayString( const TQDate &dt );
127 Event *holiday( const TQDate &dt );
134 static int weekdayColumn( int weekday );
135 void setCategoryColors( TQPainter &p, Incidence *incidence );
137 KPrinter::Orientation orientation() const;
144 int headerHeight() const;
145 void setHeaderHeight( const int height );
147 int subHeaderHeight() const;
148 void setSubHeaderHeight( const int height );
155 int footerHeight() const;
156 void setFooterHeight( const int height );
159 void setMargin( const int margin );
162 void setPadding( const int margin );
164 int borderWidth() const;
165 void setBorderWidth( const int border );
167 const KCalendarSystem *calendarSystem() const;
168 void setCalendarSystem( const KCalendarSystem *calsys );
181 static void drawBox( TQPainter &p, int linewidth, const TQRect &rect );
189 static void drawShadedBox( TQPainter &p, int linewidth, const TQBrush &brush, const TQRect &rect );
199 void printEventString( TQPainter &p, const TQRect &box, const TQString &str, int flags = -1 );
211 void showEventBox( TQPainter &p, int linewidth, const TQRect &box, Incidence *incidence,
212 const TQString &str, int flags = -1 );
220 void drawSubHeaderBox(TQPainter &p, const TQString &str, const TQRect &box );
230 void drawVerticalBox( TQPainter &p, int linewidth, const TQRect &box, const TQString &str,
253 int drawBoxWithCaption( TQPainter &p, const TQRect &box, const TQString &caption,
254 const TQString &contents,
255 bool sameLine, bool expand, const TQFont &captionFont, const TQFont &textFont );
284 int drawHeader( TQPainter &p, TQString title,
285 const TQDate &month1, const TQDate &month2,
286 const TQRect &box, bool expand = false );
295 int drawFooter( TQPainter &p, TQRect &box );
304 void drawSmallMonth( TQPainter &p, const TQDate &qd, const TQRect &box );
315 void drawDaysOfWeek( TQPainter &p,
316 const TQDate &fromDate, const TQDate &toDate,
325 void drawDaysOfWeekBox( TQPainter &p, const TQDate &qd, const TQRect &box );
336 void drawTimeLine( TQPainter &p,
337 const TQTime &fromTime, const TQTime &toTime,
358 int drawAllDayBox( TQPainter &p, Event::List &eventList,
359 const TQDate &qd, bool expandable,
380 void drawAgendaDayBox( TQPainter &p, Event::List &eventList,
381 const TQDate &qd, bool expandable,
382 TQTime &fromTime, TQTime &toTime,
385 void drawAgendaItem( PrintCellItem *item, TQPainter &p,
386 const TQDateTime &startPrintDate,
387 const TQDateTime &endPrintDate,
388 float minlen, const TQRect &box );
402 void drawDayBox( TQPainter &p, const TQDate &qd,
404 bool fullDate = false, bool printRecurDaily = true,
405 bool printRecurWeekly = true );
415 void drawWeek( TQPainter &p, const TQDate &qd,
432 void drawTimeTable( TQPainter &p, const TQDate &fromDate, const TQDate &toDate,
433 TQTime &fromTime, TQTime &toTime,
449 void drawMonthTable( TQPainter &p, const TQDate &qd, bool weeknumbers,
450 bool recurDaily, bool recurWeekly,
467 void drawMonth( TQPainter &p, const TQDate &dt, const TQRect &box, int maxdays = -1, int subDailyFlags = TimeBoxes, int holidaysFlags = Text );
472 class TodoParentStart;
496 void drawTodo( int &count, Todo *todo, TQPainter &p,
498 bool connectSubTodos, bool strikeoutCompleted, bool desc,
499 int posPriority, int posSummary, int posDueDt,
500 int posPercentComplete, int level, int x, int &y,
501 int width, int pageHeight,
502 const Todo::List &todoList, TodoParentStart *r = 0 );
514 void drawJournal( Journal * journal, TQPainter &p, int x, int &y,
515 int width, int pageHeight );
516 void drawJournalField( TQPainter &p, TQString field, TQString text,
517 int x, int &y, int width, int pageHeight );
519 void drawSplitHeaderRight( TQPainter &p, const TQDate &fd, const TQDate &td,
520 const TQDate &cd, int width, int height );
524 void drawIncidence( TQPainter &p, const TQRect &dayBox, const TQString &time,
525 const TQString &summary, int &textY );
530 int mSubHeaderHeight;
535 const KCalendarSystem *mCalSys;
Base class for KOrganizer printing classes.
virtual void loadConfig()=0 Load print format configuration from config file.
virtual void print(TQPainter &p, int width, int height)=0 Actually do the printing.
virtual void saveConfig()=0 Write print format configuration to config file.
Base class for KOrganizer printing classes.
|