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

KHolidays Library

holiday.cpp
00001 /*
00002   This file is part of the kholidays library.
00003 
00004   Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
00005   Copyright (c) 2004 Allen Winter <winter@kde.org>
00006   Copyright (c) 2008 David Jarvie <djarvie@kde.org>
00007   Copyright 2010 John Layt <john@layt.net>
00008 
00009   This library is free software; you can redistribute it and/or
00010   modify it under the terms of the GNU Library General Public
00011   License as published by the Free Software Foundation; either
00012   version 2 of the License, or (at your option) any later version.
00013 
00014   This library is distributed in the hope that it will be useful,
00015   but WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017   GNU Library General Public License for more details.
00018 
00019   You should have received a copy of the GNU Library General Public License
00020   along with this library; see the file COPYING.LIB.  If not, write to the
00021   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00022   Boston, MA 02110-1301, USA.
00023 */
00024 
00025 #include "holiday.h"
00026 #include "holiday_p.h"
00027 
00028 #include <KStandardDirs>
00029 
00030 #include <QtCore/QDateTime>
00031 #include <QtCore/QFile>
00032 #include <QtCore/QSharedData>
00033 
00034 using namespace KHolidays;
00035 
00036 Holiday::Holiday()
00037   : d( new HolidayPrivate )
00038 {
00039 }
00040 
00041 Holiday::Holiday( const Holiday &other )
00042   : d( other.d )
00043 {
00044 }
00045 
00046 Holiday::~Holiday()
00047 {
00048 }
00049 
00050 Holiday &Holiday::operator=( const Holiday &other )
00051 {
00052   if ( &other != this ) {
00053     d = other.d;
00054   }
00055 
00056   return *this;
00057 }
00058 
00059 bool Holiday::operator<( const Holiday &rhs ) const
00060 {
00061   return d->mObservedDate < rhs.d->mObservedDate;
00062 }
00063 
00064 bool Holiday::operator>( const Holiday &rhs ) const
00065 {
00066   return d->mObservedDate > rhs.d->mObservedDate;
00067 }
00068 
00069 QDate Holiday::date() const
00070 {
00071   return d->mObservedDate;
00072 }
00073 
00074 QDate Holiday::observedStartDate() const
00075 {
00076   return d->mObservedDate;
00077 }
00078 
00079 QDate Holiday::observedEndDate() const
00080 {
00081   return d->mObservedDate.addDays( d->mDuration - 1 );
00082 }
00083 
00084 int Holiday::duration() const
00085 {
00086   return d->mDuration;
00087 }
00088 
00089 QString Holiday::text() const
00090 {
00091   return d->mText;
00092 }
00093 
00094 QString Holiday::shortText() const
00095 {
00096   return d->mShortText;
00097 }
00098 
00099 Holiday::DayType Holiday::dayType() const
00100 {
00101   return d->mDayType;
00102 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:24:21 by doxygen 1.7.5 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.8.5 API Reference

Skip menu "kdepimlibs-4.8.5 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