• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

KHolidays Library

  • kholidays
  • parsers
holidayparserdriver_p.h
1/*
2 This file is part of the kholidays library.
3
4 Copyright 2010 John Layt <john@layt.net>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21
22#ifndef KHOLIDAYS_HOLIDAYPARSERDRIVER_P_H
23#define KHOLIDAYS_HOLIDAYPARSERDRIVER_P_H
24
25#include <QDate>
26#include <QString>
27
28#include "holiday.h"
29
30class KCalendarSystem;
31
32namespace KHolidays {
33
44class HolidayParserDriver
45{
46 public:
47
54 explicit HolidayParserDriver( const QString &filePath );
55
59 virtual ~HolidayParserDriver();
60
69 virtual QString fileCountryCode() const;
70
79 virtual QString fileLanguageCode() const;
80
86 virtual QString fileName() const;
87
93 virtual QString fileDescription() const;
94
104 virtual Holiday::List parseHolidays( const QDate &startDate, const QDate &endDate,
105 Holiday::MultidayMode multidayMode );
106
116 virtual Holiday::List parseHolidays( const QDate &date, Holiday::MultidayMode multidayMode );
117
129 virtual Holiday::List parseHolidays( int calendarYear, const QString &calendarType,
130 Holiday::MultidayMode multidayMode );
131
137 virtual void error( const QString &errorMessage );
138
139 protected:
143 virtual void parse();
144
148 virtual void parseMetadata();
149
155 virtual void setParseCalendar( const QString &calendarType );
156
160 virtual void setParseStartEnd();
161
162 QString m_filePath; // File to be parsed
163
164 QString m_fileCountryCode; // File country code in ISO 3166-2 standard
165 QString m_fileLanguageCode; // File language
166 QString m_fileName; // File name
167 QString m_fileDescription; // File description
168
169 QDate m_requestStart; // First day of period being requested
170 QDate m_requestEnd; // Last day of period being requested
171
172 Holiday::List m_resultList; // List of requested holidays
173
174 KCalendarSystem *m_parseCalendar; // Calendar system being parsed
175 int m_parseYear; // Year currently being parsed
176 int m_parseStartYear; // First year to parse in parse calendar
177 int m_parseEndYear; // Last year to parse in parse calendar
178
179 Holiday::MultidayMode m_multidayMode; // How to return multiday holidays
180};
181
182}
183
184#endif // KHOLIDAYS_HOLIDAYPARSERDRIVER_P_H
KHolidays::HolidayParserDriver
HolidayParserDriver abstract base class.
Definition: holidayparserdriver_p.h:45
KHolidays::HolidayParserDriver::setParseStartEnd
virtual void setParseStartEnd()
Initialise parse year variables for calendar system.
Definition: holidayparserdriver.cpp:116
KHolidays::HolidayParserDriver::error
virtual void error(const QString &errorMessage)
Standard error message handling.
Definition: holidayparserdriver.cpp:97
KHolidays::HolidayParserDriver::fileName
virtual QString fileName() const
Return the untranslated name of the file.
Definition: holidayparserdriver.cpp:50
KHolidays::HolidayParserDriver::~HolidayParserDriver
virtual ~HolidayParserDriver()
Destructor.
Definition: holidayparserdriver.cpp:35
KHolidays::HolidayParserDriver::setParseCalendar
virtual void setParseCalendar(const QString &calendarType)
Set the calendar system to use.
Definition: holidayparserdriver.cpp:110
KHolidays::HolidayParserDriver::parse
virtual void parse()
Actually parse the file, must be re-implemented by derived classes.
Definition: holidayparserdriver.cpp:102
KHolidays::HolidayParserDriver::parseHolidays
virtual Holiday::List parseHolidays(const QDate &startDate, const QDate &endDate, Holiday::MultidayMode multidayMode)
Return a list of holidays falling between any two dates.
Definition: holidayparserdriver.cpp:60
KHolidays::HolidayParserDriver::fileDescription
virtual QString fileDescription() const
Return the untranslated description of the file if available.
Definition: holidayparserdriver.cpp:55
KHolidays::HolidayParserDriver::fileLanguageCode
virtual QString fileLanguageCode() const
Return the ISO 639-1 language code of the file.
Definition: holidayparserdriver.cpp:45
KHolidays::HolidayParserDriver::fileCountryCode
virtual QString fileCountryCode() const
Return the ISO 3166 country/region code of the file.
Definition: holidayparserdriver.cpp:40
KHolidays::HolidayParserDriver::parseMetadata
virtual void parseMetadata()
Parse the file for metadata only and populate the metadata variables.
Definition: holidayparserdriver.cpp:106
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHolidays Library

Skip menu "KHolidays Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal