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 #include <qvaluelist.h>
00027 
00028 #include <kdepimmacros.h>
00029 
00030 struct KHoliday {
00031   QString text;
00032   QString shortText;
00033   int Category;
00034 };
00035 
00036 class KDE_EXPORT KHolidays {
00037   public:
00043     static QStringList locations();
00044 
00045     KHolidays( const QString& location );
00046     ~KHolidays();
00047 
00049     QString location() const;
00050 
00051     QValueList<KHoliday> getHolidays( const QDate& );
00052     
00053     KDE_DEPRECATED QString shortText( const QDate& );
00054     KDE_DEPRECATED QString getHoliday( const QDate& );
00055 
00056     enum { WORKDAY, HOLIDAY };
00057     KDE_DEPRECATED int category( const QDate& );
00058 
00059   private:
00060     bool parseFile( const QDate& );
00061 
00062     QString mLocation;    // location string used to determine holidays file
00063     QString mHolidayFile; // name of file containing holiday data
00064     int mYearLast;        // save off the last year we have seen
00065 };
00066 
00067 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys