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();
52 std::transform(manager->begin(), manager->end(), std::back_inserter(organizers), [](
const auto &identity) {
53 return EditorConfig::Organizer{identity.fullName(), identity.fullEmailAddr(), identity.pgpAutoSign(), identity.pgpAutoEncrypt()};
60 return CalendarSupport::KCalPrefs::instance()->showTimeZoneSelectorInIncidenceEditor();
63QDateTime KOrganizerEditorConfig::defaultDuration()
const
65 return CalendarSupport::KCalPrefs::instance()->defaultDuration();
68QDateTime KOrganizerEditorConfig::startTime()
const
70 return CalendarSupport::KCalPrefs::instance()->startTime();
73bool KOrganizerEditorConfig::defaultAudioFileReminders()
const
75 return CalendarSupport::KCalPrefs::instance()->defaultAudioFileReminders();
78QUrl KOrganizerEditorConfig::audioFilePath()
const
83int KOrganizerEditorConfig::reminderTime()
const
85 return CalendarSupport::KCalPrefs::instance()->reminderTime();
88int KOrganizerEditorConfig::reminderTimeUnits()
const
90 return CalendarSupport::KCalPrefs::instance()->reminderTimeUnits();
93bool KOrganizerEditorConfig::defaultTodoReminders()
const
95 return CalendarSupport::KCalPrefs::instance()->defaultTodoReminders();
98bool KOrganizerEditorConfig::defaultEventReminders()
const
100 return CalendarSupport::KCalPrefs::instance()->defaultEventReminders();
107 return CalendarSupport::KCalPrefs::instance()->mEventTemplates;
110 return CalendarSupport::KCalPrefs::instance()->mTodoTemplates;
113 return CalendarSupport::KCalPrefs::instance()->mJournalTemplates;
115 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)