File indexing completed on 2025-01-05 04:47:43

0001 /*
0002   SPDX-FileCopyrightText: 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
0005 */
0006 
0007 #pragma once
0008 
0009 #include "calprintpluginbase.h"
0010 #include "ui_calprintyearconfig_base.h"
0011 
0012 namespace CalendarSupport
0013 {
0014 class CalPrintYear : public CalPrintPluginBase
0015 {
0016 public:
0017     CalPrintYear()
0018         : CalPrintPluginBase()
0019     {
0020     }
0021 
0022     ~CalPrintYear() override = default;
0023 
0024     [[nodiscard]] QString groupName() const override
0025     {
0026         return QStringLiteral("Print year");
0027     }
0028 
0029     [[nodiscard]] QString description() const override
0030     {
0031         return i18n("Print &year");
0032     }
0033 
0034     [[nodiscard]] QString info() const override
0035     {
0036         return i18n("Prints a calendar for an entire year");
0037     }
0038 
0039     [[nodiscard]] int sortID() const override
0040     {
0041         return CalPrinterBase::Year;
0042     }
0043 
0044     [[nodiscard]] bool enabled() const override
0045     {
0046         return true;
0047     }
0048 
0049     QWidget *createConfigWidget(QWidget *) override;
0050     [[nodiscard]] QPageLayout::Orientation defaultOrientation() const override;
0051 
0052 public:
0053     void print(QPainter &p, int width, int height) override;
0054     void readSettingsWidget() override;
0055     void setSettingsWidget() override;
0056     void doLoadConfig() override;
0057     void doSaveConfig() override;
0058     void setDateRange(const QDate &from, const QDate &to) override;
0059 
0060 protected:
0061     int mYear;
0062     int mPages;
0063     int mSubDaysEvents;
0064     int mHolidaysEvents;
0065 };
0066 
0067 class CalPrintYearConfig : public QWidget, public Ui::CalPrintYearConfig_Base
0068 {
0069 public:
0070     explicit CalPrintYearConfig(QWidget *parent)
0071         : QWidget(parent)
0072     {
0073         setupUi(this);
0074     }
0075 };
0076 }