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

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
timezonerule.h
Go to the documentation of this file.
1 /***************************************************************************
2  timezonerule.h - description
3  -------------------
4  begin : Tue Apr 2 2002
5  copyright : (C) 2002 by Jason Harris
6  email : kstars@30doradus.org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef TIMEZONERULE_H_
19 #define TIMEZONERULE_H_
20 
53 #include <QString>
54 #include "kstarsdatetime.h"
55 
56 class TimeZoneRule {
57 public:
59  TimeZoneRule();
60 
70  TimeZoneRule( const QString &smonth, const QString &sday, const QTime &stime,
71  const QString &rmonth, const QString &rday, const QTime &rtime, const double &offset=1.00 );
72 
76  bool isDSTActive( const KStarsDateTime &date );
77 
79  bool isEmptyRule() { return ( HourOffset == 0.0 ); }
80 
84  void setDST( bool activate=true );
85 
88  double deltaTZ() const { return dTZ; }
89 
99  void reset_with_ltime( KStarsDateTime &ltime, const double TZoffset, const bool time_runs_forward,
100  const bool automaticDSTchange = false );
101 
103  KStarsDateTime nextDSTChange() { return next_change_utc; }
104 
106  KStarsDateTime nextDSTChange_LTime() { return next_change_ltime; }
107 
111  bool equals( TimeZoneRule *r );
112 
113 private:
114 
117  void nextDSTChange_LTime( const KStarsDateTime &date );
118 
122  void previousDSTChange_LTime( const KStarsDateTime &date );
123 
125  void nextDSTChange( const KStarsDateTime &local_date, const double TZoffset );
126 
128  void previousDSTChange( const KStarsDateTime &local_date, const double TZoffset );
129 
133  int initMonth( const QString &m );
134 
136  void setEmpty();
137 
145  bool initDay( const QString &d, int &day, int &week );
146 
151  int findStartDay( const KStarsDateTime &d );
152 
157  int findRevertDay( const KStarsDateTime &d );
158 
159  int StartDay, RevertDay;
160  int StartMonth, RevertMonth;
161  int StartWeek , RevertWeek;
162  QTime StartTime, RevertTime;
163  KStarsDateTime next_change_utc;
164  KStarsDateTime next_change_ltime;
165  double dTZ;
166  double HourOffset;
167 };
168 
169 #endif
TimeZoneRule::deltaTZ
double deltaTZ() const
Definition: timezonerule.h:88
TimeZoneRule::setDST
void setDST(bool activate=true)
Toggle DST on/off.
Definition: timezonerule.cpp:63
TimeZoneRule::nextDSTChange_LTime
KStarsDateTime nextDSTChange_LTime()
Definition: timezonerule.h:106
TimeZoneRule
This class provides the information needed to determine whether Daylight Savings Time (DST; a...
Definition: timezonerule.h:56
TimeZoneRule::nextDSTChange
KStarsDateTime nextDSTChange()
Definition: timezonerule.h:103
KStarsDateTime
Extension of KDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day...
Definition: kstarsdatetime.h:45
TimeZoneRule::reset_with_ltime
void reset_with_ltime(KStarsDateTime &ltime, const double TZoffset, const bool time_runs_forward, const bool automaticDSTchange=false)
Recalculate next dst change and if DST is active by a given local time with timezone offset and time ...
Definition: timezonerule.cpp:301
TimeZoneRule::TimeZoneRule
TimeZoneRule()
Default Constructor.
Definition: timezonerule.cpp:25
NaN::d
const double d
Definition: nan.h:35
kstarsdatetime.h
TimeZoneRule::isEmptyRule
bool isEmptyRule()
Definition: timezonerule.h:79
TimeZoneRule::equals
bool equals(TimeZoneRule *r)
Definition: timezonerule.cpp:406
TimeZoneRule::isDSTActive
bool isDSTActive(const KStarsDateTime &date)
Determine whether DST is in effect for the given DateTime, according to this rule.
Definition: timezonerule.cpp:179
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

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