• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • sources
  • kde-4.14
  • kdelibs
  • kdecore
  • date
kdayperiod_p.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010 John Layt <john@layt.net>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef KDAYPERIOD_H
21 #define KDAYPERIOD_H
22 
23 #include <QtCore/QSharedDataPointer>
24 
25 #include "klocale.h"
26 #include <kdecore_export.h>
27 
28 class QDate;
29 class QString;
30 class QTime;
31 
32 class KDayPeriodPrivate;
33 
54 class KDayPeriod
55 {
56 public:
69  KDayPeriod(const QString &periodCode,
70  const QString &longName,
71  const QString &shortName,
72  const QString &narrowName,
73  const QTime &periodStart,
74  const QTime &periodEnd,
75  int offsetFromStart,
76  int offsetIfZero);
77 
81  explicit KDayPeriod();
82 
89  KDayPeriod(const KDayPeriod &rhs);
90 
94  virtual ~KDayPeriod();
95 
102  KDayPeriod& operator=(const KDayPeriod &rhs);
103 
109  QString periodCode() const;
110 
116  QTime periodStart() const;
117 
123  QTime periodEnd() const;
124 
132  QString periodName(KLocale::DateTimeComponentFormat format = KLocale::ShortName) const;
133 
142  int hourInPeriod(const QTime &time) const;
143 
155  QTime time(int hourInPeriod, int minute, int second, int millisecond = 0) const;
156 
162  bool isValid() const;
163 
169  bool isValid(const QTime &time) const;
170 
171 private:
172  QSharedDataPointer<KDayPeriodPrivate> d;
173 };
174 
175 #endif // KDAYPERIOD_H
KDayPeriod::periodName
QString periodName(KLocale::DateTimeComponentFormat format=KLocale::ShortName) const
Return translated Period Name in the required format e.g.
Definition: kdayperiod.cpp:138
KDayPeriod::operator=
KDayPeriod & operator=(const KDayPeriod &rhs)
Assignment operator.
Definition: kdayperiod.cpp:115
KDayPeriod::periodStart
QTime periodStart() const
Return the time the Period starts at.
Definition: kdayperiod.cpp:128
kdecore_export.h
KDayPeriod::time
QTime time(int hourInPeriod, int minute, int second, int millisecond=0) const
Calculate and return the 24hr time for a given hms in the Day Period.
Definition: kdayperiod.cpp:161
KDayPeriod::hourInPeriod
int hourInPeriod(const QTime &time) const
Calculate and return the hour in the Day Period for a given 24h time.
Definition: kdayperiod.cpp:149
KDayPeriod::~KDayPeriod
virtual ~KDayPeriod()
Destructor.
Definition: kdayperiod.cpp:111
klocale.h
QTime
KLocale::DateTimeComponentFormat
DateTimeComponentFormat
Definition: klocale.h:908
KDayPeriod::KDayPeriod
KDayPeriod()
Constructs a null KDayPeriod.
Definition: kdayperiod.cpp:101
QDate
QString
KLocale::ShortName
Short text format, e.g.
Definition: klocale.h:914
KDayPeriod::periodEnd
QTime periodEnd() const
Return the time the Period ends at.
Definition: kdayperiod.cpp:133
KDayPeriod
Definition: kdayperiod_p.h:54
KDayPeriod::periodCode
QString periodCode() const
Return the Period Code.
Definition: kdayperiod.cpp:123
KDayPeriod::isValid
bool isValid() const
Return if the Day Period is valid.
Definition: kdayperiod.cpp:186
QSharedDataPointer< KDayPeriodPrivate >
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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