1/*
2 * kaeventformatter.h - converts KAlarmCal::KAEvent properties to text
3 * Copyright © 2010-2011 by David Jarvie <djarvie@kde.org>
4 *
5 * This library is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU Library General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 * License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA.
19 */
20
21#ifndef KAEVENTFORMATTER_H
22#define KAEVENTFORMATTER_H
23
24#include <kalarmcal/kaevent.h>
25
26#include <QString>
27
28using namespace KAlarmCal;
29
30class KAEventFormatter
31{
32 public:
33 // KAEvent parameter identifiers.
34 // Note that parameters stored in Akonadi attributes are not included.
35 enum Parameter
36 {
37 Id,
38 AlarmType,
39 AlarmCategory,
40 TemplateName,
41 CreatedTime,
42 StartTime,
43 TemplateAfterTime,
44 Recurs, // does the event recur?
45 Recurrence,
46 NextRecurrence, // next alarm time excluding repetitions, including reminder/deferral
47 SubRepetition, // is there a sub-repetition?
48 RepeatInterval,
49 RepeatCount,
50 NextRepetition, // next repetition count
51 LateCancel,
52 AutoClose,
53 WorkTimeOnly,
54 HolidaysExcluded,
55 CopyKOrganizer,
56 Enabled,
57 ReadOnly,
58 Archive,
59 Revision,
60 CustomProperties,
61
62 MessageText,
63 MessageFile,
64 FgColour,
65 BgColour,
66 Font,
67 PreAction,
68 PreActionCancel,
69 PreActionNoError,
70 PostAction,
71 ConfirmAck,
72 KMailSerial,
73 Sound,
74 SoundRepeat,
75 SoundVolume,
76 SoundFadeVolume,
77 SoundFadeTime,
78 Reminder,
79 ReminderOnce,
80 DeferralType,
81 DeferralTime,
82 DeferDefault,
83 DeferDefaultDate,
84
85 Command,
86 LogFile,
87 CommandXTerm,
88
89 EmailSubject,
90 EmailFromId,
91 EmailTo,
92 EmailBcc,
93 EmailBody,
94 EmailAttachments
95
96 };
97
98 KAEventFormatter() {}
99 KAEventFormatter(const KAEvent& e, bool falseForUnspecified);
100 bool isApplicable(Parameter) const;
101 QString value(Parameter) const;
102 const KAEvent& event() const { return mEvent; }
103 static QString label(Parameter);
104
105 private:
106 KAEvent mEvent;
107 QString mUnspecifiedValue;
108};
109
110#endif // KAEVENTFORMATTER_H
111
112// vim: et sw=4:
113