File indexing completed on 2024-05-12 05:21:24
0001 /* 0002 This file is part of KOrganizer. 0003 0004 SPDX-FileCopyrightText: 2002 Cornelius Schumacher <schumacher@kde.org> 0005 0006 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0 0007 */ 0008 0009 #pragma once 0010 0011 #include "korganizerprivate_export.h" 0012 0013 #include <QDate> 0014 #include <QList> 0015 #include <QMap> 0016 #include <QString> 0017 0018 namespace KHolidays 0019 { 0020 class HolidayRegion; 0021 } 0022 0023 class KORGANIZERPRIVATE_EXPORT KOGlobals 0024 { 0025 friend class KOGlobalsSingletonPrivate; 0026 0027 public: 0028 static KOGlobals *self(); 0029 0030 static bool reverseLayout(); 0031 0032 ~KOGlobals(); 0033 0034 [[nodiscard]] QMap<QDate, QStringList> holiday(const QDate &start, const QDate &end) const; 0035 0036 [[nodiscard]] int firstDayOfWeek() const; 0037 0038 [[nodiscard]] int getWorkWeekMask(); 0039 0040 /** 0041 Set which holiday regions the user wants to use. 0042 @param regions a list of Holiday Regions strings. 0043 */ 0044 void setHolidays(const QStringList ®ions); 0045 0046 /** return the HolidayRegion object or 0 if none has been defined 0047 */ 0048 [[nodiscard]] QList<KHolidays::HolidayRegion *> holidays() const; 0049 0050 protected: 0051 KOGlobals(); 0052 0053 private: 0054 QList<KHolidays::HolidayRegion *> mHolidayRegions; 0055 };