• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

KHolidays Library

  • kholidays
holidayregionselector.h
1/*
2 This file is part of the kholidays library.
3
4 Copyright 2010 John Layt <john@layt.net>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library 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 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21
22#ifndef KHOLIDAYS_HOLIDAYREGIONSELECTOR_H
23#define KHOLIDAYS_HOLIDAYREGIONSELECTOR_H
24
25#include "kholidays_export.h"
26
27#include <QTreeWidget>
28
29class QString;
30class QStringList;
31
32namespace KHolidays {
33
34class HolidayRegion;
35
36class KHOLIDAYS_EXPORT HolidayRegionSelector : public QWidget
37{
38 Q_OBJECT
39 Q_PROPERTY( QAbstractItemView::SelectionMode listSelectionMode
40 READ selectionMode WRITE setSelectionMode )
41
42 Q_PROPERTY( bool enableRegionUseFlags
43 READ regionUseFlagsEnabled WRITE setRegionUseFlagsEnabled )
44
45 Q_PROPERTY( bool hideSearch
46 READ searchHidden WRITE setSearchHidden )
47
48 Q_PROPERTY( bool hideDescription
49 READ descriptionHidden WRITE setDescriptionHidden )
50
51 Q_PROPERTY( bool hideLanguage
52 READ languageHidden WRITE setLanguageHidden )
53
54 Q_PROPERTY( QStringList languageFilter
55 READ languageFilter WRITE setLanguageFilter )
56
57 public:
61 enum SelectionStatus {
62 RegionHidden,
63 RegionDisabled,
64 RegionAvailable,
65 RegionSelected
66 };
67
71 enum RegionUseFlag {
72 NotUsed = 0x00,
73 UseInformationOnly = 0x01,
74 UseDaysOff = 0x02
75 };
76 Q_DECLARE_FLAGS( RegionUseFlags, RegionUseFlag )
77
78
94 explicit HolidayRegionSelector( QWidget *parent = 0 );
95
99 virtual ~HolidayRegionSelector();
100
106 QStringList holidayRegions() const;
107
120 void setSelectionMode( QAbstractItemView::SelectionMode selectionMode );
121
128 QAbstractItemView::SelectionMode selectionMode() const;
129
144 void setRegionUseFlagsEnabled( bool enableRegionUseFlags );
145
152 bool regionUseFlagsEnabled() const;
153
161 void setSelectionStatus( const QString &holidayRegionCode,
162 HolidayRegionSelector::SelectionStatus status );
163
171 HolidayRegionSelector::SelectionStatus selectionStatus(
172 const QString &holidayRegionCode ) const;
173
180 QHash<QString, HolidayRegionSelector::SelectionStatus> selectionStatus() const;
181
191 QStringList selection( HolidayRegionSelector::SelectionStatus selectionStatus =
192 HolidayRegionSelector::RegionSelected ) const;
193
202 QStringList selection( HolidayRegionSelector::RegionUseFlags regionUseFlags ) const;
203
211 void clearSelection();
212
220 void setRegionUseFlags( const QString &holidayRegionCode,
221 HolidayRegionSelector::RegionUseFlags regionUseFlags );
222
230 HolidayRegionSelector::RegionUseFlags regionUseFlags( const QString &holidayRegionCode ) const;
231
238 QHash<QString, HolidayRegionSelector::RegionUseFlags> regionUseFlags() const;
239
253 void setLanguageFilter( const QStringList &languages );
254
261 QStringList languageFilter() const;
262
269 void setSearchHidden( bool hideSearch );
270
277 bool searchHidden() const;
278
285 void setLanguageHidden( bool hideLanguage );
286
293 bool languageHidden() const;
294
301 void setDescriptionHidden( bool hideDescription );
302
309 bool descriptionHidden() const;
310
311 private Q_SLOTS:
312 void itemChanged( QTreeWidgetItem *item, int column );
313 void itemChanged( int index );
314
315 Q_SIGNALS:
316 void selectionChanged();
317
318 private:
319 class Private;
320 Private *const d;
321};
322
323} // namespace KHolidays
324
325Q_DECLARE_OPERATORS_FOR_FLAGS( KHolidays::HolidayRegionSelector::RegionUseFlags )
326
327#endif // KHOLIDAYS_HOLIDAYREGIONSELECTOR_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHolidays Library

Skip menu "KHolidays Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal