libkholidays

kholidays.h
1 /*
2  This file is part of KOrganizer.
3  Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4  Copyright (c) 2004 Allen Winter <winter@kde.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20 #ifndef KHOLIDAYS_HOLIDAYS_H
21 #define KHOLIDAYS_HOLIDAYS_H
22 
23 #include <tqstring.h>
24 #include <tqstringlist.h>
25 #include <tqdatetime.h>
26 #include <tqvaluelist.h>
27 
28 #include <tdemacros.h>
29 
30 struct KHoliday {
31  TQString text;
32  TQString shortText;
33  int Category;
34 };
35 
36 class TDE_EXPORT KHolidays {
37  public:
43  static TQStringList locations();
47  static TQString fileForLocation( const TQString &location );
52  static TQString userPath( bool create = false );
56  static TQString generateFileName( const TQString &location );
57 
58  KHolidays( const TQString& location );
59  ~KHolidays();
60 
62  TQString location() const;
63 
64  TQValueList<KHoliday> getHolidays( const TQDate& );
65 
66  TDE_DEPRECATED TQString shortText( const TQDate& );
67  TDE_DEPRECATED TQString getHoliday( const TQDate& );
68 
69  enum { WORKDAY, HOLIDAY };
70  TDE_DEPRECATED int category( const TQDate& );
71 
72  private:
73  bool parseFile( const TQDate& );
74 
75  TQString mLocation; // location string used to determine holidays file
76  TQString mHolidayFile; // name of file containing holiday data
77  int mYearLast; // save off the last year we have seen
78 };
79 
80 #endif