22 #ifndef KHOLIDAYS_HOLIDAYREGIONSELECTOR_H
23 #define KHOLIDAYS_HOLIDAYREGIONSELECTOR_H
25 #include "kholidays_export.h"
27 #include <QTreeWidget>
36 class KHOLIDAYS_EXPORT HolidayRegionSelector :
public QWidget
39 Q_PROPERTY( QAbstractItemView::SelectionMode listSelectionMode
40 READ selectionMode WRITE setSelectionMode )
42 Q_PROPERTY(
bool enableRegionUseFlags
43 READ regionUseFlagsEnabled WRITE setRegionUseFlagsEnabled )
45 Q_PROPERTY(
bool hideSearch
46 READ searchHidden WRITE setSearchHidden )
48 Q_PROPERTY(
bool hideDescription
49 READ descriptionHidden WRITE setDescriptionHidden )
51 Q_PROPERTY(
bool hideLanguage
52 READ languageHidden WRITE setLanguageHidden )
55 READ languageFilter WRITE setLanguageFilter )
61 enum SelectionStatus {
73 UseInformationOnly = 0x01,
76 Q_DECLARE_FLAGS( RegionUseFlags, RegionUseFlag )
94 explicit HolidayRegionSelector(
QWidget *parent = 0 );
99 virtual ~HolidayRegionSelector();
144 void setRegionUseFlagsEnabled(
bool enableRegionUseFlags );
152 bool regionUseFlagsEnabled() const;
161 void setSelectionStatus( const
QString &holidayRegionCode,
162 HolidayRegionSelector::SelectionStatus status );
171 HolidayRegionSelector::SelectionStatus selectionStatus(
172 const
QString &holidayRegionCode ) const;
180 QHash<
QString, HolidayRegionSelector::SelectionStatus> selectionStatus() const;
191 QStringList selection( HolidayRegionSelector::SelectionStatus selectionStatus =
192 HolidayRegionSelector::RegionSelected ) const;
202 QStringList selection( HolidayRegionSelector::RegionUseFlags regionUseFlags ) const;
211 void clearSelection();
220 void setRegionUseFlags( const QString &holidayRegionCode,
221 HolidayRegionSelector::RegionUseFlags regionUseFlags );
230 HolidayRegionSelector::RegionUseFlags regionUseFlags( const QString &holidayRegionCode ) const;
238 QHash<QString, HolidayRegionSelector::RegionUseFlags> regionUseFlags() const;
253 void setLanguageFilter( const
QStringList &languages );
269 void setSearchHidden(
bool hideSearch );
277 bool searchHidden() const;
285 void setLanguageHidden(
bool hideLanguage );
293 bool languageHidden() const;
301 void setDescriptionHidden(
bool hideDescription );
309 bool descriptionHidden() const;
313 void itemChanged(
int index );
316 void selectionChanged();
325 Q_DECLARE_OPERATORS_FOR_FLAGS( KHolidays::HolidayRegionSelector::RegionUseFlags )
327 #endif // KHOLIDAYS_HOLIDAYREGIONSELECTOR_H