7#include "korganizereditorconfig.h"
9#include <CalendarSupport/KCalPrefs>
11#include <KIdentityManagementCore/Identity>
12#include <KIdentityManagementCore/IdentityManager>
14using namespace IncidenceEditorNG;
16KOrganizerEditorConfig::KOrganizerEditorConfig()
21KOrganizerEditorConfig::~KOrganizerEditorConfig() =
default;
25 return CalendarSupport::KCalPrefs::instance();
30 return CalendarSupport::KCalPrefs::instance()->fullName();
35 return CalendarSupport::KCalPrefs::instance()->email();
40 return CalendarSupport::KCalPrefs::instance()->thatIsMe(
email);
45 return CalendarSupport::KCalPrefs::instance()->allEmails();
53 std::transform(manager->begin(), manager->end(), std::back_inserter(organizers), [](
const auto &identity) {
54 return EditorConfig::Organizer{identity.fullName(), identity.fullEmailAddr(), identity.pgpAutoSign(), identity.pgpAutoEncrypt()};
61 return CalendarSupport::KCalPrefs::instance()->showTimeZoneSelectorInIncidenceEditor();
64QDateTime KOrganizerEditorConfig::defaultDuration()
const
66 return CalendarSupport::KCalPrefs::instance()->defaultDuration();
69QDateTime KOrganizerEditorConfig::startTime()
const
71 return CalendarSupport::KCalPrefs::instance()->startTime();
74bool KOrganizerEditorConfig::defaultAudioFileReminders()
const
76 return CalendarSupport::KCalPrefs::instance()->defaultAudioFileReminders();
79QUrl KOrganizerEditorConfig::audioFilePath()
const
84int KOrganizerEditorConfig::reminderTime()
const
86 return CalendarSupport::KCalPrefs::instance()->reminderTime();
89int KOrganizerEditorConfig::reminderTimeUnits()
const
91 return CalendarSupport::KCalPrefs::instance()->reminderTimeUnits();
94bool KOrganizerEditorConfig::defaultTodoReminders()
const
96 return CalendarSupport::KCalPrefs::instance()->defaultTodoReminders();
99bool KOrganizerEditorConfig::defaultEventReminders()
const
101 return CalendarSupport::KCalPrefs::instance()->defaultEventReminders();
108 return CalendarSupport::KCalPrefs::instance()->mEventTemplates;
111 return CalendarSupport::KCalPrefs::instance()->mTodoTemplates;
114 return CalendarSupport::KCalPrefs::instance()->mJournalTemplates;
116 return EditorConfig::templates(type);
QList< Organizer > allOrganizers() const override
Returns all email addresses together with the full username for the user.
QString fullName() const override
Return the own full name.
QStringList allEmails() const override
Returns all email addresses for the user.
bool thatIsMe(const QString &email) const override
Return true if the given email belongs to the user.
QString email() const override
Return the own mail address.
bool showTimeZoneSelectorInIncidenceEditor() const override
Show timezone selectors in the event and todo editor dialog.
static IdentityManager * self()
QUrl fromLocalFile(const QString &localFile)