24 #include <tqdatetime.h>
25 #include <tqlineedit.h>
27 #include <kdialogbase.h>
30 #include "alarmtext.h"
32 #include "soundpicker.h"
41 class FontColourButton;
47 class LateCancelSelector;
48 class AlarmTimeWidget;
51 class SpecialActionsButton;
55 class PickAlarmFileRadio;
58 class EditAlarmDlg :
public KDialogBase
63 enum MessageType { MESSAGE, FILE };
64 enum CmdLogType { DISCARD_OUTPUT, LOG_TO_FILE, EXEC_IN_TERMINAL };
66 EditAlarmDlg(
bool Template,
const TQString& caption, TQWidget* parent = 0,
const char* name = 0,
67 const KAEvent* = 0,
bool readOnly =
false);
68 virtual ~EditAlarmDlg();
70 void setAction(KAEvent::Action,
const AlarmText& = AlarmText());
72 static CheckBox* createConfirmAckCheckbox(TQWidget* parent,
const char* name = 0);
74 static TQString i18n_ConfirmAck();
75 static TQString i18n_k_ConfirmAck();
76 static TQString i18n_SpecialActions();
77 static TQString i18n_ShowInKOrganizer();
78 static TQString i18n_g_ShowInKOrganizer();
79 static TQString i18n_EnterScript();
80 static TQString i18n_p_EnterScript();
81 static TQString i18n_ExecInTermWindow();
82 static TQString i18n_w_ExecInTermWindow();
83 static TQString i18n_u_ExecInTermWindow();
84 static TQString i18n_g_LogToFile();
85 static TQString i18n_CopyEmailToSelf();
86 static TQString i18n_e_CopyEmailToSelf();
87 static TQString i18n_s_CopyEmailToSelf();
88 static TQString i18n_EmailFrom();
89 static TQString i18n_f_EmailFrom();
90 static TQString i18n_EmailTo();
91 static TQString i18n_EmailSubject();
92 static TQString i18n_j_EmailSubject();
95 virtual void resizeEvent(TQResizeEvent*);
96 virtual void showEvent(TQShowEvent*);
98 virtual void slotOk();
99 virtual void slotCancel();
100 virtual void slotTry();
101 virtual void slotDefault();
103 void slotRecurTypeChange(
int repeatType);
104 void slotRecurFrequencyChange();
105 void slotAlarmTypeChanged(
int id);
106 void slotEditDeferral();
107 void openAddressBook();
108 void slotAddAttachment();
109 void slotRemoveAttachment();
110 void slotShowMainPage();
111 void slotShowRecurrenceEdit();
112 void slotAnyTimeToggled(
bool anyTime);
113 void slotTemplateTimeType(
int id);
114 void slotSetSubRepetition();
115 void slotCmdScriptToggled(
bool);
118 void initialise(
const KAEvent*);
120 void setEvent(
KAEvent&,
const TQString& text,
bool trial);
121 KAEvent::Action getAlarmType()
const;
122 int getAlarmFlags()
const;
123 bool checkText(TQString& result,
bool showErrorMessage =
true)
const;
124 void setSoundPicker();
125 void setRecurTabTitle(
const KAEvent* = 0);
126 bool checkCommandData();
127 bool checkEmailData();
129 void initDisplayAlarms(TQWidget* parent);
130 void initCommand(TQWidget* parent);
131 void initEmail(TQWidget* parent);
132 void saveState(
const KAEvent*);
133 bool stateChanged()
const;
139 bool mRecurPageShown;
140 bool mRecurSetDefaultEndDate;
142 ButtonGroup* mActionGroup;
143 RadioButton* mMessageRadio;
144 RadioButton* mCommandRadio;
145 PickAlarmFileRadio* mFileRadio;
146 RadioButton* mEmailRadio;
147 TQWidgetStack* mAlarmTypeStack;
150 TQLineEdit* mTemplateName;
151 ButtonGroup* mTemplateTimeGroup;
152 RadioButton* mTemplateDefaultTime;
153 RadioButton* mTemplateUseTimeAfter;
154 RadioButton* mTemplateAnyTime;
155 RadioButton* mTemplateUseTime;
156 TimeSpinBox* mTemplateTimeAfter;
157 TimeEdit* mTemplateTime;
160 TQFrame* mDisplayAlarmsFrame;
162 TQHBox* mFilePadding;
163 SoundPicker* mSoundPicker;
164 CheckBox* mConfirmAck;
165 FontColourButton* mFontColourButton;
166 ColourCombo* mBgColourButton;
167 TQHBox* mBgColourBox;
168 SpecialActionsButton* mSpecialActionsButton;
170 bool mReminderDeferral;
171 bool mReminderArchived;
173 TextEdit* mTextMessageEdit;
175 LineEdit* mFileMessageEdit;
176 TQPushButton* mFileBrowseButton;
177 TQString mFileDefaultDir;
179 TQFrame* mCommandFrame;
180 CheckBox* mCmdTypeScript;
181 LineEdit* mCmdCommandEdit;
182 TextEdit* mCmdScriptEdit;
183 ButtonGroup* mCmdOutputGroup;
184 LineEdit* mCmdLogFileEdit;
185 TQWidget* mCmdPadding;
187 TQFrame* mEmailFrame;
188 EmailIdCombo* mEmailFromList;
189 LineEdit* mEmailToEdit;
190 TQPushButton* mEmailAddressButton;
191 TQLineEdit* mEmailSubjectEdit;
192 TextEdit* mEmailMessageEdit;
193 TQComboBox* mEmailAttachList;
194 TQPushButton* mEmailAddAttachButton;
195 TQPushButton* mEmailRemoveButton;
197 TQString mAttachDefaultDir;
199 TQGroupBox* mDeferGroup;
200 TQLabel* mDeferTimeLabel;
201 TQPushButton* mDeferChangeButton;
203 AlarmTimeWidget* mTimeWidget;
204 LateCancelSelector* mLateCancel;
205 CheckBox* mShowInKorganizer;
207 RecurrenceEdit* mRecurrenceEdit;
209 TQString mAlarmMessage;
210 DateTime mAlarmDateTime;
211 DateTime mDeferDateTime;
212 EmailAddressList mEmailAddresses;
213 TQStringList mEmailAttachments;
214 unsigned long mKMailSerialNumber;
215 int mDeferGroupHeight;
218 bool mExpiredRecurrence;
219 mutable bool mChanged;
220 mutable bool mOnlyDeferred;
221 bool mDesiredReadOnly;
226 TQString mSavedTemplateName;
227 TQButton* mSavedTemplateTimeType;
228 TQTime mSavedTemplateTime;
229 int mSavedTemplateAfterTime;
230 TQButton* mSavedTypeRadio;
231 SoundPicker::Type mSavedSoundType;
232 bool mSavedRepeatSound;
233 TQString mSavedSoundFile;
234 float mSavedSoundVolume;
235 float mSavedSoundFadeVolume;
236 int mSavedSoundFadeSeconds;
237 bool mSavedConfirmAck;
239 TQColor mSavedBgColour;
240 TQColor mSavedFgColour;
241 TQString mSavedPreAction;
242 TQString mSavedPostAction;
245 TQString mSavedTextFileCommandMessage;
246 TQString mSavedEmailFrom;
247 TQString mSavedEmailTo;
248 TQString mSavedEmailSubject;
249 TQStringList mSavedEmailAttach;
251 bool mSavedCmdScript;
252 TQButton* mSavedCmdOutputRadio;
253 TQString mSavedCmdLogFile;
254 DateTime mSavedDateTime;
255 int mSavedRecurrenceType;
256 int mSavedLateCancel;
257 bool mSavedAutoClose;
258 bool mSavedShowInKorganizer;
represents calendar alarms and events
KAEvent corresponds to a KCal::Event instance.