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