kalarm
messagewin.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef MESSAGEWIN_H
00022 #define MESSAGEWIN_H
00023
00026 #include <tqmap.h>
00027
00028 #include "mainwindowbase.h"
00029 #include "alarmevent.h"
00030
00031 class TQPushButton;
00032 class KPushButton;
00033 class TQLabel;
00034 class TQTimer;
00035 class KWinModule;
00036 class AlarmTimeWidget;
00037 class DeferAlarmDlg;
00038 class KArtsDispatcher;
00039 namespace KDE { class PlayObject; }
00040
00044 class MessageWin : public MainWindowBase
00045 {
00046 Q_OBJECT
00047 TQ_OBJECT
00048 public:
00049 MessageWin();
00050 MessageWin(const KAEvent&, const KAAlarm&, bool reschedule_event = true, bool allowDefer = true);
00051 MessageWin(const KAEvent&, const DateTime& alarmDateTime, const TQStringList& errmsgs);
00052 ~MessageWin();
00053 void repeat(const KAAlarm&);
00054 void setRecreating() { mRecreating = true; }
00055 const DateTime& dateTime() { return mDateTime; }
00056 KAAlarm::Type alarmType() const { return mAlarmType; }
00057 bool hasDefer() const { return !!mDeferButton; }
00058 bool isValid() const { return !mInvalid; }
00059 virtual void show();
00060 virtual TQSize sizeHint() const;
00061 static int instanceCount() { return mWindowList.count(); }
00062 static MessageWin* findEvent(const TQString& eventID);
00063
00064 protected:
00065 virtual void showEvent(TQShowEvent*);
00066 virtual void moveEvent(TQMoveEvent*);
00067 virtual void resizeEvent(TQResizeEvent*);
00068 virtual void closeEvent(TQCloseEvent*);
00069 virtual void saveProperties(KConfig*);
00070 virtual void readProperties(KConfig*);
00071
00072 private slots:
00073 void slotEdit();
00074 void slotDefer();
00075 void checkDeferralLimit();
00076 void displayMainWindow();
00077 void slotShowKMailMessage();
00078 void slotSpeak();
00079 void slotPlayAudio();
00080 void checkAudioPlay();
00081 void stopPlay();
00082 void slotFade();
00083 void enableButtons();
00084 void setRemainingTextDay();
00085 void setRemainingTextMinute();
00086 void setMaxSize();
00087
00088 private:
00089 void initView();
00090 #ifndef WITHOUT_ARTS
00091 void initAudio(bool firstTime);
00092 int getKMixVolume();
00093 void setKMixVolume(int percent);
00094 #endif
00095 void displayComplete();
00096 void playAudio();
00097 void setDeferralLimit(const KAEvent&);
00098 bool haveErrorMessage(unsigned msg) const;
00099 void clearErrorMessage(unsigned msg) const;
00100
00101 static TQValueList<MessageWin*> mWindowList;
00102 static TQMap<TQString, unsigned> mErrorMessages;
00103
00104 TQString mMessage;
00105 TQFont mFont;
00106 TQColor mBgColour, mFgColour;
00107 DateTime mDateTime;
00108 TQDateTime mCloseTime;
00109 TQString mEventID;
00110 TQString mAudioFile;
00111 float mVolume;
00112 float mFadeVolume;
00113 int mFadeSeconds;
00114 int mDefaultDeferMinutes;
00115 KAAlarm::Type mAlarmType;
00116 KAEvent::Action mAction;
00117 unsigned long mKMailSerialNumber;
00118 TQStringList mErrorMsgs;
00119 int mRestoreHeight;
00120 bool mAudioRepeat;
00121 bool mConfirmAck;
00122 bool mShowEdit;
00123 bool mNoDefer;
00124 bool mInvalid;
00125
00126 KArtsDispatcher* mArtsDispatcher;
00127 KDE::PlayObject* mPlayObject;
00128 TQCString mKMixName;
00129 TQString mKMixError;
00130 TQTimer* mPlayTimer;
00131 TQTimer* mFadeTimer;
00132 float mOldVolume;
00133 TQString mLocalAudioFile;
00134 TQTime mAudioFileStart;
00135 int mAudioFileLoadSecs;
00136 bool mPlayedOnce;
00137 bool mPlayed;
00138
00139 KAEvent mEvent;
00140 TQLabel* mRemainingText;
00141 KPushButton* mOkButton;
00142 TQPushButton* mEditButton;
00143 TQPushButton* mDeferButton;
00144 TQPushButton* mSilenceButton;
00145 TQPushButton* mKAlarmButton;
00146 TQPushButton* mKMailButton;
00147 DeferAlarmDlg* mDeferDlg;
00148 TQDateTime mDeferLimit;
00149 mutable KWinModule* mWinModule;
00150 int mFlags;
00151 int mLateCancel;
00152 int mButtonDelay;
00153 bool mErrorWindow;
00154 bool mNoPostAction;
00155 bool mRecreating;
00156 bool mBeep;
00157 bool mSpeak;
00158 bool mRescheduleEvent;
00159 bool mShown;
00160 bool mPositioning;
00161 bool mNoCloseConfirm;
00162 bool mUsingKMix;
00163 bool mDisableDeferral;
00164 };
00165
00166 #endif // MESSAGEWIN_H
|