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

KHolidays Library

  • KHolidays
  • HolidayParserDriver
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KHolidays::HolidayParserDriver Class Reference

#include <holidayparserdriver_p.h>

Inheritance diagram for KHolidays::HolidayParserDriver:
Inheritance graph
[legend]

Public Member Functions

 HolidayParserDriver (const QString &filePath)
 
virtual ~HolidayParserDriver ()
 
virtual void error (const QString &errorMessage)
 
virtual QString fileCountryCode () const
 
virtual QString fileDescription () const
 
virtual QString fileLanguageCode () const
 
virtual QString fileName () const
 
virtual Holiday::List parseHolidays (const QDate &startDate, const QDate &endDate, Holiday::MultidayMode multidayMode)
 
virtual Holiday::List parseHolidays (const QDate &date, Holiday::MultidayMode multidayMode)
 
virtual Holiday::List parseHolidays (int calendarYear, const QString &calendarType, Holiday::MultidayMode multidayMode)
 

Protected Member Functions

virtual void parse ()
 
virtual void parseMetadata ()
 
virtual void setParseCalendar (const QString &calendarType)
 
virtual void setParseStartEnd ()
 

Protected Attributes

QString m_fileCountryCode
 
QString m_fileDescription
 
QString m_fileLanguageCode
 
QString m_fileName
 
QString m_filePath
 
Holiday::MultidayMode m_multidayMode
 
KCalendarSystem * m_parseCalendar
 
int m_parseEndYear
 
int m_parseStartYear
 
int m_parseYear
 
QDate m_requestEnd
 
QDate m_requestStart
 
Holiday::List m_resultList
 

Detailed Description

HolidayParserDriver abstract base class.

Defines a standard interface for parsing holiday files of various formats

Derived classes must implemet method parse(), other methods should work for most circumstances

Private, for internal use only

Definition at line 44 of file holidayparserdriver_p.h.

Constructor & Destructor Documentation

HolidayParserDriver::HolidayParserDriver ( const QString &  filePath)
explicit

Constructor of abstract holiday file parser driver class.

This will be called by derived classes.

Parameters
filePathfull path to holiday file

Definition at line 29 of file holidayparserdriver.cpp.

HolidayParserDriver::~HolidayParserDriver ( )
virtual

Destructor.

Definition at line 35 of file holidayparserdriver.cpp.

Member Function Documentation

void HolidayParserDriver::error ( const QString &  errorMessage)
virtual

Standard error message handling.

Parameters
errorMessageerror message to log

Reimplemented in KHolidays::HolidayParserDriverPlan, and KHolidays::HolidayParserDriverPlanOld.

Definition at line 97 of file holidayparserdriver.cpp.

QString HolidayParserDriver::fileCountryCode ( ) const
virtual

Return the ISO 3166 country/region code of the file.

May be either just a country code ("US" = USA) or may include a regional identifier ("US-CA" = California). Returns "XX" if not a country.

Returns
the full country code of the file

Definition at line 40 of file holidayparserdriver.cpp.

QString HolidayParserDriver::fileDescription ( ) const
virtual

Return the untranslated description of the file if available.

Returns
the untranslated description of the file

Definition at line 55 of file holidayparserdriver.cpp.

QString HolidayParserDriver::fileLanguageCode ( ) const
virtual

Return the ISO 639-1 language code of the file.

May be either just a language code ("en" = US English) or may include a country identifier ("en_GB" = British English).

Returns
the language code of the file

Definition at line 45 of file holidayparserdriver.cpp.

QString HolidayParserDriver::fileName ( ) const
virtual

Return the untranslated name of the file.

Returns
the untranslated name code of the file

Definition at line 50 of file holidayparserdriver.cpp.

void HolidayParserDriver::parse ( )
protectedvirtual

Actually parse the file, must be re-implemented by derived classes.

Reimplemented in KHolidays::HolidayParserDriverPlan, and KHolidays::HolidayParserDriverPlanOld.

Definition at line 102 of file holidayparserdriver.cpp.

Holiday::List HolidayParserDriver::parseHolidays ( const QDate &  startDate,
const QDate &  endDate,
Holiday::MultidayMode  multidayMode 
)
virtual

Return a list of holidays falling between any two dates.

Parameters
startDatestart date of the holiday parse range
endDateend date of the holiday parse range
multidayModehow to return multiday holidays
Returns
a list of holidays

Definition at line 60 of file holidayparserdriver.cpp.

Holiday::List HolidayParserDriver::parseHolidays ( const QDate &  date,
Holiday::MultidayMode  multidayMode 
)
virtual

Convenience function Return a list of holidays falling on a given date.

Parameters
datedate to return holidays for
multidayModehow to return multiday holidays
Returns
a list of holidays

Definition at line 75 of file holidayparserdriver.cpp.

Holiday::List HolidayParserDriver::parseHolidays ( int  calendarYear,
const QString &  calendarType,
Holiday::MultidayMode  multidayMode 
)
virtual

Convenience function Return a list of holidays falling in a given calendar year.

Parameters
calendarYearyear to return holidays for
calendarTypecalendar system of year, standard KDE calendar type, see KCalendarSystem
multidayModehow to return multiday holidays
Returns
a list of holidays

Definition at line 81 of file holidayparserdriver.cpp.

void HolidayParserDriver::parseMetadata ( )
protectedvirtual

Parse the file for metadata only and populate the metadata variables.

Reimplemented in KHolidays::HolidayParserDriverPlan, and KHolidays::HolidayParserDriverPlanOld.

Definition at line 106 of file holidayparserdriver.cpp.

void HolidayParserDriver::setParseCalendar ( const QString &  calendarType)
protectedvirtual

Set the calendar system to use.

Parameters
calendarTypestandard KDE calendar type, see KCalendarSystem

Definition at line 110 of file holidayparserdriver.cpp.

void HolidayParserDriver::setParseStartEnd ( )
protectedvirtual

Initialise parse year variables for calendar system.

Definition at line 116 of file holidayparserdriver.cpp.


The documentation for this class was generated from the following files:
  • holidayparserdriver_p.h
  • holidayparserdriver.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:06 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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