File indexing completed on 2023-09-24 08:37:49
0001 /* 0002 SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KOPENINGHOURS_HOLIDAYCACHE_P_H 0008 #define KOPENINGHOURS_HOLIDAYCACHE_P_H 0009 0010 namespace KHolidays { 0011 class Holiday; 0012 class HolidayRegion; 0013 } 0014 0015 class QDate; 0016 class QStringView; 0017 0018 namespace KOpeningHours { 0019 0020 /** Cache of holiday region lookups, and holidays for holiday regions 0021 * This is necessary as KHolidays is too slow for high-frequency evaluation. 0022 */ 0023 namespace HolidayCache 0024 { 0025 /** Find KHoliday region for a given ISO 3166-1/2 code. */ 0026 KHolidays::HolidayRegion resolveRegion(QStringView region); 0027 0028 /** Returns the next holiday at or after @p dt in the given holiday region. */ 0029 KHolidays::Holiday nextHoliday(const KHolidays::HolidayRegion ®ion, QDate date); 0030 } 0031 0032 } 0033 0034 #endif // KOPENINGHOURS_HOLIDAYCACHE_P_H