33
34
class CommandOptions
38
CMD_ERROR, // error in command line options
41
TRIGGER_EVENT, // --triggerEvent
42
CANCEL_EVENT, // --cancelEvent
44
EDIT_NEW_PRESET, // --edit-new-preset
45
EDIT_NEW, // --edit-new-display, --edit-new-command, --edit-new-email
46
NEW // --file, --exec-display, --exec, --mail, message
49
Command command() const { return mCommand; }
50
QString eventId() const { return mEventId; }
51
QString templateName() const { return mTemplateName; }
52
EditAlarmDlg::Type editType() const { return mEditType; }
53
KAEventData::Action editAction() const { return mEditAction; }
54
QString text() const { return mText; }
55
KDateTime alarmTime() const { return mAlarmTime; }
56
KARecurrence* recurrence() const { return mRecurrence; }
57
int subRepeatCount() const { return mRepeatCount; }
58
int subRepeatInterval() const { return mRepeatInterval; }
59
int lateCancel() const { return mLateCancel; }
60
QColor bgColour() const { return mBgColour; }
61
QColor fgColour() const { return mFgColour; }
62
int reminderMinutes() const { return mReminderMinutes; }
63
QString audioFile() const { return mAudioFile; }
64
float audioVolume() const { return mAudioVolume; }
65
EmailAddressList addressees() const { return mAddressees; }
66
QStringList attachments() const { return mAttachments; }
67
QString subject() const { return mSubject; }
68
uint fromID() const { return mFromID; }
69
int flags() const { return mFlags; }
39
CMD_ERROR, // error in command line options
42
TRIGGER_EVENT, // --triggerEvent
43
CANCEL_EVENT, // --cancelEvent
45
EDIT_NEW_PRESET, // --edit-new-preset
46
EDIT_NEW, // --edit-new-display, --edit-new-command, --edit-new-email
47
NEW // --file, --exec-display, --exec, --mail, message
50
Command command() const { return mCommand; }
51
QString eventId() const { return mEventId; }
52
QString templateName() const { return mTemplateName; }
53
EditAlarmDlg::Type editType() const { return mEditType; }
54
KAEvent::Action editAction() const { return mEditAction; }
55
QString text() const { return mText; }
56
KDateTime alarmTime() const { return mAlarmTime; }
57
KARecurrence* recurrence() const { return mRecurrence; }
58
int subRepeatCount() const { return mRepeatCount; }
59
int subRepeatInterval() const { return mRepeatInterval; }
60
int lateCancel() const { return mLateCancel; }
61
QColor bgColour() const { return mBgColour; }
62
QColor fgColour() const { return mFgColour; }
63
int reminderMinutes() const { return mReminderMinutes; }
64
QString audioFile() const { return mAudioFile; }
65
float audioVolume() const { return mAudioVolume; }
66
EmailAddressList addressees() const { return mAddressees; }
67
QStringList attachments() const { return mAttachments; }
68
QString subject() const { return mSubject; }
69
uint fromID() const { return mFromID; }
70
int flags() const { return mFlags; }
71
bool disableAll() const { return mDisableAll; }
71
KDateTime simulationTime() const { return mSimulationTime; }
73
KDateTime simulationTime() const { return mSimulationTime; }
73
static void printError(const QString& errmsg);
76
bool checkCommand(const QByteArray& command, Command, EditAlarmDlg::Type = EditAlarmDlg::NO_TYPE);
77
inline void setError(const QString& error);
78
void setErrorRequires(const char* opt, const char* opt2, const char* opt3 = 0);
79
void setErrorParameter(const char* opt);
80
void setErrorIncompatible(const QByteArray& opt1, const QByteArray& opt2);
81
void checkEditType(EditAlarmDlg::Type type, const QByteArray& opt)
82
{ checkEditType(type, EditAlarmDlg::NO_TYPE, opt); }
83
void checkEditType(EditAlarmDlg::Type, EditAlarmDlg::Type, const QByteArray& opt);
86
QString mError; // error message
87
Command mCommand; // the selected command
88
QByteArray mCommandName; // option string for the selected command
89
QString mEventId; // TRIGGER_EVENT, CANCEL_EVENT, EDIT: event ID
90
QString mTemplateName; // EDIT_NEW_PRESET: template name
91
EditAlarmDlg::Type mEditType; // NEW, EDIT_NEW_*: alarm edit type
92
KAEventData::Action mEditAction; // NEW: alarm edit sub-type
93
bool mEditActionSet; // NEW: mEditAction is valid
94
QString mText; // NEW: alarm text
95
KDateTime mAlarmTime; // NEW: alarm time
96
KARecurrence* mRecurrence; // NEW: recurrence
97
int mRepeatCount; // NEW: sub-repetition count
98
int mRepeatInterval; // NEW: sub-repetition interval
99
int mLateCancel; // NEW: late-cancellation interval
100
QColor mBgColour; // NEW: background colour
101
QColor mFgColour; // NEW: foreground colour
102
int mReminderMinutes;// NEW: reminder period, < 0 if once only reminder
103
QString mAudioFile; // NEW: audio file path
104
float mAudioVolume; // NEW: audio file volume
105
EmailAddressList mAddressees; // NEW: email addressees
106
QStringList mAttachments; // NEW: email attachment file names
107
QString mSubject; // NEW: email subject
108
uint mFromID; // NEW: email sender ID
109
int mFlags; // NEW: event flags
75
static void printError(const QString& errmsg);
78
bool checkCommand(const QByteArray& command, Command, EditAlarmDlg::Type = EditAlarmDlg::NO_TYPE);
79
inline void setError(const QString& error);
80
void setErrorRequires(const char* opt, const char* opt2, const char* opt3 = 0);
81
void setErrorParameter(const char* opt);
82
void setErrorIncompatible(const QByteArray& opt1, const QByteArray& opt2);
83
void checkEditType(EditAlarmDlg::Type type, const QByteArray& opt)
84
{ checkEditType(type, EditAlarmDlg::NO_TYPE, opt); }
85
void checkEditType(EditAlarmDlg::Type, EditAlarmDlg::Type, const QByteArray& opt);
88
QString mError; // error message
89
Command mCommand; // the selected command
90
QByteArray mCommandName; // option string for the selected command
91
QString mEventId; // TRIGGER_EVENT, CANCEL_EVENT, EDIT: event ID
92
QString mTemplateName; // EDIT_NEW_PRESET: template name
93
EditAlarmDlg::Type mEditType; // NEW, EDIT_NEW_*: alarm edit type
94
KAEvent::Action mEditAction; // NEW: alarm edit sub-type
95
bool mEditActionSet; // NEW: mEditAction is valid
96
QString mText; // NEW: alarm text
97
KDateTime mAlarmTime; // NEW: alarm time
98
KARecurrence* mRecurrence; // NEW: recurrence
99
int mRepeatCount; // NEW: sub-repetition count
100
int mRepeatInterval; // NEW: sub-repetition interval
101
int mLateCancel; // NEW: late-cancellation interval
102
QColor mBgColour; // NEW: background colour
103
QColor mFgColour; // NEW: foreground colour
104
int mReminderMinutes;// NEW: reminder period
105
QString mAudioFile; // NEW: audio file path
106
float mAudioVolume; // NEW: audio file volume
107
EmailAddressList mAddressees; // NEW: email addressees
108
QStringList mAttachments; // NEW: email attachment file names
109
QString mSubject; // NEW: email subject
110
uint mFromID; // NEW: email sender ID
111
int mFlags; // NEW: event flags
112
bool mDisableAll; // disable all alarm monitoring
111
KDateTime mSimulationTime; // system time to be simulated, or invalid if none
114
KDateTime mSimulationTime; // system time to be simulated, or invalid if none
115
118
#endif // COMMANDOPTIONS_H