htmlexport.h
00001 /* 00002 This file is part of libkcal. 00003 00004 Copyright (c) 2000-2003 Cornelius Schumacher <schumacher@kde.org> 00005 Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com> 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Library General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 This library 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 GNU 00015 Library General Public License for more details. 00016 00017 You should have received a copy of the GNU Library General Public License 00018 along with this library; see the file COPYING.LIB. If not, write to 00019 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 Boston, MA 02110-1301, USA. 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