libkcal

htmlexport.h
1 /*
2  This file is part of libkcal.
3 
4  Copyright (c) 2000-2003 Cornelius Schumacher <schumacher@kde.org>
5  Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 #ifndef KCAL_HTMLEXPORT_H
23 #define KCAL_HTMLEXPORT_H
24 
25 #include <tqstring.h>
26 #include <tqdatetime.h>
27 #include <tqmap.h>
28 
29 #include <libkcal/calendar.h>
30 #include <libkcal/htmlexportsettings.h>
31 
32 #include "libkcal_export.h"
33 
34 class TQFile;
35 class TQTextStream;
36 
37 namespace KCal {
38 
42 class TDE_EXPORT HtmlExport
43 {
44  public:
48  HtmlExport( Calendar *calendar, HTMLExportSettings *settings );
49  virtual ~HtmlExport() {}
50 
54  bool save( const TQString &fileName = TQString() );
55 
59  bool save( TQTextStream * );
60 
61  void addHoliday( const TQDate &date, const TQString &name );
62 
63  protected:
64  void createWeekView( TQTextStream *ts );
65  void createMonthView( TQTextStream *ts );
66  void createEventList( TQTextStream *ts );
67  void createTodoList( TQTextStream *ts );
68  void createJournalView( TQTextStream *ts );
69  void createFreeBusyView( TQTextStream *ts );
70 
71  void createTodo( TQTextStream *ts, Todo *todo);
72  void createEvent( TQTextStream *ts, Event *event, TQDate date,
73  bool withDescription = true);
74  void createFooter( TQTextStream *ts );
75 
76  bool checkSecrecy( Incidence * );
77 
78  void formatLocation( TQTextStream *ts, Incidence *event );
79  void formatCategories( TQTextStream *ts, Incidence *event );
80  void formatAttendees( TQTextStream *ts, Incidence *event );
81 
82  TQString breakString( const TQString &text );
83 
84  TQDate fromDate() const;
85  TQDate toDate() const;
86  TQString styleSheet() const;
87 
88  private:
89  TQString cleanChars( const TQString &txt );
90 
91  Calendar *mCalendar;
92  HTMLExportSettings *mSettings;
93  TQMap<TQDate,TQString> mHolidayMap;
94 
95  class Private;
96  Private *d;
97 };
98 
99 }
100 
101 #endif
Provides the main "calendar" object class.
This is the main "calendar" object class.
Definition: calendar.h:171
This class provides an Event in the sense of RFC2445.
Definition: event.h:33
This class provides the functions to export a calendar as an HTML page.
Definition: htmlexport.h:43
This class provides the base class common to all calendar components.
Definition: incidence.h:48
This class provides a Todo in the sense of RFC2445.
Definition: todo.h:32
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition: alarm.h:38