KHolidays Library
holidays.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KHOLIDAYS_HOLIDAYS_H
00024 #define KHOLIDAYS_HOLIDAYS_H
00025
00026 #include "kholidays_export.h"
00027
00028 #include <QtCore/QList>
00029 #include <QtCore/QSharedDataPointer>
00030 #include <QtCore/QString>
00031
00032 class QDate;
00033 class QStringList;
00034
00035 namespace KHolidays {
00036
00037 class HolidayPrivate;
00038
00039 class KHOLIDAYS_EXPORT Holiday
00040 {
00041 friend class HolidayRegion;
00042
00043 public:
00047 typedef QList<Holiday> List;
00048
00052 enum DayType {
00053 Workday,
00054 NonWorkday
00055 };
00056
00060 Holiday();
00061
00065 Holiday( const Holiday &other );
00066
00070 ~Holiday();
00071
00075 Holiday &operator=( const Holiday &other );
00076
00080 QString text() const;
00081
00085 QString shortText() const;
00086
00090 DayType dayType() const;
00091
00092 private:
00093 QSharedDataPointer<HolidayPrivate> d;
00094 };
00095
00096 class KHOLIDAYS_EXPORT HolidayRegion
00097 {
00098 public:
00105 explicit HolidayRegion( const QString &location = QString() );
00106
00110 ~HolidayRegion();
00111
00118 static QStringList locations();
00119
00128 QString location() const;
00129
00133 Holiday::List holidays( const QDate &date ) const;
00134
00138 bool isHoliday( const QDate &date ) const;
00139
00143 bool isValid() const;
00144
00145 private:
00146 Q_DISABLE_COPY( HolidayRegion )
00147
00148 class Private;
00149 Private *const d;
00150 };
00151
00152 }
00153
00154 #endif