korganizer

calprintdefaultplugins.h

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 1998 Preston Brown <pbrown@kde.org>
00005     Copyright (c) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
00006 
00007     This program is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020 
00021     As a special exception, permission is given to link this program
00022     with any edition of Qt, and distribute the resulting executable,
00023     without including the source code for Qt in the source distribution.
00024 */
00025 #ifndef CALPRINTDEFAULTPLUGINS_H
00026 #define CALPRINTDEFAULTPLUGINS_H
00027 
00028 
00029 #include <klocale.h>
00030 #include "calprintpluginbase.h"
00031 
00032 #ifndef KORG_NOPRINTER
00033 namespace KCal {
00034 class Calendar;
00035 }
00036 
00037 using namespace KCal;
00038 using namespace KOrg;
00039 
00040 class CalPrintIncidence : public CalPrintPluginBase
00041 {
00042   public:
00043     CalPrintIncidence();
00044     virtual ~CalPrintIncidence();
00045     virtual QString description() { return i18n("Print &incidence"); }
00046     virtual QString info() { return i18n("Prints an incidence on one page"); }
00047     virtual int sortID() { return CalPrinterBase::Incidence; }
00048     // Enable the Print Incidence option only if there are selected incidences.
00049     virtual bool enabled()
00050       {
00051         if ( mSelectedIncidences.count() > 0 ) {
00052           return true;
00053         } else {
00054           return false;
00055         }
00056       }
00057     virtual QWidget *createConfigWidget(QWidget*);
00058     virtual KPrinter::Orientation defaultOrientation()
00059       { return KPrinter::Portrait; }
00060 
00061   public:
00062     void print( QPainter &p, int width, int height );
00063     virtual void readSettingsWidget();
00064     virtual void setSettingsWidget();
00065     virtual void loadConfig();
00066     virtual void saveConfig();
00067   protected:
00068     int printCaptionAndText( QPainter &p, const QRect &box, const QString &caption, 
00069            const QString &text, QFont captionFont, QFont textFont );
00070   
00071 
00072   protected:
00073     bool mShowOptions;
00074     bool mShowSubitemsNotes;
00075     bool mShowAttendees;
00076     bool mShowAttachments;
00077 };
00078 
00079 
00080 class CalPrintDay : public CalPrintPluginBase
00081 {
00082   public:
00083     CalPrintDay();
00084     virtual ~CalPrintDay();
00085     virtual QString description() { return i18n("Print da&y"); }
00086     virtual QString info() { return i18n("Prints all events of a single day on one page"); }
00087     virtual int sortID() { return CalPrinterBase::Day; }
00088     virtual bool enabled() { return true; }
00089     virtual QWidget *createConfigWidget( QWidget* );
00090 
00091   public:
00092     void print(QPainter &p, int width, int height);
00093     virtual void readSettingsWidget();
00094     virtual void setSettingsWidget();
00095     virtual void loadConfig();
00096     virtual void saveConfig();
00097     virtual void setDateRange( const QDate& from, const QDate& to );
00098 
00099   protected:
00100     QTime mStartTime, mEndTime;
00101     bool mIncludeTodos;
00102     bool mIncludeAllEvents;
00103 };
00104 
00105 class CalPrintWeek : public CalPrintPluginBase
00106 {
00107   public:
00108     CalPrintWeek();
00109     virtual ~CalPrintWeek();
00110     virtual QString description() { return i18n("Print &week"); }
00111     virtual QString info() { return i18n("Prints all events of one week on one page"); }
00112     virtual int sortID() { return CalPrinterBase::Week; }
00113     virtual bool enabled() { return true; }
00114     virtual QWidget *createConfigWidget(QWidget*);
00118     virtual KPrinter::Orientation defaultOrientation();
00119 
00120   public:
00121     void print(QPainter &p, int width, int height);
00122     virtual void readSettingsWidget();
00123     virtual void setSettingsWidget();
00124     virtual void loadConfig();
00125     virtual void saveConfig();
00126     virtual void setDateRange( const QDate& from, const QDate& to );
00127 
00128   protected:
00129     enum eWeekPrintType { Filofax=0, Timetable, SplitWeek } mWeekPrintType;
00130     QTime mStartTime, mEndTime;
00131     bool mIncludeTodos;
00132 };
00133 
00134 class CalPrintMonth : public CalPrintPluginBase
00135 {
00136   public:
00137     CalPrintMonth();
00138     virtual ~CalPrintMonth();
00139     virtual QString description() { return i18n("Print mont&h"); }
00140     virtual QString info() { return i18n("Prints all events of one month on one page"); }
00141     virtual int sortID() { return CalPrinterBase::Month; }
00142     virtual bool enabled() { return true; }
00143     virtual QWidget *createConfigWidget(QWidget*);
00144     virtual KPrinter::Orientation defaultOrientation() { return KPrinter::Landscape; }
00145 
00146   public:
00147     void print(QPainter &p, int width, int height);
00148     virtual void readSettingsWidget();
00149     virtual void setSettingsWidget();
00150     virtual void loadConfig();
00151     virtual void saveConfig();
00152     virtual void setDateRange( const QDate& from, const QDate& to );
00153 
00154   protected:
00155     bool mWeekNumbers;
00156     bool mRecurDaily;
00157     bool mRecurWeekly;
00158     bool mIncludeTodos;
00159 };
00160 
00161 class CalPrintTodos : public CalPrintPluginBase
00162 {
00163   public:
00164     CalPrintTodos();
00165     virtual ~CalPrintTodos();
00166     virtual QString description() { return i18n("Print to-&dos"); }
00167     virtual QString info() { return i18n("Prints all to-dos in a (tree-like) list"); }
00168     virtual int sortID() { return CalPrinterBase::Todolist; }
00169     virtual bool enabled() { return true; }
00170     virtual QWidget *createConfigWidget(QWidget*);
00171 
00172   public:
00173     void print( QPainter &p, int width, int height );
00174     virtual void readSettingsWidget();
00175     virtual void setSettingsWidget();
00176     virtual void loadConfig();
00177     virtual void saveConfig();
00178 
00179   protected:
00180     QString mPageTitle;
00181 
00182     enum eTodoPrintType {
00183       TodosAll = 0, TodosUnfinished, TodosDueRange
00184     } mTodoPrintType;
00185 
00186     enum eTodoSortField {
00187       TodoFieldSummary=0,
00188       TodoFieldStartDate, TodoFieldDueDate,
00189       TodoFieldPriority, TodoFieldPercentComplete,
00190       TodoFieldUnset
00191     } mTodoSortField;
00192 
00193     enum eTodoSortDirection {
00194       TodoDirectionAscending=0, TodoDirectionDescending,
00195       TodoDirectionUnset
00196     } mTodoSortDirection;
00197 
00198     bool mIncludeDescription;
00199     bool mIncludePriority;
00200     bool mIncludeDueDate;
00201     bool mIncludePercentComplete;
00202     bool mConnectSubTodos;
00203     bool mStrikeOutCompleted;
00204     bool mSortField;
00205     bool mSortDirection;
00206 };
00207 
00208 #endif
00209 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys