Incidenceeditor

korganizereditorconfig.cpp
1/*
2 SPDX-FileCopyrightText: 2010 Kevin Ottens <ervin@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "korganizereditorconfig.h"
8
9#include <CalendarSupport/KCalPrefs>
10
11#include <KIdentityManagementCore/Identity>
12#include <KIdentityManagementCore/IdentityManager>
13
14using namespace IncidenceEditorNG;
15
16KOrganizerEditorConfig::KOrganizerEditorConfig()
17 : EditorConfig()
18{
19}
20
21KOrganizerEditorConfig::~KOrganizerEditorConfig() = default;
22
23KConfigSkeleton *KOrganizerEditorConfig::config() const
24{
25 return CalendarSupport::KCalPrefs::instance();
26}
27
29{
30 return CalendarSupport::KCalPrefs::instance()->fullName();
31}
32
34{
35 return CalendarSupport::KCalPrefs::instance()->email();
36}
37
39{
40 return CalendarSupport::KCalPrefs::instance()->thatIsMe(email);
41}
42
44{
45 return CalendarSupport::KCalPrefs::instance()->allEmails();
46}
47
49{
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()};
54 });
55 return organizers;
56}
57
59{
60 return CalendarSupport::KCalPrefs::instance()->showTimeZoneSelectorInIncidenceEditor();
61}
62
63QDateTime KOrganizerEditorConfig::defaultDuration() const
64{
65 return CalendarSupport::KCalPrefs::instance()->defaultDuration();
66}
67
68QDateTime KOrganizerEditorConfig::startTime() const
69{
70 return CalendarSupport::KCalPrefs::instance()->startTime();
71}
72
73bool KOrganizerEditorConfig::defaultAudioFileReminders() const
74{
75 return CalendarSupport::KCalPrefs::instance()->defaultAudioFileReminders();
76}
77
78QUrl KOrganizerEditorConfig::audioFilePath() const
79{
80 return QUrl::fromLocalFile(CalendarSupport::KCalPrefs::instance()->audioFilePath());
81}
82
83int KOrganizerEditorConfig::reminderTime() const
84{
85 return CalendarSupport::KCalPrefs::instance()->reminderTime();
86}
87
88int KOrganizerEditorConfig::reminderTimeUnits() const
89{
90 return CalendarSupport::KCalPrefs::instance()->reminderTimeUnits();
91}
92
93bool KOrganizerEditorConfig::defaultTodoReminders() const
94{
95 return CalendarSupport::KCalPrefs::instance()->defaultTodoReminders();
96}
97
98bool KOrganizerEditorConfig::defaultEventReminders() const
99{
100 return CalendarSupport::KCalPrefs::instance()->defaultEventReminders();
101}
102
103QStringList &KOrganizerEditorConfig::templates(KCalendarCore::IncidenceBase::IncidenceType type)
104{
106 // TODO remove mEventTemplates+etc from Prefs::instance()
107 return CalendarSupport::KCalPrefs::instance()->mEventTemplates;
108 }
110 return CalendarSupport::KCalPrefs::instance()->mTodoTemplates;
111 }
113 return CalendarSupport::KCalPrefs::instance()->mJournalTemplates;
114 }
115 return EditorConfig::templates(type);
116}
Configuration details.
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)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:37 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.