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();
00047     static QString fileForLocation( const QString &location );
00052     static QString userPath( bool create = false );
00056     static QString generateFileName( const QString &location );
00057 
00058     KHolidays( const QString& location );
00059     ~KHolidays();
00060 
00062     QString location() const;
00063 
00064     QValueList<KHoliday> getHolidays( const QDate& );
00065     
00066     KDE_DEPRECATED QString shortText( const QDate& );
00067     KDE_DEPRECATED QString getHoliday( const QDate& );
00068 
00069     enum { WORKDAY, HOLIDAY };
00070     KDE_DEPRECATED int category( const QDate& );
00071 
00072   private:
00073     bool parseFile( const QDate& );
00074 
00075     QString mLocation;    // location string used to determine holidays file
00076     QString mHolidayFile; // name of file containing holiday data
00077     int mYearLast;        // save off the last year we have seen
00078 };
00079 
00080 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys