• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

KHolidays Library

  • KHolidays
  • KHolidays::HolidayParserDriver
Public Member Functions | Protected Member Functions | Protected Attributes

KHolidays::HolidayParserDriver Class Reference

HolidayParserDriver abstract base class. More...

#include <holidayparserdriver_p.h>

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

List of all members.

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 (int calendarYear, const QString &calendarType)
virtual Holiday::List parseHolidays (const QDate &startDate, const QDate &endDate)
virtual Holiday::List parseHolidays (const QDate &date)

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
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

For internal use only.

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:
filePath full 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:
errorMessage error message to log

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

Definition at line 93 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 (  )  [protected, virtual]

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

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

Definition at line 98 of file holidayparserdriver.cpp.

Holiday::List HolidayParserDriver::parseHolidays ( int  calendarYear,
const QString &  calendarType 
) [virtual]

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

Parameters:
calendarYear year to return holidays for
calendarType calendar system of year, standard KDE calendar type, see KCalendarSystem
Returns:
a list of holidays

Definition at line 78 of file holidayparserdriver.cpp.

Holiday::List HolidayParserDriver::parseHolidays ( const QDate &  startDate,
const QDate &  endDate 
) [virtual]

Return a list of holidays falling between any two dates.

Parameters:
startDate start date of the holiday parse range
endDate end date of the holiday parse range
Returns:
a list of holidays

Definition at line 60 of file holidayparserdriver.cpp.

Holiday::List HolidayParserDriver::parseHolidays ( const QDate &  date  )  [virtual]

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

Parameters:
date date to return holidays for
Returns:
a list of holidays

Definition at line 73 of file holidayparserdriver.cpp.

void HolidayParserDriver::parseMetadata (  )  [protected, virtual]

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

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

Definition at line 102 of file holidayparserdriver.cpp.

void HolidayParserDriver::setParseCalendar ( const QString &  calendarType  )  [protected, virtual]

Set the calendar system to use.

Parameters:
calendarType standard KDE calendar type, see KCalendarSystem

Definition at line 106 of file holidayparserdriver.cpp.

void HolidayParserDriver::setParseStartEnd (  )  [protected, virtual]

Initialise parse year variables for calendar system.

Definition at line 112 of file holidayparserdriver.cpp.


The documentation for this class was generated from the following files:
  • holidayparserdriver_p.h
  • holidayparserdriver.cpp

KHolidays Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal