Incidenceeditor

editorconfig.h
1/*
2 SPDX-FileCopyrightText: 2009 Sebastian Sauer <sebsauer@kdab.net>
3
4 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
5*/
6
7#pragma once
8
9#include "incidenceeditor_export.h"
10
11#include <KCalendarCore/IncidenceBase>
12
13#include <QUrl>
14
15#include <QDateTime>
16#include <QList>
17#include <QStringList>
18
19#include <memory>
20
21class KConfigSkeleton;
22
23namespace IncidenceEditorNG
24{
25class EditorConfigPrivate;
26
27/**
28 * Configuration details. An application can inherit from this class
29 * to provide application specific configurations to the editor.
30 *
31 */
32class INCIDENCEEDITOR_EXPORT EditorConfig
33{
34public:
35 struct Organizer {
36 QString name;
37 QString email;
38 bool sign = false;
39 bool encrypt = false;
40 };
41
43 virtual ~EditorConfig();
44
45 static EditorConfig *instance();
46 static void setEditorConfig(EditorConfig *);
47
48 virtual KConfigSkeleton *config() const = 0;
49
50 /// Return the own full name.
51 [[nodiscard]] virtual QString fullName() const;
52
53 /// Return the own mail address.
54 [[nodiscard]] virtual QString email() const;
55
56 /// Return true if the given email belongs to the user.
57 virtual bool thatIsMe(const QString &email) const;
58
59 /// Returns all email addresses for the user.
60 [[nodiscard]] virtual QStringList allEmails() const;
61
62 /// Returns all email addresses together with the full username for the user.
63 [[nodiscard]] virtual QList<Organizer> allOrganizers() const;
64
65 /// Show timezone selectors in the event and todo editor dialog.
66 [[nodiscard]] virtual bool showTimeZoneSelectorInIncidenceEditor() const;
67
68 [[nodiscard]] virtual QDateTime defaultDuration() const
69 {
70 return QDateTime(QDate(1752, 1, 1), QTime(2, 0));
71 }
72
73 [[nodiscard]] virtual QDateTime startTime() const
74 {
75 return QDateTime(QDate(1752, 1, 1), QTime(10, 0));
76 }
77
78 [[nodiscard]] virtual bool defaultAudioFileReminders() const
79 {
80 return false;
81 }
82
83 [[nodiscard]] virtual QUrl audioFilePath() const
84 {
85 return {};
86 }
87
88 [[nodiscard]] virtual int reminderTime() const
89 {
90 return 15;
91 }
92
93 [[nodiscard]] virtual int reminderTimeUnits() const
94 {
95 return 0;
96 }
97
98 [[nodiscard]] virtual bool defaultTodoReminders() const
99 {
100 return false;
101 }
102
103 [[nodiscard]] virtual bool defaultEventReminders() const
104 {
105 return false;
106 }
107
108 [[nodiscard]] virtual QStringList &templates(KCalendarCore::IncidenceBase::IncidenceType type);
109
110private:
111 std::unique_ptr<EditorConfigPrivate> const d;
112};
113}
Configuration details.
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.