summaryrefslogtreecommitdiffstats
path: root/kalarm/alarmevent.h
diff options
context:
space:
mode:
Diffstat (limited to 'kalarm/alarmevent.h')
-rw-r--r--kalarm/alarmevent.h164
1 files changed, 82 insertions, 82 deletions
diff --git a/kalarm/alarmevent.h b/kalarm/alarmevent.h
index ff8ab3056..91bf24289 100644
--- a/kalarm/alarmevent.h
+++ b/kalarm/alarmevent.h
@@ -23,8 +23,8 @@
/** @file alarmevent.h - represents calendar alarms and events */
-#include <qcolor.h>
-#include <qfont.h>
+#include <tqcolor.h>
+#include <tqfont.h>
#include <libkcal/person.h>
#include <libkcal/event.h>
@@ -42,13 +42,13 @@ struct AlarmData;
typedef KCal::Person EmailAddress;
-class EmailAddressList : public QValueList<KCal::Person>
+class EmailAddressList : public TQValueList<KCal::Person>
{
public:
- EmailAddressList() : QValueList<KCal::Person>() { }
- EmailAddressList(const QValueList<KCal::Person>& list) { operator=(list); }
- EmailAddressList& operator=(const QValueList<KCal::Person>&);
- QString join(const QString& separator) const;
+ EmailAddressList() : TQValueList<KCal::Person>() { }
+ EmailAddressList(const TQValueList<KCal::Person>& list) { operator=(list); }
+ EmailAddressList& operator=(const TQValueList<KCal::Person>&);
+ TQString join(const TQString& separator) const;
};
@@ -57,21 +57,21 @@ class KAAlarmEventBase
{
public:
~KAAlarmEventBase() { }
- const QString& cleanText() const { return mText; }
- QString message() const { return (mActionType == T_MESSAGE || mActionType == T_EMAIL) ? mText : QString::null; }
- QString fileName() const { return (mActionType == T_FILE) ? mText : QString::null; }
- QString command() const { return (mActionType == T_COMMAND) ? mText : QString::null; }
+ const TQString& cleanText() const { return mText; }
+ TQString message() const { return (mActionType == T_MESSAGE || mActionType == T_EMAIL) ? mText : TQString::null; }
+ TQString fileName() const { return (mActionType == T_FILE) ? mText : TQString::null; }
+ TQString command() const { return (mActionType == T_COMMAND) ? mText : TQString::null; }
uint emailFromId() const { return mEmailFromIdentity; }
const EmailAddressList& emailAddresses() const { return mEmailAddresses; }
- QString emailAddresses(const QString& sep) const { return mEmailAddresses.join(sep); }
- const QString& emailSubject() const { return mEmailSubject; }
- const QStringList& emailAttachments() const { return mEmailAttachments; }
- QString emailAttachments(const QString& sep) const { return mEmailAttachments.join(sep); }
+ TQString emailAddresses(const TQString& sep) const { return mEmailAddresses.join(sep); }
+ const TQString& emailSubject() const { return mEmailSubject; }
+ const TQStringList& emailAttachments() const { return mEmailAttachments; }
+ TQString emailAttachments(const TQString& sep) const { return mEmailAttachments.join(sep); }
bool emailBcc() const { return mEmailBcc; }
- const QColor& bgColour() const { return mBgColour; }
- const QColor& fgColour() const { return mFgColour; }
+ const TQColor& bgColour() const { return mBgColour; }
+ const TQColor& fgColour() const { return mFgColour; }
bool defaultFont() const { return mDefaultFont; }
- const QFont& font() const;
+ const TQFont& font() const;
int lateCancel() const { return mLateCancel; }
bool autoClose() const { return mAutoClose; }
bool commandScript() const { return mCommandScript; }
@@ -99,16 +99,16 @@ class KAAlarmEventBase
void copy(const KAAlarmEventBase&);
void set(int flags);
- QString mEventID; // UID: KCal::Event unique ID
- QString mText; // message text, file URL, command, email body [or audio file for KAAlarm]
+ TQString mEventID; // UID: KCal::Event unique ID
+ TQString mText; // message text, file URL, command, email body [or audio file for KAAlarm]
DateTime mNextMainDateTime; // next time to display the alarm, excluding repetitions
- QColor mBgColour; // background colour of alarm message
- QColor mFgColour; // foreground colour of alarm message, or invalid for default
- QFont mFont; // font of alarm message (ignored if mDefaultFont true)
+ TQColor mBgColour; // background colour of alarm message
+ TQColor mFgColour; // foreground colour of alarm message, or invalid for default
+ TQFont mFont; // font of alarm message (ignored if mDefaultFont true)
uint mEmailFromIdentity;// KMail identity for email 'From' field, or empty
EmailAddressList mEmailAddresses; // ATTENDEE: addresses to send email to
- QString mEmailSubject; // SUMMARY: subject line of email
- QStringList mEmailAttachments; // ATTACH: email attachment file names
+ TQString mEmailSubject; // SUMMARY: subject line of email
+ TQStringList mEmailAttachments; // ATTACH: email attachment file names
float mSoundVolume; // volume for sound file, or < 0 for unspecified
float mFadeVolume; // initial volume for sound file, or < 0 for no fade
int mFadeSeconds; // fade time for sound file, or 0 if none
@@ -194,13 +194,13 @@ class KAAlarm : public KAAlarmEventBase
bool valid() const { return mType != INVALID__ALARM; }
Type type() const { return static_cast<Type>(mType & ~TIMED_DEFERRAL_FLAG); }
SubType subType() const { return mType; }
- const QString& eventID() const { return mEventID; }
+ const TQString& eventID() const { return mEventID; }
DateTime dateTime(bool withRepeats = false) const
{ return (withRepeats && mNextRepeat && mRepeatInterval)
? mNextMainDateTime.addSecs(mNextRepeat * mRepeatInterval * 60) : mNextMainDateTime; }
- QDate date() const { return mNextMainDateTime.date(); }
- QTime time() const { return mNextMainDateTime.time(); }
- QString audioFile() const { return (mActionType == T_AUDIO) && !mBeep ? mText : QString::null; }
+ TQDate date() const { return mNextMainDateTime.date(); }
+ TQTime time() const { return mNextMainDateTime.time(); }
+ TQString audioFile() const { return (mActionType == T_AUDIO) && !mBeep ? mText : TQString::null; }
float soundVolume() const { return (mActionType == T_AUDIO) && !mBeep && !mText.isEmpty() ? mSoundVolume : -1; }
float fadeVolume() const { return (mActionType == T_AUDIO) && mSoundVolume >= 0 && mFadeSeconds && !mBeep && !mText.isEmpty() ? mFadeVolume : -1; }
int fadeSeconds() const { return (mActionType == T_AUDIO) && mSoundVolume >= 0 && mFadeVolume >= 0 && !mBeep && !mText.isEmpty() ? mFadeSeconds : 0; }
@@ -208,7 +208,7 @@ class KAAlarm : public KAAlarmEventBase
bool reminder() const { return mType == REMINDER__ALARM; }
bool deferred() const { return mDeferred; }
void setTime(const DateTime& dt) { mNextMainDateTime = dt; }
- void setTime(const QDateTime& dt) { mNextMainDateTime = dt; }
+ void setTime(const TQDateTime& dt) { mNextMainDateTime = dt; }
int flags() const;
#ifdef NDEBUG
void dumpDebug() const { }
@@ -310,36 +310,36 @@ class KAEvent : public KAAlarmEventBase
};
KAEvent() : mRevision(0), mRecurrence(0), mAlarmCount(0) { }
- KAEvent(const QDateTime& dt, const QString& message, const QColor& bg, const QColor& fg, const QFont& f, Action action, int lateCancel, int flags)
+ KAEvent(const TQDateTime& dt, const TQString& message, const TQColor& bg, const TQColor& fg, const TQFont& f, Action action, int lateCancel, int flags)
: mRecurrence(0) { set(dt, message, bg, fg, f, action, lateCancel, flags); }
explicit KAEvent(const KCal::Event& e) : mRecurrence(0) { set(e); }
KAEvent(const KAEvent& e) : KAAlarmEventBase(e), mRecurrence(0) { copy(e); }
~KAEvent() { delete mRecurrence; }
KAEvent& operator=(const KAEvent& e) { if (&e != this) copy(e); return *this; }
void set(const KCal::Event&);
- void set(const QDateTime&, const QString& message, const QColor& bg, const QColor& fg, const QFont&, Action, int lateCancel, int flags);
- void setEmail(uint from, const EmailAddressList&, const QString& subject, const QStringList& attachments);
- void setAudioFile(const QString& filename, float volume, float fadeVolume, int fadeSeconds);
- void setTemplate(const QString& name, int afterTime = -1) { mTemplateName = name; mTemplateAfterTime = afterTime; mUpdated = true; }
- void setActions(const QString& pre, const QString& post) { mPreAction = pre; mPostAction = post; mUpdated = true; }
- OccurType setNextOccurrence(const QDateTime& preDateTime);
+ void set(const TQDateTime&, const TQString& message, const TQColor& bg, const TQColor& fg, const TQFont&, Action, int lateCancel, int flags);
+ void setEmail(uint from, const EmailAddressList&, const TQString& subject, const TQStringList& attachments);
+ void setAudioFile(const TQString& filename, float volume, float fadeVolume, int fadeSeconds);
+ void setTemplate(const TQString& name, int afterTime = -1) { mTemplateName = name; mTemplateAfterTime = afterTime; mUpdated = true; }
+ void setActions(const TQString& pre, const TQString& post) { mPreAction = pre; mPostAction = post; mUpdated = true; }
+ OccurType setNextOccurrence(const TQDateTime& preDateTime);
void setFirstRecurrence();
- void setEventID(const QString& id) { mEventID = id; mUpdated = true; }
- void setDate(const QDate& d) { mNextMainDateTime.set(d); mUpdated = true; }
- void setTime(const QDateTime& dt) { mNextMainDateTime.set(dt); mUpdated = true; }
- void setSaveDateTime(const QDateTime& dt) { mSaveDateTime = dt; mUpdated = true; }
+ void setEventID(const TQString& id) { mEventID = id; mUpdated = true; }
+ void setDate(const TQDate& d) { mNextMainDateTime.set(d); mUpdated = true; }
+ void setTime(const TQDateTime& dt) { mNextMainDateTime.set(dt); mUpdated = true; }
+ void setSaveDateTime(const TQDateTime& dt) { mSaveDateTime = dt; mUpdated = true; }
void setLateCancel(int lc) { mLateCancel = lc; mUpdated = true; }
void setAutoClose(bool ac) { mAutoClose = ac; mUpdated = true; }
void setRepeatAtLogin(bool rl) { mRepeatAtLogin = rl; mUpdated = true; }
void setUid(Status s) { mEventID = uid(mEventID, s); mUpdated = true; }
void setKMailSerialNumber(unsigned long n) { mKMailSerialNumber = n; }
- void setLogFile(const QString& logfile);
+ void setLogFile(const TQString& logfile);
void setReminder(int minutes, bool onceOnly);
bool defer(const DateTime&, bool reminder, bool adjustRecurrence = false);
void cancelDefer();
void cancelCancelledDeferral();
void setDeferDefaultMinutes(int minutes) { mDeferDefaultMinutes = minutes; mUpdated = true; }
- bool setDisplaying(const KAEvent&, KAAlarm::Type, const QDateTime&);
+ bool setDisplaying(const KAEvent&, KAAlarm::Type, const TQDateTime&);
void reinstateFromDisplaying(const KAEvent& dispEvent);
void setArchive() { mArchive = true; mUpdated = true; }
void setEnabled(bool enable) { mEnabled = enable; mUpdated = true; }
@@ -350,7 +350,7 @@ class KAEvent : public KAAlarmEventBase
KCal::Event* event() const; // convert to new Event
bool isTemplate() const { return !mTemplateName.isEmpty(); }
- const QString& templateName() const { return mTemplateName; }
+ const TQString& templateName() const { return mTemplateName; }
bool usingDefaultTime() const { return mTemplateAfterTime == 0; }
int templateAfterTime() const { return mTemplateAfterTime; }
KAAlarm alarm(KAAlarm::Type) const;
@@ -361,15 +361,15 @@ class KAEvent : public KAAlarmEventBase
bool updateKCalEvent(KCal::Event&, bool checkUid = true, bool original = false, bool cancelCancelledDefer = false) const;
Action action() const { return (Action)mActionType; }
bool displayAction() const { return mActionType == T_MESSAGE || mActionType == T_FILE; }
- const QString& id() const { return mEventID; }
+ const TQString& id() const { return mEventID; }
bool valid() const { return mAlarmCount && (mAlarmCount != 1 || !mRepeatAtLogin); }
int alarmCount() const { return mAlarmCount; }
const DateTime& startDateTime() const { return mStartDateTime; }
DateTime mainDateTime(bool withRepeats = false) const
{ return (withRepeats && mNextRepeat && mRepeatInterval)
? mNextMainDateTime.addSecs(mNextRepeat * mRepeatInterval * 60) : mNextMainDateTime; }
- QDate mainDate() const { return mNextMainDateTime.date(); }
- QTime mainTime() const { return mNextMainDateTime.time(); }
+ TQDate mainDate() const { return mNextMainDateTime.date(); }
+ TQTime mainTime() const { return mNextMainDateTime.time(); }
DateTime mainEndRepeatTime() const { return (mRepeatCount > 0 && mRepeatInterval)
? mNextMainDateTime.addSecs(mRepeatCount * mRepeatInterval * 60) : mNextMainDateTime; }
int reminder() const { return mReminderMinutes; }
@@ -380,28 +380,28 @@ class KAEvent : public KAAlarmEventBase
DateTime deferralLimit(DeferLimitType* = 0) const;
int deferDefaultMinutes() const { return mDeferDefaultMinutes; }
DateTime displayDateTime() const;
- const QString& messageFileOrCommand() const { return mText; }
- QString logFile() const { return mLogFile; }
+ const TQString& messageFileOrCommand() const { return mText; }
+ TQString logFile() const { return mLogFile; }
bool commandXterm() const { return mCommandXterm; }
unsigned long kmailSerialNumber() const { return mKMailSerialNumber; }
bool copyToKOrganizer() const { return mCopyToKOrganizer; }
- const QString& audioFile() const { return mAudioFile; }
+ const TQString& audioFile() const { return mAudioFile; }
float soundVolume() const { return !mAudioFile.isEmpty() ? mSoundVolume : -1; }
float fadeVolume() const { return !mAudioFile.isEmpty() && mSoundVolume >= 0 && mFadeSeconds ? mFadeVolume : -1; }
int fadeSeconds() const { return !mAudioFile.isEmpty() && mSoundVolume >= 0 && mFadeVolume >= 0 ? mFadeSeconds : 0; }
bool repeatSound() const { return mRepeatSound && !mAudioFile.isEmpty(); }
- const QString& preAction() const { return mPreAction; }
- const QString& postAction() const { return mPostAction; }
+ const TQString& preAction() const { return mPreAction; }
+ const TQString& postAction() const { return mPostAction; }
bool recurs() const { return checkRecur() != KARecurrence::NO_RECUR; }
KARecurrence::Type recurType() const { return checkRecur(); }
KARecurrence* recurrence() const { return mRecurrence; }
int recurInterval() const; // recurrence period in units of the recurrence period type (minutes, days, etc)
int longestRecurrenceInterval() const { return mRecurrence ? mRecurrence->longestInterval() : 0; }
- QString recurrenceText(bool brief = false) const;
- QString repetitionText(bool brief = false) const;
- bool occursAfter(const QDateTime& preDateTime, bool includeRepetitions) const;
- OccurType nextOccurrence(const QDateTime& preDateTime, DateTime& result, OccurOption = IGNORE_REPETITION) const;
- OccurType previousOccurrence(const QDateTime& afterDateTime, DateTime& result, bool includeRepetitions = false) const;
+ TQString recurrenceText(bool brief = false) const;
+ TQString repetitionText(bool brief = false) const;
+ bool occursAfter(const TQDateTime& preDateTime, bool includeRepetitions) const;
+ OccurType nextOccurrence(const TQDateTime& preDateTime, DateTime& result, OccurOption = IGNORE_REPETITION) const;
+ OccurType previousOccurrence(const TQDateTime& afterDateTime, DateTime& result, bool includeRepetitions = false) const;
int flags() const;
bool deferred() const { return mDeferral > 0; }
bool toBeArchived() const { return mArchive; }
@@ -410,34 +410,34 @@ class KAEvent : public KAAlarmEventBase
bool mainExpired() const { return mMainExpired; }
bool expired() const { return mDisplaying && mMainExpired || uidStatus(mEventID) == EXPIRED; }
Status uidStatus() const { return uidStatus(mEventID); }
- static Status uidStatus(const QString& uid);
- static QString uid(const QString& id, Status);
- static KAEvent findTemplateName(AlarmCalendar&, const QString& name);
+ static Status uidStatus(const TQString& uid);
+ static TQString uid(const TQString& id, Status);
+ static KAEvent findTemplateName(AlarmCalendar&, const TQString& name);
struct MonthPos
{
MonthPos() : days(7) { }
int weeknum; // week in month, or < 0 to count from end of month
- QBitArray days; // days in week
+ TQBitArray days; // days in week
};
bool setRepetition(int interval, int count);
void setNoRecur() { clearRecur(); }
void setRecurrence(const KARecurrence&);
- bool setRecurMinutely(int freq, int count, const QDateTime& end);
- bool setRecurDaily(int freq, const QBitArray& days, int count, const QDate& end);
- bool setRecurWeekly(int freq, const QBitArray& days, int count, const QDate& end);
- bool setRecurMonthlyByDate(int freq, const QValueList<int>& days, int count, const QDate& end);
- bool setRecurMonthlyByPos(int freq, const QValueList<MonthPos>& pos, int count, const QDate& end);
- bool setRecurAnnualByDate(int freq, const QValueList<int>& months, int day, KARecurrence::Feb29Type, int count, const QDate& end);
- bool setRecurAnnualByPos(int freq, const QValueList<MonthPos>& pos, const QValueList<int>& months, int count, const QDate& end);
-// static QValueList<MonthPos> convRecurPos(const QValueList<KCal::RecurrenceRule::WDayPos>&);
+ bool setRecurMinutely(int freq, int count, const TQDateTime& end);
+ bool setRecurDaily(int freq, const TQBitArray& days, int count, const TQDate& end);
+ bool setRecurWeekly(int freq, const TQBitArray& days, int count, const TQDate& end);
+ bool setRecurMonthlyByDate(int freq, const TQValueList<int>& days, int count, const TQDate& end);
+ bool setRecurMonthlyByPos(int freq, const TQValueList<MonthPos>& pos, int count, const TQDate& end);
+ bool setRecurAnnualByDate(int freq, const TQValueList<int>& months, int day, KARecurrence::Feb29Type, int count, const TQDate& end);
+ bool setRecurAnnualByPos(int freq, const TQValueList<MonthPos>& pos, const TQValueList<int>& months, int count, const TQDate& end);
+// static TQValueList<MonthPos> convRecurPos(const TQValueList<KCal::RecurrenceRule::WDayPos>&);
#ifdef NDEBUG
void dumpDebug() const { }
#else
void dumpDebug() const;
#endif
static int calVersion();
- static QString calVersionString();
+ static TQString calVersionString();
static bool adjustStartOfDay(const KCal::Event::List&);
static void convertKCalEvents(KCal::Calendar&, int version, bool adjustSummerTime);
static void convertRepetitions(KCal::CalendarLocal&);
@@ -451,15 +451,15 @@ class KAEvent : public KAAlarmEventBase
};
void copy(const KAEvent&);
- bool setRecur(KCal::RecurrenceRule::PeriodType, int freq, int count, const QDateTime& end, KARecurrence::Feb29Type = KARecurrence::FEB29_FEB29);
+ bool setRecur(KCal::RecurrenceRule::PeriodType, int freq, int count, const TQDateTime& end, KARecurrence::Feb29Type = KARecurrence::FEB29_FEB29);
void clearRecur();
KARecurrence::Type checkRecur() const;
void checkRepetition() const;
- OccurType nextRecurrence(const QDateTime& preDateTime, DateTime& result) const;
- OccurType previousRecurrence(const QDateTime& afterDateTime, DateTime& result) const;
+ OccurType nextRecurrence(const TQDateTime& preDateTime, DateTime& result) const;
+ OccurType previousRecurrence(const TQDateTime& afterDateTime, DateTime& result) const;
static bool convertRepetition(KCal::Event*);
- KCal::Alarm* initKCalAlarm(KCal::Event&, const DateTime&, const QStringList& types, KAAlarm::Type = KAAlarm::INVALID_ALARM) const;
- KCal::Alarm* initKCalAlarm(KCal::Event&, int startOffsetSecs, const QStringList& types, KAAlarm::Type = KAAlarm::INVALID_ALARM) const;
+ KCal::Alarm* initKCalAlarm(KCal::Event&, const DateTime&, const TQStringList& types, KAAlarm::Type = KAAlarm::INVALID_ALARM) const;
+ KCal::Alarm* initKCalAlarm(KCal::Event&, int startOffsetSecs, const TQStringList& types, KAAlarm::Type = KAAlarm::INVALID_ALARM) const;
static DateTime readDateTime(const KCal::Event&, bool dateOnly, DateTime& start);
static void readAlarms(const KCal::Event&, void* alarmMap);
static void readAlarm(const KCal::Alarm&, AlarmData&);
@@ -467,13 +467,13 @@ class KAEvent : public KAAlarmEventBase
inline void set_reminder(int minutes);
inline void set_archiveReminder();
- QString mTemplateName; // alarm template's name, or null if normal event
- QString mAudioFile; // ATTACH: audio file to play
- QString mPreAction; // command to execute before alarm is displayed
- QString mPostAction; // command to execute after alarm window is closed
+ TQString mTemplateName; // alarm template's name, or null if normal event
+ TQString mAudioFile; // ATTACH: audio file to play
+ TQString mPreAction; // command to execute before alarm is displayed
+ TQString mPostAction; // command to execute after alarm window is closed
DateTime mStartDateTime; // DTSTART and DTEND: start and end time for event
- QDateTime mSaveDateTime; // CREATED: date event was created, or saved in expired calendar
- QDateTime mAtLoginDateTime; // repeat-at-login time
+ TQDateTime mSaveDateTime; // CREATED: date event was created, or saved in expired calendar
+ TQDateTime mAtLoginDateTime; // repeat-at-login time
DateTime mDeferralTime; // extra time to trigger alarm (if alarm or reminder deferred)
DateTime mDisplayingTime; // date/time shown in the alarm currently being displayed
int mDisplayingFlags; // type of alarm which is currently being displayed
@@ -486,7 +486,7 @@ class KAEvent : public KAAlarmEventBase
DeferType mDeferral; // whether the alarm is an extra deferred/deferred-reminder alarm
unsigned long mKMailSerialNumber;// if email text, message's KMail serial number
int mTemplateAfterTime;// time not specified: use n minutes after default time, or -1 (applies to templates only)
- QString mLogFile; // alarm output is to be logged to this URL
+ TQString mLogFile; // alarm output is to be logged to this URL
bool mCommandXterm; // command alarm is to be executed in a terminal window
bool mCopyToKOrganizer; // KOrganizer should hold a copy of the event
bool mReminderOnceOnly; // the reminder is output only for the first recurrence