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{
50 // TODO add activities support here too
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()};
55 });
56 return organizers;
57}
58
60{
61 return CalendarSupport::KCalPrefs::instance()->showTimeZoneSelectorInIncidenceEditor();
62}
63
64QDateTime KOrganizerEditorConfig::defaultDuration() const
65{
66 return CalendarSupport::KCalPrefs::instance()->defaultDuration();
67}
68
69QDateTime KOrganizerEditorConfig::startTime() const
70{
71 return CalendarSupport::KCalPrefs::instance()->startTime();
72}
73
74bool KOrganizerEditorConfig::defaultAudioFileReminders() const
75{
76 return CalendarSupport::KCalPrefs::instance()->defaultAudioFileReminders();
77}
78
79QUrl KOrganizerEditorConfig::audioFilePath() const
80{
81 return QUrl::fromLocalFile(CalendarSupport::KCalPrefs::instance()->audioFilePath());
82}
83
84int KOrganizerEditorConfig::reminderTime() const
85{
86 return CalendarSupport::KCalPrefs::instance()->reminderTime();
87}
88
89int KOrganizerEditorConfig::reminderTimeUnits() const
90{
91 return CalendarSupport::KCalPrefs::instance()->reminderTimeUnits();
92}
93
94bool KOrganizerEditorConfig::defaultTodoReminders() const
95{
96 return CalendarSupport::KCalPrefs::instance()->defaultTodoReminders();
97}
98
99bool KOrganizerEditorConfig::defaultEventReminders() const
100{
101 return CalendarSupport::KCalPrefs::instance()->defaultEventReminders();
102}
103
104QStringList &KOrganizerEditorConfig::templates(KCalendarCore::IncidenceBase::IncidenceType type)
105{
107 // TODO remove mEventTemplates+etc from Prefs::instance()
108 return CalendarSupport::KCalPrefs::instance()->mEventTemplates;
109 }
111 return CalendarSupport::KCalPrefs::instance()->mTodoTemplates;
112 }
114 return CalendarSupport::KCalPrefs::instance()->mJournalTemplates;
115 }
116 return EditorConfig::templates(type);
117}
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-2025 The KDE developers.
Generated on Fri Feb 28 2025 11:59:03 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.