libkholidays
kholidays.h
00001 /* 00002 This file is part of KOrganizer. 00003 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 00004 Copyright (c) 2004 Allen Winter <winter@kde.org> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 */ 00020 #ifndef KHOLIDAYS_HOLIDAYS_H 00021 #define KHOLIDAYS_HOLIDAYS_H 00022 00023 #include <qstring.h> 00024 #include <qstringlist.h> 00025 #include <qdatetime.h> 00026 00027 #include <kdepimmacros.h> 00028 00029 class KDE_EXPORT KHolidays { 00030 public: 00036 static QStringList locations(); 00037 00038 KHolidays( const QString& location ); 00039 ~KHolidays(); 00040 00042 QString location() const; 00043 00044 QString shortText( const QDate& ); 00045 00046 QString getHoliday( const QDate& ); 00047 00048 enum { WORKDAY, HOLIDAY }; 00049 int category( const QDate& ); 00050 00051 private: 00052 bool parseFile( const QDate& ); 00053 00054 QString mLocation; // location string used to determine holidays file 00055 QString mHolidayFile; // name of file containing holiday data 00056 int mYearLast; // save off the last year we have seen 00057 }; 00058 00059 #endif