kstars
timezonerule.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef TIMEZONERULE_H
00019 #define TIMEZONERULE_H
00020
00053 #include <qstring.h>
00054 #include "kstarsdatetime.h"
00055
00056 class TimeZoneRule {
00057 public:
00059 TimeZoneRule();
00060
00070 TimeZoneRule( const QString &smonth, const QString &sday, const QTime &stime,
00071 const QString &rmonth, const QString &rday, const QTime &rtime, const double &offset=1.00 );
00072
00074 ~TimeZoneRule();
00075
00079 bool isDSTActive( const KStarsDateTime &date );
00080
00082 bool isEmptyRule() { return ( HourOffset == 0.0 ); }
00083
00087 void setDST( bool activate=true );
00088
00091 double deltaTZ() const { return dTZ; }
00092
00102 void reset_with_ltime( KStarsDateTime <ime, const double TZoffset, const bool time_runs_forward,
00103 const bool automaticDSTchange = false );
00104
00107 KStarsDateTime nextDSTChange() { return next_change_utc; }
00108
00111 KStarsDateTime nextDSTChange_LTime() { return next_change_ltime; }
00112
00116 bool equals( TimeZoneRule *r );
00117
00118 int StartMonth, RevertMonth;
00119
00120 private:
00121
00124 void nextDSTChange_LTime( const KStarsDateTime &date );
00125
00129 void previousDSTChange_LTime( const KStarsDateTime &date );
00130
00132 void nextDSTChange( const KStarsDateTime &local_date, const double TZoffset );
00133
00135 void previousDSTChange( const KStarsDateTime &local_date, const double TZoffset );
00136
00140 int initMonth( const QString &m );
00141
00149 bool initDay( const QString &d, int &day, int &week );
00150
00155 int findStartDay( const KStarsDateTime &d );
00156
00161 int findRevertDay( const KStarsDateTime &d );
00162
00163 int StartDay, RevertDay;
00164 int StartWeek, RevertWeek;
00165 QTime StartTime, RevertTime;
00166 KStarsDateTime next_change_utc, next_change_ltime;
00167 double dTZ, HourOffset;
00168
00169 };
00170
00171 #endif