KCalUtils

htmlexport.h
1 /*
2  This file is part of the kcalutils library.
3 
4  SPDX-FileCopyrightText: 2000-2003 Cornelius Schumacher <[email protected]>
5  SPDX-FileCopyrightText: 2004 Reinhold Kainhofer <[email protected]>
6 
7  SPDX-License-Identifier: LGPL-2.0-or-later
8 */
9 #pragma once
10 
11 #include "kcalutils_export.h"
12 
13 #include <KCalendarCore/Event>
14 #include <KCalendarCore/Incidence>
15 #include <KCalendarCore/Todo>
16 
17 #include <QString>
18 
19 #include <memory>
20 
21 namespace KCalendarCore
22 {
23 class Calendar;
24 }
25 
26 class QTextStream;
27 
28 namespace KCalUtils
29 {
30 class HTMLExportSettings;
31 class HtmlExportPrivate;
32 /**
33  This class provides the functions to export a calendar as a HTML page.
34 */
35 class KCALUTILS_EXPORT HtmlExport
36 {
37 public:
38  /**
39  Create new HTML exporter for calendar.
40  */
41  HtmlExport(KCalendarCore::Calendar *calendar, HTMLExportSettings *settings);
42  virtual ~HtmlExport();
43 
44  /**
45  Writes out the calendar in HTML format.
46  */
47  Q_REQUIRED_RESULT bool save(const QString &fileName = QString());
48 
49  /**
50  Writes out calendar to text stream.
51  */
52  Q_REQUIRED_RESULT bool save(QTextStream *ts);
53 
54  void addHoliday(QDate date, const QString &name);
55 
56 protected:
57  void createWeekView(QTextStream *ts);
58  void createMonthView(QTextStream *ts);
59  void createEventList(QTextStream *ts);
60  void createTodoList(QTextStream *ts);
61  void createJournalView(QTextStream *ts);
62  void createFreeBusyView(QTextStream *ts);
63 
64  void createTodo(QTextStream *ts, const KCalendarCore::Todo::Ptr &todo);
65 
66  void createEvent(QTextStream *ts, const KCalendarCore::Event::Ptr &event, QDate date, bool withDescription = true);
67 
68  void createFooter(QTextStream *ts);
69 
70  bool checkSecrecy(const KCalendarCore::Incidence::Ptr &incidence);
71 
72  void formatLocation(QTextStream *ts, const KCalendarCore::Incidence::Ptr &incidence);
73 
74  void formatCategories(QTextStream *ts, const KCalendarCore::Incidence::Ptr &incidence);
75 
76  void formatAttendees(QTextStream *ts, const KCalendarCore::Incidence::Ptr &incidence);
77 
78  QString breakString(const QString &text);
79 
80  QDate fromDate() const;
81  QDate toDate() const;
82  QString styleSheet() const;
83 
84 private:
85  //@cond PRIVATE
86  Q_DISABLE_COPY(HtmlExport)
87  std::unique_ptr<HtmlExportPrivate> const d;
88  //@endcond
89 };
90 }
This class provides the functions to export a calendar as a HTML page.
Definition: htmlexport.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Mar 26 2023 04:09:43 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.