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()
00046     {
00047       return i18n( "Print &incidence" );
00048     }
00049     virtual QString info()
00050     {
00051       return i18n( "Prints an incidence on one page" );
00052     }
00053     virtual int sortID()
00054     {
00055       return CalPrinterBase::Incidence;
00056     }
00057 
00058   // Enable the Print Incidence option only if there are selected incidences.
00059     virtual bool enabled()
00060       {
00061         if ( mSelectedIncidences.count() > 0 ) {
00062           return true;
00063         } else {
00064           return false;
00065         }
00066       }
00067     virtual QWidget *createConfigWidget( QWidget * );
00068     virtual KPrinter::Orientation defaultOrientation()
00069     {
00070       return KPrinter::Portrait;
00071     }
00072 
00073   public:
00074     void print( QPainter &p, int width, int height );
00075     virtual void readSettingsWidget();
00076     virtual void setSettingsWidget();
00077     virtual void loadConfig();
00078     virtual void saveConfig();
00079   protected:
00080     int printCaptionAndText( QPainter &p, const QRect &box, const QString &caption,
00081                              const QString &text, QFont captionFont, QFont textFont );
00082 
00083 
00084   protected:
00085     bool mShowOptions;
00086     bool mShowSubitemsNotes;
00087     bool mShowAttendees;
00088     bool mShowAttachments;
00089 };
00090 
00091 
00092 class CalPrintDay : public CalPrintPluginBase
00093 {
00094   public:
00095     CalPrintDay();
00096     virtual ~CalPrintDay();
00097     virtual QString description()
00098     {
00099       return i18n( "Print da&y" );
00100     }
00101     virtual QString info()
00102     {
00103       return i18n( "Prints all events of a single day on one page" );
00104     }
00105     virtual int sortID()
00106     {
00107       return CalPrinterBase::Day;
00108     }
00109     virtual bool enabled()
00110     {
00111       return true;
00112     }
00113     virtual QWidget *createConfigWidget( QWidget* );
00114 
00115   public:
00116     void print(QPainter &p, int width, int height);
00117     virtual void readSettingsWidget();
00118     virtual void setSettingsWidget();
00119     virtual void loadConfig();
00120     virtual void saveConfig();
00121     virtual void setDateRange( const QDate& from, const QDate& to );
00122 
00123   protected:
00124     QTime mStartTime, mEndTime;
00125     bool mIncludeTodos;
00126     bool mIncludeAllEvents;
00127 };
00128 
00129 class CalPrintWeek : public CalPrintPluginBase
00130 {
00131   public:
00132     CalPrintWeek();
00133     virtual ~CalPrintWeek();
00134     virtual QString description()
00135     {
00136       return i18n( "Print &week" );
00137     }
00138     virtual QString info()
00139     {
00140       return i18n( "Prints all events of one week on one page" );
00141     }
00142     virtual int sortID()
00143     {
00144       return CalPrinterBase::Week;
00145     }
00146     virtual bool enabled()
00147     {
00148       return true;
00149     }
00150     virtual QWidget *createConfigWidget( QWidget * );
00151 
00155     virtual KPrinter::Orientation defaultOrientation();
00156 
00157   public:
00158     void print(QPainter &p, int width, int height);
00159     virtual void readSettingsWidget();
00160     virtual void setSettingsWidget();
00161     virtual void loadConfig();
00162     virtual void saveConfig();
00163     virtual void setDateRange( const QDate& from, const QDate& to );
00164 
00165   protected:
00166     enum eWeekPrintType { Filofax=0, Timetable, SplitWeek } mWeekPrintType;
00167     QTime mStartTime, mEndTime;
00168     bool mSingleLineLimit;
00169     bool mIncludeTodos;
00170 };
00171 
00172 class CalPrintMonth : public CalPrintPluginBase
00173 {
00174   public:
00175     CalPrintMonth();
00176     virtual ~CalPrintMonth();
00177     virtual QString description()
00178     {
00179       return i18n( "Print mont&h" );
00180     }
00181     virtual QString info()
00182     {
00183       return i18n( "Prints all events of one month on one page" );
00184     }
00185     virtual int sortID()
00186     {
00187       return CalPrinterBase::Month;
00188     }
00189     virtual bool enabled()
00190     {
00191       return true;
00192     }
00193     virtual QWidget *createConfigWidget( QWidget * );
00194     virtual KPrinter::Orientation defaultOrientation()
00195     {
00196       return KPrinter::Landscape;
00197     }
00198 
00199 
00200   public:
00201     void print(QPainter &p, int width, int height);
00202     virtual void readSettingsWidget();
00203     virtual void setSettingsWidget();
00204     virtual void loadConfig();
00205     virtual void saveConfig();
00206     virtual void setDateRange( const QDate& from, const QDate& to );
00207 
00208   protected:
00209     bool mWeekNumbers;
00210     bool mRecurDaily;
00211     bool mRecurWeekly;
00212     bool mIncludeTodos;
00213     bool mSingleLineLimit;
00214 };
00215 
00216 class CalPrintTodos : public CalPrintPluginBase
00217 {
00218   public:
00219     CalPrintTodos();
00220     virtual ~CalPrintTodos();
00221     virtual QString description()
00222     {
00223       return i18n( "Print to-&dos" );
00224     }
00225     virtual QString info()
00226     {
00227       return i18n( "Prints all to-dos in a (tree-like) list" );
00228     }
00229     virtual int sortID()
00230     {
00231       return CalPrinterBase::Todolist;
00232     }
00233     virtual bool enabled()
00234     {
00235       return true;
00236     }
00237     virtual QWidget *createConfigWidget( QWidget * );
00238 
00239   public:
00240     void print( QPainter &p, int width, int height );
00241     virtual void readSettingsWidget();
00242     virtual void setSettingsWidget();
00243     virtual void loadConfig();
00244     virtual void saveConfig();
00245 
00246   protected:
00247     QString mPageTitle;
00248 
00249     enum eTodoPrintType {
00250       TodosAll = 0,
00251       TodosUnfinished,
00252       TodosDueRange
00253     } mTodoPrintType;
00254 
00255     enum eTodoSortField {
00256       TodoFieldSummary = 0,
00257       TodoFieldStartDate,
00258       TodoFieldDueDate,
00259       TodoFieldPriority,
00260       TodoFieldPercentComplete,
00261       TodoFieldUnset
00262     } mTodoSortField;
00263 
00264     enum eTodoSortDirection {
00265       TodoDirectionAscending = 0,
00266       TodoDirectionDescending,
00267       TodoDirectionUnset
00268     } mTodoSortDirection;
00269 
00270     bool mIncludeDescription;
00271     bool mIncludePriority;
00272     bool mIncludeDueDate;
00273     bool mIncludePercentComplete;
00274     bool mConnectSubTodos;
00275     bool mStrikeOutCompleted;
00276     bool mSortField;
00277     bool mSortDirection;
00278 };
00279 
00280 
00281 #endif
00282 
00283 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys