summaryrefslogtreecommitdiffstats
path: root/libkcal/recurrencerule.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /libkcal/recurrencerule.h
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkcal/recurrencerule.h')
-rw-r--r--libkcal/recurrencerule.h118
1 files changed, 59 insertions, 59 deletions
diff --git a/libkcal/recurrencerule.h b/libkcal/recurrencerule.h
index ad72f2561..049d9c523 100644
--- a/libkcal/recurrencerule.h
+++ b/libkcal/recurrencerule.h
@@ -24,19 +24,19 @@
#ifndef KCAL_RECURRENCERULE_H
#define KCAL_RECURRENCERULE_H
-#include <qdatetime.h>
+#include <tqdatetime.h>
#include <libkcal/listbase.h>
#include "libkcal_export.h"
template <class T>
-Q_INLINE_TEMPLATES void qSortUnique( QValueList<T> &lst )
+Q_INLINE_TEMPLATES void qSortUnique( TQValueList<T> &lst )
{
qHeapSort( lst );
if ( lst.isEmpty() ) return;
// Remove all duplicates from the times list
// TODO: Make this more efficient!
- QValueListIterator<T> it = lst.begin();
+ TQValueListIterator<T> it = lst.begin();
T last = *it;
++it;
T newlast;
@@ -53,9 +53,9 @@ Q_INLINE_TEMPLATES void qSortUnique( QValueList<T> &lst )
namespace KCal {
-typedef QValueList<QDateTime> DateTimeList;
-typedef QValueList<QDate> DateList;
-typedef QValueList<QTime> TimeList;
+typedef TQValueList<TQDateTime> DateTimeList;
+typedef TQValueList<TQDate> DateList;
+typedef TQValueList<TQTime> TimeList;
@@ -129,9 +129,9 @@ class LIBKCAL_EXPORT RecurrenceRule
/** Return the start of the recurrence */
- QDateTime startDt() const { return mDateStart; }
+ TQDateTime startDt() const { return mDateStart; }
/** Set start of recurrence, as a date and time. */
- void setStartDt(const QDateTime &start);
+ void setStartDt(const TQDateTime &start);
/** Returns whether the start date has no time associated. Floating
means -- according to rfc2445 -- that the event has no time associate. */
@@ -145,10 +145,10 @@ class LIBKCAL_EXPORT RecurrenceRule
* @param result if non-null, *result is updated to true if successful,
* or false if there is no recurrence.
*/
- QDateTime endDt( bool* result = 0 ) const;
+ TQDateTime endDt( bool* result = 0 ) const;
/** Sets the date and time of the last recurrence.
* @param endDateTime the ending date/time after which to stop recurring. */
- void setEndDt(const QDateTime &endDateTime);
+ void setEndDt(const TQDateTime &endDateTime);
/**
@@ -160,33 +160,33 @@ class LIBKCAL_EXPORT RecurrenceRule
* first and last. */
void setDuration(int duration);
// /** Returns the number of recurrences up to and including the date specified. */
-// int durationTo(const QDate &) const;
+// int durationTo(const TQDate &) const;
/** Returns the number of recurrences up to and including the date/time specified. */
- int durationTo(const QDateTime &) const;
+ int durationTo(const TQDateTime &) const;
/** Returns the number of recurrences up to and including the date specified. */
- int durationTo( const QDate &date ) const { return durationTo( QDateTime( date, QTime( 23, 59, 59 ) ) ); }
+ int durationTo( const TQDate &date ) const { return durationTo( TQDateTime( date, TQTime( 23, 59, 59 ) ) ); }
/** Returns true if the date specified is one on which the event will
* recur. The start date returns true only if it actually matches the rule. */
- bool recursOn( const QDate &qd ) const;
+ bool recursOn( const TQDate &qd ) const;
/** Returns true if the date/time specified is one at which the event will
* recur. Times are rounded down to the nearest minute to determine the result.
* The start date/time returns true only if it actually matches the rule. */
- bool recursAt( const QDateTime & ) const;
+ bool recursAt( const TQDateTime & ) const;
/** Returns true if the date matches the rules. It does not necessarily
mean that this is an actual occurrence. In particular, the method does
not check if the date is after the end date, or if the frequency interval
matches */
- bool dateMatchesRules( const QDateTime &qdt ) const;
+ bool dateMatchesRules( const TQDateTime &qdt ) const;
/** Returns a list of the times on the specified date at which the
* recurrence will occur.
* @param date the date for which to find the recurrence times.
*/
- TimeList recurTimesOn( const QDate &date ) const;
+ TimeList recurTimesOn( const TQDate &date ) const;
/** Returns the date and time of the next recurrence, after the specified date/time.
@@ -194,40 +194,40 @@ class LIBKCAL_EXPORT RecurrenceRule
* @param preDateTime the date/time after which to find the recurrence.
* @return date/time of next recurrence, or invalid date if none.
*/
- QDateTime getNextDate( const QDateTime& preDateTime ) const;
+ TQDateTime getNextDate( const TQDateTime& preDateTime ) const;
/** Returns the date and time of the last previous recurrence, before the specified date/time.
* If a time later than 00:00:00 is specified and the recurrence has no time, 00:00:00 on
* the specified date is returned if that date recurs.
* @param afterDateTime the date/time before which to find the recurrence.
* @return date/time of previous recurrence, or invalid date if none.
*/
- QDateTime getPreviousDate( const QDateTime& afterDateTime ) const;
+ TQDateTime getPreviousDate( const TQDateTime& afterDateTime ) const;
- void setBySeconds( const QValueList<int> bySeconds );
- void setByMinutes( const QValueList<int> byMinutes );
- void setByHours( const QValueList<int> byHours );
+ void setBySeconds( const TQValueList<int> bySeconds );
+ void setByMinutes( const TQValueList<int> byMinutes );
+ void setByHours( const TQValueList<int> byHours );
- void setByDays( const QValueList<WDayPos> byDays );
- void setByMonthDays( const QValueList<int> byMonthDays );
- void setByYearDays( const QValueList<int> byYearDays );
- void setByWeekNumbers( const QValueList<int> byWeekNumbers );
- void setByMonths( const QValueList<int> byMonths );
- void setBySetPos( const QValueList<int> bySetPos );
+ void setByDays( const TQValueList<WDayPos> byDays );
+ void setByMonthDays( const TQValueList<int> byMonthDays );
+ void setByYearDays( const TQValueList<int> byYearDays );
+ void setByWeekNumbers( const TQValueList<int> byWeekNumbers );
+ void setByMonths( const TQValueList<int> byMonths );
+ void setBySetPos( const TQValueList<int> bySetPos );
void setWeekStart( short weekStart );
- const QValueList<int> &bySeconds() const { return mBySeconds; }
- const QValueList<int> &byMinutes() const { return mByMinutes; }
- const QValueList<int> &byHours() const { return mByHours; }
+ const TQValueList<int> &bySeconds() const { return mBySeconds; }
+ const TQValueList<int> &byMinutes() const { return mByMinutes; }
+ const TQValueList<int> &byHours() const { return mByHours; }
- const QValueList<WDayPos> &byDays() const { return mByDays; }
- const QValueList<int> &byMonthDays() const { return mByMonthDays; }
- const QValueList<int> &byYearDays() const { return mByYearDays; }
- const QValueList<int> &byWeekNumbers() const { return mByWeekNumbers; }
- const QValueList<int> &byMonths() const { return mByMonths; }
- const QValueList<int> &bySetPos() const { return mBySetPos; }
+ const TQValueList<WDayPos> &byDays() const { return mByDays; }
+ const TQValueList<int> &byMonthDays() const { return mByMonthDays; }
+ const TQValueList<int> &byYearDays() const { return mByYearDays; }
+ const TQValueList<int> &byWeekNumbers() const { return mByWeekNumbers; }
+ const TQValueList<int> &byMonths() const { return mByMonths; }
+ const TQValueList<int> &bySetPos() const { return mBySetPos; }
short weekStart() const { return mWeekStart; }
@@ -252,12 +252,12 @@ class LIBKCAL_EXPORT RecurrenceRule
Debug output.
*/
void dump() const;
- QString mRRule;
+ TQString mRRule;
private:
class Constraint {
public:
- typedef QValueList<Constraint> List;
+ typedef TQValueList<Constraint> List;
Constraint( int wkst = 1 );
/* Constraint( const Constraint &con ) :
@@ -265,7 +265,7 @@ class LIBKCAL_EXPORT RecurrenceRule
hour(con.hour), minute(con.minute), second(con.second),
weekday(con.weekday), weeknumber(con.weeknumber),
yearday(con.yearday), weekstart(con.weekstart) {}*/
- Constraint( const QDateTime &preDate, PeriodType type, int wkst );
+ Constraint( const TQDateTime &preDate, PeriodType type, int wkst );
void clear();
int year; // 0 means unspecified
@@ -280,19 +280,19 @@ class LIBKCAL_EXPORT RecurrenceRule
int yearday; // 0 means unspecified
int weekstart; // first day of week (1=monday, 7=sunday, 0=unspec.)
- bool readDateTime( const QDateTime &preDate, PeriodType type );
- bool matches( const QDate &dt, RecurrenceRule::PeriodType type ) const;
- bool matches( const QDateTime &dt, RecurrenceRule::PeriodType type ) const;
+ bool readDateTime( const TQDateTime &preDate, PeriodType type );
+ bool matches( const TQDate &dt, RecurrenceRule::PeriodType type ) const;
+ bool matches( const TQDateTime &dt, RecurrenceRule::PeriodType type ) const;
bool isConsistent() const;
bool isConsistent( PeriodType period ) const;
bool increase( PeriodType type, int freq );
- QDateTime intervalDateTime( PeriodType type ) const;
+ TQDateTime intervalDateTime( PeriodType type ) const;
DateTimeList dateTimes( PeriodType type ) const;
void dump() const;
};
- Constraint getNextValidDateInterval( const QDateTime &preDate, PeriodType type ) const;
- Constraint getPreviousValidDateInterval( const QDateTime &preDate, PeriodType type ) const;
+ Constraint getNextValidDateInterval( const TQDateTime &preDate, PeriodType type ) const;
+ Constraint getPreviousValidDateInterval( const TQDateTime &preDate, PeriodType type ) const;
DateTimeList datesForInterval( const Constraint &interval, PeriodType type ) const;
bool mergeIntervalConstraint( Constraint *merged, const Constraint &conit,
const Constraint &interval ) const;
@@ -300,39 +300,39 @@ class LIBKCAL_EXPORT RecurrenceRule
PeriodType mPeriod;
- QDateTime mDateStart;
+ TQDateTime mDateStart;
/** how often it recurs (including dtstart):
-1 means infinitely,
0 means an explicit end date,
positive values give the number of occurrences */
int mDuration;
- QDateTime mDateEnd;
+ TQDateTime mDateEnd;
uint mFrequency;
bool mIsReadOnly;
bool mFloating;
- QValueList<int> mBySeconds; // values: second 0-59
- QValueList<int> mByMinutes; // values: minute 0-59
- QValueList<int> mByHours; // values: hour 0-23
+ TQValueList<int> mBySeconds; // values: second 0-59
+ TQValueList<int> mByMinutes; // values: minute 0-59
+ TQValueList<int> mByHours; // values: hour 0-23
- QValueList<WDayPos> mByDays; // n-th weekday of the month or year
- QValueList<int> mByMonthDays; // values: day -31 to -1 and 1-31
- QValueList<int> mByYearDays; // values: day -366 to -1 and 1-366
- QValueList<int> mByWeekNumbers; // values: week -53 to -1 and 1-53
- QValueList<int> mByMonths; // values: month 1-12
- QValueList<int> mBySetPos; // values: position -366 to -1 and 1-366
+ TQValueList<WDayPos> mByDays; // n-th weekday of the month or year
+ TQValueList<int> mByMonthDays; // values: day -31 to -1 and 1-31
+ TQValueList<int> mByYearDays; // values: day -366 to -1 and 1-366
+ TQValueList<int> mByWeekNumbers; // values: week -53 to -1 and 1-53
+ TQValueList<int> mByMonths; // values: month 1-12
+ TQValueList<int> mBySetPos; // values: position -366 to -1 and 1-366
short mWeekStart; // first day of the week (1=Monday, 7=Sunday)
Constraint::List mConstraints;
void buildConstraints();
bool mDirty;
- QValueList<Observer*> mObservers;
+ TQValueList<Observer*> mObservers;
// Cache for duration
mutable DateTimeList mCachedDates;
mutable bool mCached;
- mutable QDateTime mCachedDateEnd;
+ mutable TQDateTime mCachedDateEnd;
class Private;
Private *d;