CalendarSupport

journalprint.h
1/*
2 SPDX-FileCopyrightText: 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
5*/
6
7#pragma once
8
9#include "calprintpluginbase.h"
10#include "ui_calprintjournalconfig_base.h"
11
12namespace CalendarSupport
13{
14class CalPrintJournal : public CalPrintPluginBase
15{
16public:
17 CalPrintJournal()
19 {
20 }
21
22 ~CalPrintJournal() override = default;
23
24 [[nodiscard]] QString groupName() const override
25 {
26 return QStringLiteral("Print journal");
27 }
28
29 [[nodiscard]] QString description() const override
30 {
31 return i18n("Print &journal");
32 }
33
34 [[nodiscard]] QString info() const override
35 {
36 return i18n("Prints all journals for a given date range");
37 }
38
39 QWidget *createConfigWidget(QWidget *) override;
40 [[nodiscard]] int sortID() const override
41 {
42 return CalPrinterBase::Journallist;
43 }
44
45 [[nodiscard]] bool enabled() const override
46 {
47 return true;
48 }
49
50public:
51 void print(QPainter &p, int width, int height) override;
52 void readSettingsWidget() override;
53 void setSettingsWidget() override;
54 void doLoadConfig() override;
55 void doSaveConfig() override;
56 void setDateRange(const QDate &from, const QDate &to) override;
57
58protected:
59 /**
60 Draws single journal item.
61
62 Obeys configuration options #mExcludeConfidential, #excludePrivate.
63 @param journal The item to be printed.
64 @param p QPainter of the printout
65 @param x x-coordinate of the upper left coordinate of the first item
66 @param y y-coordinate of the upper left coordinate of the first item
67 @param width width of the whole list
68 @param pageHeight Total height allowed for the list on a page. If an item
69 would be below that line, a new page is started.
70 */
71 void drawJournal(const KCalendarCore::Journal::Ptr &journal, QPainter &p, int x, int &y, int width, int pageHeight);
72 bool mUseDateRange;
73};
74
75class CalPrintJournalConfig : public QWidget, public Ui::CalPrintJournalConfig_Base
76{
77public:
78 explicit CalPrintJournalConfig(QWidget *parent)
80 {
81 setupUi(this);
82 }
83};
84}
QString i18n(const char *text, const TYPE &arg...)
QObject * parent() const const
void setupUi(QWidget *widget)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:13:02 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.