00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KCAL_HTMLEXPORT_H
00023 #define KCAL_HTMLEXPORT_H
00024
00025 #include <tqstring.h>
00026 #include <tqdatetime.h>
00027 #include <tqmap.h>
00028
00029 #include <libkcal/calendar.h>
00030 #include <libkcal/htmlexportsettings.h>
00031
00032 #include "libkcal_export.h"
00033
00034 class TQFile;
00035 class TQTextStream;
00036
00037 namespace KCal {
00038
00042 class KDE_EXPORT HtmlExport
00043 {
00044 public:
00048 HtmlExport( Calendar *calendar, HTMLExportSettings *settings );
00049 virtual ~HtmlExport() {}
00050
00054 bool save( const TQString &fileName = TQString() );
00055
00059 bool save( TQTextStream * );
00060
00061 void addHoliday( const TQDate &date, const TQString &name );
00062
00063 protected:
00064 void createWeekView( TQTextStream *ts );
00065 void createMonthView( TQTextStream *ts );
00066 void createEventList( TQTextStream *ts );
00067 void createTodoList( TQTextStream *ts );
00068 void createJournalView( TQTextStream *ts );
00069 void createFreeBusyView( TQTextStream *ts );
00070
00071 void createTodo( TQTextStream *ts, Todo *todo);
00072 void createEvent( TQTextStream *ts, Event *event, TQDate date,
00073 bool withDescription = true);
00074 void createFooter( TQTextStream *ts );
00075
00076 bool checkSecrecy( Incidence * );
00077
00078 void formatLocation( TQTextStream *ts, Incidence *event );
00079 void formatCategories( TQTextStream *ts, Incidence *event );
00080 void formatAttendees( TQTextStream *ts, Incidence *event );
00081
00082 TQString breakString( const TQString &text );
00083
00084 TQDate fromDate() const;
00085 TQDate toDate() const;
00086 TQString styleSheet() const;
00087
00088 private:
00089 TQString cleanChars( const TQString &txt );
00090
00091 Calendar *mCalendar;
00092 HTMLExportSettings *mSettings;
00093 TQMap<TQDate,TQString> mHolidayMap;
00094
00095 class Private;
00096 Private *d;
00097 };
00098
00099 }
00100
00101 #endif