• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

KHolidays Library

holidayregionselector.h
00001 /*
00002   This file is part of the kholidays library.
00003 
00004   Copyright 2010 John Layt <john@layt.net>
00005 
00006   This library is free software; you can redistribute it and/or
00007   modify it under the terms of the GNU Library General Public
00008   License as published by the Free Software Foundation; either
00009   version 2 of the License, or (at your option) any later version.
00010 
00011   This library is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014   GNU Library General Public License for more details.
00015 
00016   You should have received a copy of the GNU Library General Public License
00017   along with this library; see the file COPYING.LIB.  If not, write to the
00018   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019   Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KHOLIDAYS_HOLIDAYREGIONSELECTOR_H
00023 #define KHOLIDAYS_HOLIDAYREGIONSELECTOR_H
00024 
00025 #include "kholidays_export.h"
00026 
00027 #include <QtGui/QTreeWidget>
00028 
00029 class QString;
00030 class QStringList;
00031 
00032 namespace KHolidays {
00033 
00034 class HolidayRegion;
00035 
00036 class KHOLIDAYS_EXPORT HolidayRegionSelector : public QWidget
00037 {
00038   Q_OBJECT
00039   Q_PROPERTY( QAbstractItemView::SelectionMode listSelectionMode READ selectionMode WRITE setSelectionMode )
00040   Q_PROPERTY( bool enableRegionUseFlags READ regionUseFlagsEnabled WRITE setRegionUseFlagsEnabled )
00041   Q_PROPERTY( bool hideSearch READ searchHidden WRITE setSearchHidden )
00042   Q_PROPERTY( bool hideDescription READ descriptionHidden WRITE setDescriptionHidden )
00043   Q_PROPERTY( bool hideLanguage READ languageHidden WRITE setLanguageHidden )
00044   Q_PROPERTY( QStringList languageFilter READ languageFilter WRITE setLanguageFilter )
00045 
00046 public:
00050   enum SelectionStatus {
00051     RegionHidden,             
00052     RegionDisabled,           
00053     RegionAvailable,          
00054     RegionSelected            
00055   };
00056 
00060   enum RegionUseFlag {
00061     NotUsed            = 0x00,    
00062     UseInformationOnly = 0x01,    
00063     UseDaysOff         = 0x02     
00064   };
00065   Q_DECLARE_FLAGS(RegionUseFlags, RegionUseFlag)
00066 
00067   
00082   explicit HolidayRegionSelector( QWidget *parent = 0 );
00083 
00087   virtual ~HolidayRegionSelector();
00088 
00094   QStringList holidayRegions() const;
00095 
00108   void setSelectionMode( QAbstractItemView::SelectionMode selectionMode );
00109 
00116   QAbstractItemView::SelectionMode selectionMode() const;
00117 
00132   void setRegionUseFlagsEnabled( bool enableRegionUseFlags );
00133 
00140   bool regionUseFlagsEnabled() const;
00141 
00149   void setSelectionStatus( const QString &holidayRegionCode,
00150                            HolidayRegionSelector::SelectionStatus status );
00151 
00159   HolidayRegionSelector::SelectionStatus selectionStatus( const QString &holidayRegionCode ) const;
00160 
00167   QHash<QString, HolidayRegionSelector::SelectionStatus> selectionStatus() const;
00168 
00178   QStringList selection( HolidayRegionSelector::SelectionStatus selectionStatus =
00179                          HolidayRegionSelector::RegionSelected ) const;
00180 
00189   QStringList selection( HolidayRegionSelector::RegionUseFlags regionUseFlags ) const;
00190 
00198   void clearSelection();
00199 
00207   void setRegionUseFlags( const QString &holidayRegionCode,
00208                           HolidayRegionSelector::RegionUseFlags regionUseFlags );
00209 
00217   HolidayRegionSelector::RegionUseFlags regionUseFlags( const QString &holidayRegionCode ) const;
00218 
00225   QHash<QString, HolidayRegionSelector::RegionUseFlags> regionUseFlags() const;
00226 
00238   void setLanguageFilter( const QStringList &languages );
00239 
00246   QStringList languageFilter() const;
00247 
00254   void setSearchHidden( bool hideSearch );
00255 
00262   bool searchHidden() const;
00263 
00270   void setLanguageHidden( bool hideLanguage );
00271 
00278   bool languageHidden() const;
00279 
00286   void setDescriptionHidden( bool hideDescription );
00287 
00294   bool descriptionHidden() const;
00295 
00296 private Q_SLOTS:
00297 
00298   void itemChanged( QTreeWidgetItem *item, int column );
00299   void itemChanged( int index );
00300 
00301 private:
00302   class Private;
00303   Private* const d;
00304 };
00305 
00306 } // namespace KHolidays
00307 
00308 Q_DECLARE_OPERATORS_FOR_FLAGS(KHolidays::HolidayRegionSelector::RegionUseFlags)
00309 
00310 #endif // KHOLIDAYS_HOLIDAYREGIONSELECTOR_H

KHolidays Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • 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
Generated for KDE-PIM Libraries by doxygen 1.7.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal