00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef EDITDLG_H
00022 #define EDITDLG_H
00023
00024 #include <tqdatetime.h>
00025 #include <tqlineedit.h>
00026
00027 #include <kdialogbase.h>
00028
00029 #include "alarmevent.h"
00030 #include "alarmtext.h"
00031 #include "datetime.h"
00032 #include "soundpicker.h"
00033
00034 class TQButton;
00035 class TQGroupBox;
00036 class TQComboBox;
00037 class TQTabWidget;
00038 class TQVBox;
00039 class TQHBox;
00040 class EmailIdCombo;
00041 class FontColourButton;
00042 class ColourCombo;
00043 class ButtonGroup;
00044 class TimeEdit;
00045 class RadioButton;
00046 class CheckBox;
00047 class LateCancelSelector;
00048 class AlarmTimeWidget;
00049 class RecurrenceEdit;
00050 class Reminder;
00051 class SpecialActionsButton;
00052 class TimeSpinBox;
00053 class LineEdit;
00054 class TextEdit;
00055 class PickAlarmFileRadio;
00056
00057
00058 class EditAlarmDlg : public KDialogBase
00059 {
00060 Q_OBJECT
00061 TQ_OBJECT
00062 public:
00063 enum MessageType { MESSAGE, FILE };
00064 enum CmdLogType { DISCARD_OUTPUT, LOG_TO_FILE, EXEC_IN_TERMINAL };
00065
00066 EditAlarmDlg(bool Template, const TQString& caption, TQWidget* parent = 0, const char* name = 0,
00067 const KAEvent* = 0, bool readOnly = false);
00068 virtual ~EditAlarmDlg();
00069 bool getEvent(KAEvent&);
00070 void setAction(KAEvent::Action, const AlarmText& = AlarmText());
00071
00072 static CheckBox* createConfirmAckCheckbox(TQWidget* parent, const char* name = 0);
00073
00074 static TQString i18n_ConfirmAck();
00075 static TQString i18n_k_ConfirmAck();
00076 static TQString i18n_SpecialActions();
00077 static TQString i18n_ShowInKOrganizer();
00078 static TQString i18n_g_ShowInKOrganizer();
00079 static TQString i18n_EnterScript();
00080 static TQString i18n_p_EnterScript();
00081 static TQString i18n_ExecInTermWindow();
00082 static TQString i18n_w_ExecInTermWindow();
00083 static TQString i18n_u_ExecInTermWindow();
00084 static TQString i18n_g_LogToFile();
00085 static TQString i18n_CopyEmailToSelf();
00086 static TQString i18n_e_CopyEmailToSelf();
00087 static TQString i18n_s_CopyEmailToSelf();
00088 static TQString i18n_EmailFrom();
00089 static TQString i18n_f_EmailFrom();
00090 static TQString i18n_EmailTo();
00091 static TQString i18n_EmailSubject();
00092 static TQString i18n_j_EmailSubject();
00093
00094 protected:
00095 virtual void resizeEvent(TQResizeEvent*);
00096 virtual void showEvent(TQShowEvent*);
00097 protected slots:
00098 virtual void slotOk();
00099 virtual void slotCancel();
00100 virtual void slotTry();
00101 virtual void slotDefault();
00102 private slots:
00103 void slotRecurTypeChange(int repeatType);
00104 void slotRecurFrequencyChange();
00105 void slotAlarmTypeChanged(int id);
00106 void slotEditDeferral();
00107 void openAddressBook();
00108 void slotAddAttachment();
00109 void slotRemoveAttachment();
00110 void slotShowMainPage();
00111 void slotShowRecurrenceEdit();
00112 void slotAnyTimeToggled(bool anyTime);
00113 void slotTemplateTimeType(int id);
00114 void slotSetSubRepetition();
00115 void slotCmdScriptToggled(bool);
00116
00117 private:
00118 void initialise(const KAEvent*);
00119 void setReadOnly();
00120 void setEvent(KAEvent&, const TQString& text, bool trial);
00121 KAEvent::Action getAlarmType() const;
00122 int getAlarmFlags() const;
00123 bool checkText(TQString& result, bool showErrorMessage = true) const;
00124 void setSoundPicker();
00125 void setRecurTabTitle(const KAEvent* = 0);
00126 bool checkCommandData();
00127 bool checkEmailData();
00128
00129 void initDisplayAlarms(TQWidget* parent);
00130 void initCommand(TQWidget* parent);
00131 void initEmail(TQWidget* parent);
00132 void saveState(const KAEvent*);
00133 bool stateChanged() const;
00134
00135 TQTabWidget* mTabs;
00136 int mMainPageIndex;
00137 int mRecurPageIndex;
00138 bool mMainPageShown;
00139 bool mRecurPageShown;
00140 bool mRecurSetDefaultEndDate;
00141
00142 ButtonGroup* mActionGroup;
00143 RadioButton* mMessageRadio;
00144 RadioButton* mCommandRadio;
00145 PickAlarmFileRadio* mFileRadio;
00146 RadioButton* mEmailRadio;
00147 TQWidgetStack* mAlarmTypeStack;
00148
00149
00150 TQLineEdit* mTemplateName;
00151 ButtonGroup* mTemplateTimeGroup;
00152 RadioButton* mTemplateDefaultTime;
00153 RadioButton* mTemplateUseTimeAfter;
00154 RadioButton* mTemplateAnyTime;
00155 RadioButton* mTemplateUseTime;
00156 TimeSpinBox* mTemplateTimeAfter;
00157 TimeEdit* mTemplateTime;
00158
00159
00160 TQFrame* mDisplayAlarmsFrame;
00161 TQHBox* mFileBox;
00162 TQHBox* mFilePadding;
00163 SoundPicker* mSoundPicker;
00164 CheckBox* mConfirmAck;
00165 FontColourButton* mFontColourButton;
00166 ColourCombo* mBgColourButton;
00167 TQHBox* mBgColourBox;
00168 SpecialActionsButton* mSpecialActionsButton;
00169 Reminder* mReminder;
00170 bool mReminderDeferral;
00171 bool mReminderArchived;
00172
00173 TextEdit* mTextMessageEdit;
00174
00175 LineEdit* mFileMessageEdit;
00176 TQPushButton* mFileBrowseButton;
00177 TQString mFileDefaultDir;
00178
00179 TQFrame* mCommandFrame;
00180 CheckBox* mCmdTypeScript;
00181 LineEdit* mCmdCommandEdit;
00182 TextEdit* mCmdScriptEdit;
00183 ButtonGroup* mCmdOutputGroup;
00184 LineEdit* mCmdLogFileEdit;
00185 TQWidget* mCmdPadding;
00186
00187 TQFrame* mEmailFrame;
00188 EmailIdCombo* mEmailFromList;
00189 LineEdit* mEmailToEdit;
00190 TQPushButton* mEmailAddressButton;
00191 TQLineEdit* mEmailSubjectEdit;
00192 TextEdit* mEmailMessageEdit;
00193 TQComboBox* mEmailAttachList;
00194 TQPushButton* mEmailAddAttachButton;
00195 TQPushButton* mEmailRemoveButton;
00196 CheckBox* mEmailBcc;
00197 TQString mAttachDefaultDir;
00198
00199 TQGroupBox* mDeferGroup;
00200 TQLabel* mDeferTimeLabel;
00201 TQPushButton* mDeferChangeButton;
00202
00203 AlarmTimeWidget* mTimeWidget;
00204 LateCancelSelector* mLateCancel;
00205 CheckBox* mShowInKorganizer;
00206
00207 RecurrenceEdit* mRecurrenceEdit;
00208
00209 TQString mAlarmMessage;
00210 DateTime mAlarmDateTime;
00211 DateTime mDeferDateTime;
00212 EmailAddressList mEmailAddresses;
00213 TQStringList mEmailAttachments;
00214 unsigned long mKMailSerialNumber;
00215 int mDeferGroupHeight;
00216 int mDesktop;
00217 bool mTemplate;
00218 bool mExpiredRecurrence;
00219 mutable bool mChanged;
00220 mutable bool mOnlyDeferred;
00221 bool mDesiredReadOnly;
00222 bool mReadOnly;
00223
00224
00225 KAEvent* mSavedEvent;
00226 TQString mSavedTemplateName;
00227 TQButton* mSavedTemplateTimeType;
00228 TQTime mSavedTemplateTime;
00229 int mSavedTemplateAfterTime;
00230 TQButton* mSavedTypeRadio;
00231 SoundPicker::Type mSavedSoundType;
00232 bool mSavedRepeatSound;
00233 TQString mSavedSoundFile;
00234 float mSavedSoundVolume;
00235 float mSavedSoundFadeVolume;
00236 int mSavedSoundFadeSeconds;
00237 bool mSavedConfirmAck;
00238 TQFont mSavedFont;
00239 TQColor mSavedBgColour;
00240 TQColor mSavedFgColour;
00241 TQString mSavedPreAction;
00242 TQString mSavedPostAction;
00243 int mSavedReminder;
00244 bool mSavedOnceOnly;
00245 TQString mSavedTextFileCommandMessage;
00246 TQString mSavedEmailFrom;
00247 TQString mSavedEmailTo;
00248 TQString mSavedEmailSubject;
00249 TQStringList mSavedEmailAttach;
00250 bool mSavedEmailBcc;
00251 bool mSavedCmdScript;
00252 TQButton* mSavedCmdOutputRadio;
00253 TQString mSavedCmdLogFile;
00254 DateTime mSavedDateTime;
00255 int mSavedRecurrenceType;
00256 int mSavedLateCancel;
00257 bool mSavedAutoClose;
00258 bool mSavedShowInKorganizer;
00259 };
00260
00261 #endif // EDITDLG_H