• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.9.3 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 <QtGui/QTreeWidget>
28 
29 class QString;
30 class QStringList;
31 
32 namespace KHolidays {
33 
34 class HolidayRegion;
35 
36 class KHOLIDAYS_EXPORT HolidayRegionSelector : public QWidget
37 {
38  Q_OBJECT
39  Q_PROPERTY( QAbstractItemView::SelectionMode listSelectionMode READ selectionMode WRITE setSelectionMode )
40  Q_PROPERTY( bool enableRegionUseFlags READ regionUseFlagsEnabled WRITE setRegionUseFlagsEnabled )
41  Q_PROPERTY( bool hideSearch READ searchHidden WRITE setSearchHidden )
42  Q_PROPERTY( bool hideDescription READ descriptionHidden WRITE setDescriptionHidden )
43  Q_PROPERTY( bool hideLanguage READ languageHidden WRITE setLanguageHidden )
44  Q_PROPERTY( QStringList languageFilter READ languageFilter WRITE setLanguageFilter )
45 
46  public:
50  enum SelectionStatus {
51  RegionHidden,
52  RegionDisabled,
53  RegionAvailable,
54  RegionSelected
55  };
56 
60  enum RegionUseFlag {
61  NotUsed = 0x00,
62  UseInformationOnly = 0x01,
63  UseDaysOff = 0x02
64  };
65  Q_DECLARE_FLAGS( RegionUseFlags, RegionUseFlag )
66 
67 
82  explicit HolidayRegionSelector( QWidget *parent = 0 );
83 
87  virtual ~HolidayRegionSelector();
88 
94  QStringList holidayRegions() const;
95 
108  void setSelectionMode( QAbstractItemView::SelectionMode selectionMode );
109 
116  QAbstractItemView::SelectionMode selectionMode() const;
117 
132  void setRegionUseFlagsEnabled( bool enableRegionUseFlags );
133 
140  bool regionUseFlagsEnabled() const;
141 
149  void setSelectionStatus( const QString &holidayRegionCode,
150  HolidayRegionSelector::SelectionStatus status );
151 
159  HolidayRegionSelector::SelectionStatus selectionStatus(
160  const QString &holidayRegionCode ) const;
161 
168  QHash<QString, HolidayRegionSelector::SelectionStatus> selectionStatus() const;
169 
179  QStringList selection( HolidayRegionSelector::SelectionStatus selectionStatus =
180  HolidayRegionSelector::RegionSelected ) const;
181 
190  QStringList selection( HolidayRegionSelector::RegionUseFlags regionUseFlags ) const;
191 
199  void clearSelection();
200 
208  void setRegionUseFlags( const QString &holidayRegionCode,
209  HolidayRegionSelector::RegionUseFlags regionUseFlags );
210 
218  HolidayRegionSelector::RegionUseFlags regionUseFlags( const QString &holidayRegionCode ) const;
219 
226  QHash<QString, HolidayRegionSelector::RegionUseFlags> regionUseFlags() const;
227 
239  void setLanguageFilter( const QStringList &languages );
240 
247  QStringList languageFilter() const;
248 
255  void setSearchHidden( bool hideSearch );
256 
263  bool searchHidden() const;
264 
271  void setLanguageHidden( bool hideLanguage );
272 
279  bool languageHidden() const;
280 
287  void setDescriptionHidden( bool hideDescription );
288 
295  bool descriptionHidden() const;
296 
297  private Q_SLOTS:
298  void itemChanged( QTreeWidgetItem *item, int column );
299  void itemChanged( int index );
300 
301  Q_SIGNALS:
302  void selectionChanged();
303 
304  private:
305  class Private;
306  Private *const d;
307 };
308 
309 } // namespace KHolidays
310 
311 Q_DECLARE_OPERATORS_FOR_FLAGS( KHolidays::HolidayRegionSelector::RegionUseFlags )
312 
313 #endif // KHOLIDAYS_HOLIDAYREGIONSELECTOR_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Nov 26 2012 16:46:39 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHolidays Library

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

kdepimlibs-4.9.3 API Reference

Skip menu "kdepimlibs-4.9.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • 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