00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KCALUTILS_HTMLEXPORT_H
00023 #define KCALUTILS_HTMLEXPORT_H
00024
00025 #include "kcalutils_export.h"
00026
00027 #include <kcalcore/event.h>
00028 #include <kcalcore/incidence.h>
00029 #include <kcalcore/todo.h>
00030
00031 #include <QtCore/QDateTime>
00032 #include <QtCore/QString>
00033
00034 namespace KCalCore {
00035 class MemoryCalendar;
00036 }
00037
00038 class QTextStream;
00039
00040 namespace KCalUtils {
00041
00042 class HTMLExportSettings;
00043
00047 class KCALUTILS_EXPORT HtmlExport
00048 {
00049 public:
00053 HtmlExport( KCalCore::MemoryCalendar *calendar, HTMLExportSettings *settings );
00054 virtual ~HtmlExport();
00055
00059 bool save( const QString &fileName = QString() );
00060
00064 bool save( QTextStream *ts );
00065
00066 void addHoliday( const QDate &date, const QString &name );
00067
00068 protected:
00069 void createWeekView( QTextStream *ts );
00070 void createMonthView( QTextStream *ts );
00071 void createEventList( QTextStream *ts );
00072 void createTodoList( QTextStream *ts );
00073 void createJournalView( QTextStream *ts );
00074 void createFreeBusyView( QTextStream *ts );
00075
00076 void createTodo( QTextStream *ts, const KCalCore::Todo::Ptr &todo );
00077
00078 void createEvent( QTextStream *ts, const KCalCore::Event::Ptr &event,
00079 const QDate &date, bool withDescription = true );
00080
00081 void createFooter( QTextStream *ts );
00082
00083 bool checkSecrecy( const KCalCore::Incidence::Ptr &incidence );
00084
00085 void formatLocation( QTextStream *ts, const KCalCore::Incidence::Ptr &incidence );
00086
00087 void formatCategories( QTextStream *ts, const KCalCore::Incidence::Ptr &incidence );
00088
00089 void formatAttendees( QTextStream *ts, const KCalCore::Incidence::Ptr &incidence );
00090
00091 QString breakString( const QString &text );
00092
00093 QDate fromDate() const;
00094 QDate toDate() const;
00095 QString styleSheet() const;
00096
00097 private:
00098
00099 Q_DISABLE_COPY( HtmlExport )
00100 class Private;
00101 Private *const d;
00102
00103 };
00104
00105 }
00106
00107 #endif