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 <tqstring.h>
00024 #include <tqstringlist.h>
00025 #include <tqdatetime.h>
00026 #include <tqvaluelist.h>
00027 
00028 #include <kdepimmacros.h>
00029 
00030 struct KHoliday {
00031   TQString text;
00032   TQString shortText;
00033   int Category;
00034 };
00035 
00036 class KDE_EXPORT KHolidays {
00037   public:
00043     static TQStringList locations();
00047     static TQString fileForLocation( const TQString &location );
00052     static TQString userPath( bool create = false );
00056     static TQString generateFileName( const TQString &location );
00057 
00058     KHolidays( const TQString& location );
00059     ~KHolidays();
00060 
00062     TQString location() const;
00063 
00064     TQValueList<KHoliday> getHolidays( const TQDate& );
00065     
00066     KDE_DEPRECATED TQString shortText( const TQDate& );
00067     KDE_DEPRECATED TQString getHoliday( const TQDate& );
00068 
00069     enum { WORKDAY, HOLIDAY };
00070     KDE_DEPRECATED int category( const TQDate& );
00071 
00072   private:
00073     bool parseFile( const TQDate& );
00074 
00075     TQString mLocation;    // location string used to determine holidays file
00076     TQString mHolidayFile; // name of file containing holiday data
00077     int mYearLast;        // save off the last year we have seen
00078 };
00079 
00080 #endif