From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libkcal/recurrencerule.h | 118 +++++++++++++++++++++++------------------------ 1 file changed, 59 insertions(+), 59 deletions(-) (limited to 'libkcal/recurrencerule.h') 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 +#include #include #include "libkcal_export.h" template -Q_INLINE_TEMPLATES void qSortUnique( QValueList &lst ) +Q_INLINE_TEMPLATES void qSortUnique( TQValueList &lst ) { qHeapSort( lst ); if ( lst.isEmpty() ) return; // Remove all duplicates from the times list // TODO: Make this more efficient! - QValueListIterator it = lst.begin(); + TQValueListIterator it = lst.begin(); T last = *it; ++it; T newlast; @@ -53,9 +53,9 @@ Q_INLINE_TEMPLATES void qSortUnique( QValueList &lst ) namespace KCal { -typedef QValueList DateTimeList; -typedef QValueList DateList; -typedef QValueList TimeList; +typedef TQValueList DateTimeList; +typedef TQValueList DateList; +typedef TQValueList 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 bySeconds ); - void setByMinutes( const QValueList byMinutes ); - void setByHours( const QValueList byHours ); + void setBySeconds( const TQValueList bySeconds ); + void setByMinutes( const TQValueList byMinutes ); + void setByHours( const TQValueList byHours ); - void setByDays( const QValueList byDays ); - void setByMonthDays( const QValueList byMonthDays ); - void setByYearDays( const QValueList byYearDays ); - void setByWeekNumbers( const QValueList byWeekNumbers ); - void setByMonths( const QValueList byMonths ); - void setBySetPos( const QValueList bySetPos ); + void setByDays( const TQValueList byDays ); + void setByMonthDays( const TQValueList byMonthDays ); + void setByYearDays( const TQValueList byYearDays ); + void setByWeekNumbers( const TQValueList byWeekNumbers ); + void setByMonths( const TQValueList byMonths ); + void setBySetPos( const TQValueList bySetPos ); void setWeekStart( short weekStart ); - const QValueList &bySeconds() const { return mBySeconds; } - const QValueList &byMinutes() const { return mByMinutes; } - const QValueList &byHours() const { return mByHours; } + const TQValueList &bySeconds() const { return mBySeconds; } + const TQValueList &byMinutes() const { return mByMinutes; } + const TQValueList &byHours() const { return mByHours; } - const QValueList &byDays() const { return mByDays; } - const QValueList &byMonthDays() const { return mByMonthDays; } - const QValueList &byYearDays() const { return mByYearDays; } - const QValueList &byWeekNumbers() const { return mByWeekNumbers; } - const QValueList &byMonths() const { return mByMonths; } - const QValueList &bySetPos() const { return mBySetPos; } + const TQValueList &byDays() const { return mByDays; } + const TQValueList &byMonthDays() const { return mByMonthDays; } + const TQValueList &byYearDays() const { return mByYearDays; } + const TQValueList &byWeekNumbers() const { return mByWeekNumbers; } + const TQValueList &byMonths() const { return mByMonths; } + const TQValueList &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 List; + typedef TQValueList 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 mBySeconds; // values: second 0-59 - QValueList mByMinutes; // values: minute 0-59 - QValueList mByHours; // values: hour 0-23 + TQValueList mBySeconds; // values: second 0-59 + TQValueList mByMinutes; // values: minute 0-59 + TQValueList mByHours; // values: hour 0-23 - QValueList mByDays; // n-th weekday of the month or year - QValueList mByMonthDays; // values: day -31 to -1 and 1-31 - QValueList mByYearDays; // values: day -366 to -1 and 1-366 - QValueList mByWeekNumbers; // values: week -53 to -1 and 1-53 - QValueList mByMonths; // values: month 1-12 - QValueList mBySetPos; // values: position -366 to -1 and 1-366 + TQValueList mByDays; // n-th weekday of the month or year + TQValueList mByMonthDays; // values: day -31 to -1 and 1-31 + TQValueList mByYearDays; // values: day -366 to -1 and 1-366 + TQValueList mByWeekNumbers; // values: week -53 to -1 and 1-53 + TQValueList mByMonths; // values: month 1-12 + TQValueList 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 mObservers; + TQValueList mObservers; // Cache for duration mutable DateTimeList mCachedDates; mutable bool mCached; - mutable QDateTime mCachedDateEnd; + mutable TQDateTime mCachedDateEnd; class Private; Private *d; -- cgit v1.2.1