author | zecke <zecke> | 2002-09-21 11:06:13 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-21 11:06:13 (UTC) |
commit | 90b5f15ac863d5eb833d2d9e832b43d05c4079a4 (patch) (side-by-side diff) | |
tree | 7ef87033f2e204d29090f0fe40b9ae0c296a1b5f | |
parent | 51f94f502b2b9a92d562a3ad726ad58372860c5e (diff) | |
download | opie-90b5f15ac863d5eb833d2d9e832b43d05c4079a4.zip opie-90b5f15ac863d5eb833d2d9e832b43d05c4079a4.tar.gz opie-90b5f15ac863d5eb833d2d9e832b43d05c4079a4.tar.bz2 |
Make end inline again
-rw-r--r-- | library/backend/event.cpp | 5 | ||||
-rw-r--r-- | library/backend/event.h | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/library/backend/event.cpp b/library/backend/event.cpp index 8f3f780..7cac314 100644 --- a/library/backend/event.cpp +++ b/library/backend/event.cpp @@ -204,789 +204,792 @@ Qtopia::UidGen Event::sUidGen( Qtopia::UidGen::Qtopia ); /*! \fn int Event::alarmDelay() const Returns the delay in minutes between the alarm for an event and the start of the event. */ /*! \fn Event::RepeatType Event::repeatType() const Returns the repeat pattern type for the event. \sa frequency() */ /*! \fn int Event::weekOffset() const Returns the number of weeks from the start of the month that this event occurs. */ /*! \fn QDate Event::repeatTill() const Returns the date that the event will continue to repeat until. If the event repeats forever the value returned is undefined. \sa repeatForever() */ /*! \fn bool Event::repeatForever() const Returns FALSE if there is a date set for the event to continue until. Otherwise returns TRUE. */ /*! \fn bool Event::doRepeat() const \internal */ /*! \fn bool Event::repeatOnWeekDay(int day) const Returns TRUE if the event has a RepeatType of Weekly and is set to occur on \a day each week. Otherwise returns FALSE. \sa QDate::dayName() */ /*! \fn void Event::setRepeatOnWeekDay(int day, bool enable) If \a enable is TRUE then sets the event to occur on \a day each week. Otherwise sets the event not to occur on \a day. \warning this function is only relavent for a event with RepeatType of Weekly. \sa QDate::dayName() */ /*! \fn int Event::frequency() const Returns how often the event repeats. \sa repeatType() */ /*! \fn void Event::setRepeatType(RepeatType t) Sets the repeat pattern type of the event to \a t. \sa setFrequency() */ /*! \fn void Event::setFrequency(int n) Sets how often the event occurs with in its repeat pattern. \sa setRepeatType() */ /*! \fn void Event::setRepeatTill(const QDate &d) Sets the event to repeat until \a d. */ /*! \fn void Event::setRepeatForever(bool enable) If \a enable is TRUE, sets the event to repeat forever. Otherwise sets the event to stop repeating at some date. \warning This function may affect the specific date the event will repeat till. */ /*! \fn bool Event::match(const QRegExp &r) const Returns TRUE if the event matches the regular expression \a r. Otherwise returns FALSE. */ /*! \fn char Event::day(int) \internal */ /*! Creates a new, empty event. */ Event::Event() : Record() { startUTC = endUTC = time( 0 ); typ = Normal; hAlarm = FALSE; hRepeat = FALSE; aMinutes = 0; aSound = Silent; pattern.type = NoRepeat; pattern.frequency = -1; } /*! \internal */ Event::Event( const QMap<int, QString> &map ) { setDescription( map[DatebookDescription] ); setLocation( map[Location] ); setCategories( idsFromString( map[DatebookCategory] ) ); setTimeZone( map[TimeZone] ); setNotes( map[Note] ); setStart( TimeConversion::fromUTC( map[StartDateTime].toUInt() ) ); setEnd( TimeConversion::fromUTC( map[EndDateTime].toUInt() ) ); setType( (Event::Type) map[DatebookType].toInt() ); setAlarm( ( map[HasAlarm] == "1" ? TRUE : FALSE ), map[AlarmTime].toInt(), (Event::SoundTypeChoice)map[SoundType].toInt() ); Event::RepeatPattern p; p.type = (Event::RepeatType) map[ RepeatPatternType ].toInt(); p.frequency = map[ RepeatPatternFrequency ].toInt(); p.position = map[ RepeatPatternPosition ].toInt(); p.days = map[ RepeatPatternDays ].toInt(); p.hasEndDate = map[ RepeatPatternHasEndDate ].toInt(); p.endDateUTC = map[ RepeatPatternEndDate ].toUInt(); setRepeat( p ); setUid( map[ DatebookUid ].toInt() ); } /*! Destroys an event. */ Event::~Event() { } /*! \internal */ int Event::week( const QDate& date ) { // Calculates the week this date is in within that // month. Equals the "row" is is in in the month view int week = 1; QDate tmp( date.year(), date.month(), 1 ); if ( date.dayOfWeek() < tmp.dayOfWeek() ) ++week; week += ( date.day() - 1 ) / 7; return week; } /*! \internal */ int Event::occurrence( const QDate& date ) { // calculates the number of occurrances of this day of the // week till the given date (e.g 3rd Wednesday of the month) return ( date.day() - 1 ) / 7 + 1; } /*! \internal */ int Event::dayOfWeek( char day ) { int dayOfWeek = 1; char i = Event::MON; while ( !( i & day ) && i <= Event::SUN ) { i <<= 1; ++dayOfWeek; } return dayOfWeek; } /*! \internal */ int Event::monthDiff( const QDate& first, const QDate& second ) { return ( second.year() - first.year() ) * 12 + second.month() - first.month(); } /*! \internal */ QMap<int, QString> Event::toMap() const { QMap<int, QString> m; if ( !description().isEmpty() ) m.insert( DatebookDescription, description() ); if ( !location().isEmpty() ) m.insert ( Location, location() ); if ( categories().count() ) m.insert ( DatebookCategory, idsToString( categories() ) ); if ( !timeZone().isEmpty() ) m.insert ( TimeZone, timeZone() ); if ( !notes().isEmpty() ) m.insert ( Note, notes() ); m.insert ( StartDateTime, QString::number( TimeConversion::toUTC( start() ) ) ); m.insert ( EndDateTime, QString::number( TimeConversion::toUTC( end() ) ) ); m.insert ( DatebookType, QString::number( (int)type() ) ); m.insert ( HasAlarm, ( hasAlarm() ? "1" : "0" ) ); m.insert ( SoundType, QString::number( (int)alarmSound() ) ); m.insert ( AlarmTime, QString::number( alarmTime() ) ); m.insert ( RepeatPatternType, QString::number( static_cast<int>( repeatPattern().type ) ) ); m.insert ( RepeatPatternFrequency, QString::number( repeatPattern().frequency ) ); m.insert ( RepeatPatternPosition, QString::number( repeatPattern().position ) ); m.insert ( RepeatPatternDays, QString::number( repeatPattern().days ) ); m.insert ( RepeatPatternHasEndDate, QString::number( static_cast<int>( repeatPattern().hasEndDate ) ) ); m.insert ( RepeatPatternEndDate, QString::number( repeatPattern().endDateUTC ) ); m.insert( DatebookUid, QString::number( uid()) ); return m; } /*! \internal */ void Event::setRepeat( const RepeatPattern &p ) { setRepeat( p.type != NoRepeat, p ); } /*! Sets the description of the event to \a s. */ void Event::setDescription( const QString &s ) { descript = s; } /*! Sets the location of the event to \a s. */ void Event::setLocation( const QString &s ) { locat = s; } // void Event::setCategory( const QString &s ) // { // categ = s; // } /*! \internal */ void Event::setType( Type t ) { typ = t; } /*! Sets the start date and time of the first or only occurance of this event to the date and time \a d. \a d should be in local time. */ void Event::setStart( const QDateTime &d ) { startUTC = TimeConversion::toUTC( d ); } /*! \internal */ void Event::setStart( time_t time ) { startUTC = time; } /*! Sets the end date and time of the first or only occurance of this event to the date and time \a d. \a d should be in local time. */ void Event::setEnd( const QDateTime &d ) { endUTC = TimeConversion::toUTC( d ); } /*! \internal */ void Event::setEnd( time_t time ) { endUTC = time; } /*! \internal */ void Event::setTimeZone( const QString &z ) { tz = z; } /*! \internal */ void Event::setAlarm( bool b, int minutes, SoundTypeChoice s ) { hAlarm = b; aMinutes = minutes; aSound = s; } /*! \internal */ void Event::setRepeat( bool b, const RepeatPattern &p ) { hRepeat = b; pattern = p; } /*! Sets the notes for the event to \a n. */ void Event::setNotes( const QString &n ) { note = n; } /*! Returns the description of the event. */ const QString &Event::description() const { return descript; } /*! Returns the location of the event. */ const QString &Event::location() const { return locat; } // QString Event::category() const // { // return categ; // } /*! \internal */ Event::Type Event::type() const { return typ; } +/* QDateTime Event::start() const { return start( TRUE ); } +*/ /*! \internal */ QDateTime Event::start( bool actual ) const { QDateTime dt = (startUTC > 0) ? TimeConversion::fromUTC( startUTC ) : QDateTime::currentDateTime(); if ( actual && typ == AllDay ) { QTime t = dt.time(); t.setHMS( 0, 0, 0 ); dt.setTime( t ); } return dt; } - +/* QDateTime Event::end() const { return end( TRUE ); } +*/ /*! \internal */ QDateTime Event::end( bool actual ) const { QDateTime dt = (endUTC > 0) ? TimeConversion::fromUTC( endUTC ) : QDateTime::currentDateTime(); if ( actual && typ == AllDay ) { QTime t = dt.time(); t.setHMS( 23, 59, 59 ); dt.setTime( t ); } return dt; } /*! \internal */ const QString &Event::timeZone() const { return tz; } /*! \internal */ bool Event::hasAlarm() const { return hAlarm; } /*! \internal */ int Event::alarmTime() const { return aMinutes; } /*! Returns the sound type for the alarm of this event. */ Event::SoundTypeChoice Event::alarmSound() const { return aSound; } /*! \internal */ bool Event::hasRepeat() const { return doRepeat(); } /*! \internal */ const Event::RepeatPattern &Event::repeatPattern() const { return pattern; } /*! \internal */ Event::RepeatPattern &Event::repeatPattern() { return pattern; } /*! Returns the notes for the event. */ const QString &Event::notes() const { return note; } /*! \internal */ bool Event::operator==( const Event &e ) const { if ( uid() && e.uid() == uid() ) return TRUE; return ( e.descript == descript && e.locat == locat && e.categ == categ && e.typ == typ && e.startUTC == startUTC && e.endUTC == endUTC && e.tz == tz && e.hAlarm == hAlarm && e.aMinutes == aMinutes && e.aSound == aSound && e.hRepeat == hRepeat && e.pattern == pattern && e.note == note ); } /*! \internal Appends the contact information to \a buf. */ void Event::save( QString& buf ) { buf += " description=\"" + Qtopia::escapeString(descript) + "\""; if ( !locat.isEmpty() ) buf += " location=\"" + Qtopia::escapeString(locat) + "\""; // save the categoies differently.... QString strCats = idsToString( categories() ); buf += " categories=\"" + Qtopia::escapeString(strCats) + "\""; buf += " uid=\"" + QString::number( uid() ) + "\""; if ( (Type)typ != Normal ) buf += " type=\"AllDay\""; if ( hAlarm ) { buf += " alarm=\"" + QString::number( aMinutes ) + "\" sound=\""; if ( aSound == Event::Loud ) buf += "loud"; else buf += "silent"; buf += "\""; } if ( hRepeat ) write( buf, pattern ); buf += " start=\"" + QString::number( startUTC ) + "\""; buf += " end=\"" + QString::number( endUTC ) + "\""; if ( !note.isEmpty() ) buf += " note=\"" + Qtopia::escapeString( note ) + "\""; buf += customToXml(); } /*! \internal */ bool Event::RepeatPattern::operator==( const Event::RepeatPattern &right ) const { // *sigh* return ( type == right.type && frequency == right.frequency && position == right.position && days == right.days && hasEndDate == right.hasEndDate && endDateUTC == right.endDateUTC && createTime == right.createTime ); } /*! \class EffectiveEvent \brief The EffectiveEvent class the data for a single occurance of an event. This class describes the event for a single occurance of it. For example if an Event occurs every week, the effective event might represent the third occurance of this Event. \ingroup qtopiaemb \ingroup qtopiadesktop \warning This class will be phased out in Qtopia 3.x */ /*! \enum EffectiveEvent::Position \internal */ /*! \fn EffectiveEvent &EffectiveEvent::operator=(const EffectiveEvent &) \internal */ class EffectiveEventPrivate { public: //currently the existence of the d pointer means multi-day repeating, //msut be changed if we use the d pointer for anything else. QDate startDate; QDate endDate; }; /*! \internal */ EffectiveEvent::EffectiveEvent() { mDate = QDate::currentDate(); mStart = mEnd = QTime::currentTime(); d = 0; } /*! \internal */ EffectiveEvent::EffectiveEvent( const Event &e, const QDate &date, Position pos ) { mEvent = e; mDate = date; if ( pos & Start ) mStart = e.start( TRUE ).time(); else mStart = QTime( 0, 0, 0 ); if ( pos & End ) mEnd = e.end( TRUE ).time(); else mEnd = QTime( 23, 59, 59 ); d = 0; } /*! \internal */ EffectiveEvent::~EffectiveEvent() { delete d; } /*! \internal */ EffectiveEvent::EffectiveEvent( const EffectiveEvent &e ) { d = 0; *this = e; } EffectiveEvent& EffectiveEvent::operator=( const EffectiveEvent & e ) { if ( &e == this ) return *this; delete d; if ( e.d ) { d = new EffectiveEventPrivate; d->startDate = e.d->startDate; d->endDate = e.d->endDate; } else { d = 0; } mEvent = e.mEvent; mDate = e.mDate; mStart = e.mStart; mEnd = e.mEnd; return *this; } // QString EffectiveEvent::category() const // { // return mEvent.category(); // } /*! Returns the description of the event for this effective event. */ const QString &EffectiveEvent::description( ) const { return mEvent.description(); } /*! \internal */ const QString &EffectiveEvent::location( ) const { return mEvent.location(); } /*! \internal */ const QString &EffectiveEvent::notes() const { return mEvent.notes(); } /*! Returns the event associated with this effective event. */ const Event &EffectiveEvent::event() const { return mEvent; } /*! \internal */ const QTime &EffectiveEvent::end() const { return mEnd; } /*! \internal */ const QTime &EffectiveEvent::start() const { return mStart; } /*! Returns the date the effective event occurs on. */ const QDate &EffectiveEvent::date() const { return mDate; } /*! \internal */ int EffectiveEvent::length() const { return (mEnd.hour() * 60 - mStart.hour() * 60) + QABS(mStart.minute() - mEnd.minute() ); } /*! \internal */ void EffectiveEvent::setDate( const QDate &dt ) { mDate = dt; } /*! \internal */ void EffectiveEvent::setStart( const QTime &start ) { mStart = start; } /*! \internal */ void EffectiveEvent::setEnd( const QTime &end ) { mEnd = end; } /*! \internal */ void EffectiveEvent::setEvent( Event e ) { mEvent = e; } /*! \internal */ bool EffectiveEvent::operator<( const EffectiveEvent &e ) const { if ( mDate < e.date() ) return TRUE; if ( mDate == e.date() ) return ( mStart < e.start() ); else return FALSE; } /*! \internal */ bool EffectiveEvent::operator<=( const EffectiveEvent &e ) const { return (mDate <= e.date() ); } /*! \internal */ bool EffectiveEvent::operator==( const EffectiveEvent &e ) const { return ( mDate == e.date() && mStart == e.start() diff --git a/library/backend/event.h b/library/backend/event.h index 2b275a4..4610d85 100644 --- a/library/backend/event.h +++ b/library/backend/event.h @@ -1,375 +1,375 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef __EVENT_H__ #define __EVENT_H__ #include <qdatetime.h> #include <qvaluelist.h> #include <qcolor.h> #ifdef PALMTOPCENTER #include <qpc/qsorter.h> #endif #include <qtopia/private/palmtoprecord.h> #include <qpe/timeconversion.h> static const QColor colorNormal = QColor(255, 0 , 0 ); static const QColor colorRepeat = QColor(0 , 0 , 255); static const QColor colorNormalLight = QColor(255, 220, 220); static const QColor colorRepeatLight = QColor(200, 200, 255); class EventPrivate; class QPC_EXPORT Event : public Qtopia::Record { public: enum RepeatType { NoRepeat = -1, Daily, Weekly, MonthlyDay, MonthlyDate, Yearly }; // Don't use this. enum Days { MON = 0x01, TUE = 0x02, WED = 0x04, THU = 0x08, FRI = 0x10, SAT = 0x20, SUN = 0x40 }; // Don't use this. struct QPC_EXPORT RepeatPattern { RepeatPattern() { type = NoRepeat; frequency = -1; days = 0; position = 0; createTime = -1; hasEndDate = FALSE; endDateUTC = 0; } bool operator ==( const RepeatPattern &right ) const; RepeatType type; int frequency; int position; // the posistion in the month (e.g. the first sunday, etc) positive, count from the front negative count from the end... char days; // a mask for days OR in your days! bool hasEndDate; QDate endDate() const { return TimeConversion::fromUTC( endDateUTC ).date(); } void setEndDate( const QDate &dt ) { endDateUTC = TimeConversion::toUTC( dt ); } time_t endDateUTC; time_t createTime; }; Event(); Event( const QMap<int, QString > & map ); virtual ~Event(); QMap<int, QString> toMap() const; static void writeVCalendar( const QString &filename, const QValueList<Event> &events); static void writeVCalendar( const QString &filename, const Event &event); static QValueList<Event> readVCalendar( const QString &filename ); enum Type { Normal, AllDay }; enum SoundTypeChoice { Silent, Loud }; // Don't use these, there are essentially meaningless. bool operator<( const Event &e1) const { return start() < e1.start(); }; bool operator<=( const Event &e1 ) const { return start() <= e1.start(); }; bool operator!=( const Event &e1 ) const { return !( *this == e1 ); }; bool operator>( const Event &e1 ) const { return start() > e1.start(); }; bool operator>=(const Event &e1 ) const { return start() >= e1.start(); }; bool operator==( const Event &e ) const; void setDescription( const QString &s ); const QString &description() const; void setLocation( const QString &s ); const QString &location() const; void setNotes( const QString &n ); const QString ¬es() const; void setType( Type t ); // Don't use me. Type type() const; // Don't use me. void setAllDay(bool); bool isAllDay() const; void setStart( const QDateTime &d ); void setStart( time_t time ); // don't use me. QDateTime start( ) const; QDateTime start( bool actual ) const; // don't use me. time_t startTime() const { return startUTC; } // don't use me. void setEnd( const QDateTime &e ); void setEnd( time_t time ); // don't use me QDateTime end( ) const; QDateTime end( bool actual ) const; // don't use me. time_t endTime() const { return endUTC; } // don't use me. void setTimeZone( const QString & ); const QString &timeZone() const; void setAlarm( int minutes, SoundTypeChoice ); void clearAlarm(); void setAlarm( bool b, int minutes, SoundTypeChoice ); // Don't use me. bool hasAlarm() const; int alarmDelay() const; int alarmTime() const; // Don't use me. SoundTypeChoice alarmSound() const; RepeatType repeatType() const; int frequency() const; int weekOffset() const; QDate repeatTill() const; bool repeatForever() const; bool repeatOnWeekDay(int day) const; void setRepeatType(RepeatType); void setFrequency(int); void setRepeatTill(const QDate &); void setRepeatForever(bool); void setRepeatOnWeekDay(int day, bool enable); // Don't use any of these. void setRepeat( bool b, const RepeatPattern &p ); void setRepeat( const RepeatPattern &p ); bool hasRepeat() const; const RepeatPattern &repeatPattern() const; RepeatPattern &repeatPattern(); bool doRepeat() const { return pattern.type != NoRepeat; } void save( QString& buf ); //void load( Node *n ); bool match( const QRegExp &r ) const; // Don't use these either. Functionality will be moved elsewhere. // helper function to calculate the week of the given date static int week( const QDate& date ); // calculates the number of occurrences of the week day of // the given date from the start of the month static int occurrence( const QDate& date ); // returns a proper days-char for a given dayOfWeek() static char day( int dayOfWeek ) { return 1 << ( dayOfWeek - 1 ); } // returns the dayOfWeek for the *first* day it finds (ignores // any further days!). Returns 1 (Monday) if there isn't any day found static int dayOfWeek( char day ); // returns the difference of months from first to second. static int monthDiff( const QDate& first, const QDate& second ); private: Qtopia::UidGen &uidGen() { return sUidGen; } static Qtopia::UidGen sUidGen; QString descript, locat, categ; Type typ : 4; bool startTimeDirty : 1; bool endTimeDirty : 1; time_t startUTC, endUTC; QString tz; bool hAlarm, hRepeat; int aMinutes; SoundTypeChoice aSound; RepeatPattern pattern; QString note; // ADDITION int mRid; // Recode ID int mRinfo; // Recode Info // EventPrivate *d; }; // Since an event spans multiple day, it is better to have this // class to represent a day instead of creating many // dummy events... class EffectiveEventPrivate; class QPC_EXPORT EffectiveEvent { public: // If we calculate the effective event of a multi-day event // we have to figure out whether we are at the first day, // at the end, or anywhere else ("middle"). This is important // for the start/end times (00:00/23:59) // MidWay: 00:00 -> 23:59, as we are "in the middle" of a multi- // day event // Start: start time -> 23:59 // End: 00:00 -> end time // Start | End == StartEnd: for single-day events (default) // here we draw start time -> end time enum Position { MidWay = 0, Start = 1, End = 2, StartEnd = 3 }; EffectiveEvent(); EffectiveEvent( const Event &event, const QDate &startDate, Position pos = StartEnd ); EffectiveEvent( const EffectiveEvent & ); EffectiveEvent& operator=( const EffectiveEvent & ); ~EffectiveEvent(); bool operator<( const EffectiveEvent &e ) const; bool operator<=( const EffectiveEvent &e ) const; bool operator==( const EffectiveEvent &e ) const; bool operator!=( const EffectiveEvent &e ) const; bool operator>( const EffectiveEvent &e ) const; bool operator>= ( const EffectiveEvent &e ) const; void setStart( const QTime &start ); void setEnd( const QTime &end ); void setEvent( Event e ); void setDate( const QDate &date ); void setEffectiveDates( const QDate &from, const QDate &to ); // QString category() const; const QString &description() const; const QString &location() const; const QString ¬es() const; const Event &event() const; const QTime &start() const; const QTime &end() const; const QDate &date() const; int length() const; int size() const; QDate startDate() const; QDate endDate() const; private: class EffectiveEventPrivate *d; Event mEvent; QDate mDate; QTime mStart, mEnd; }; inline void Event::setAlarm( int minutes, SoundTypeChoice s ) { setAlarm(TRUE, minutes, s); } inline void Event::clearAlarm() { setAlarm(FALSE, 0, Silent); } inline int Event::alarmDelay() const { return alarmTime(); } inline void Event::setAllDay(bool enable) { if (enable) setType(AllDay); else setType(Normal); }; inline bool Event::isAllDay() const { return type() == AllDay; } inline Event::RepeatType Event::repeatType() const { return repeatPattern().type; } inline int Event::frequency() const { return repeatPattern().frequency; } inline int Event::weekOffset() const { if (start().date().day() == 1) return 1; return (start().date().day() - 1) / 7 + 1; } inline QDate Event::repeatTill() const { return repeatPattern().endDate(); } inline bool Event::repeatForever() const { return !repeatPattern().hasEndDate; } inline void Event::setRepeatType(RepeatType t) { pattern.type = t; } inline void Event::setFrequency(int f) { pattern.frequency = f; } inline void Event::setRepeatTill(const QDate &d) { pattern.setEndDate(d); pattern.hasEndDate = TRUE; } inline void Event::setRepeatForever(bool b) { if (!b == pattern.hasEndDate) return; if (!b && !pattern.hasEndDate) pattern.setEndDate(end().date()); pattern.hasEndDate = !b; } inline bool Event::repeatOnWeekDay(int day) const { if (pattern.type != Weekly) return FALSE; return ( (1 << (day - 1)) & pattern.days ) != 0; } inline void Event::setRepeatOnWeekDay(int day, bool enable) { if ( repeatOnWeekDay( day ) != enable ) pattern.days ^= 1 << (day - 1); } -/* + inline QDateTime Event::start( ) const { return start(FALSE); } inline QDateTime Event::end( ) const { return end(FALSE); } -*/ + #ifdef PALMTOPCENTER class QPC_EXPORT EffectiveEventSizeSorter : public QSorter<EffectiveEvent> { public: int compare( const EffectiveEvent& a, const EffectiveEvent& b ) const { return a.size() - b.size(); } }; class QPC_EXPORT EffectiveEventTimeSorter : public QSorter<EffectiveEvent> { public: int compare( const EffectiveEvent& a, const EffectiveEvent& b ) const { return a.start().secsTo( b.start() ); } }; #endif #endif |