Eventviews

prefs.h
1/*
2 SPDX-FileCopyrightText: 2000, 2001 Cornelius Schumacher <schumacher@kde.org>
3 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
4 SPDX-FileContributor: Kevin Krammer <krake@kdab.com>
5
6 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
7*/
8#pragma once
9
10#include "eventview.h"
11#include "eventviews_export.h"
12
13#include <KConfigSkeleton>
14
15#include <QTimeZone>
16
17#include <memory>
18
19namespace EventViews
20{
21class PrefsPrivate;
22
23class EVENTVIEWS_EXPORT Prefs
24{
25public:
26 /**
27 Creates an instance of Prefs with just base config
28 */
29 Prefs();
30
31 /**
32 Creates an instance of Prefs with base config and application override config
33
34 The passed @p appConfig will be queried for matching items whenever one of the
35 accessors is called. If one is found it is used for setting/getting the value
36 otherwise the one from the eventviews base config is used.
37 */
38 explicit Prefs(KCoreConfigSkeleton *appConfig);
39
40 ~Prefs();
41
42 void readConfig();
43 void writeConfig();
44
45public:
46 void setMarcusBainsShowSeconds(bool showSeconds);
47 [[nodiscard]] bool marcusBainsShowSeconds() const;
48
49 void setAgendaMarcusBainsLineLineColor(const QColor &color);
50 [[nodiscard]] QColor agendaMarcusBainsLineLineColor() const;
51
52 void setMarcusBainsEnabled(bool enabled);
53 [[nodiscard]] bool marcusBainsEnabled() const;
54
55 void setAgendaMarcusBainsLineFont(const QFont &font);
56 [[nodiscard]] QFont agendaMarcusBainsLineFont() const;
57
58 void setHourSize(int size);
59 [[nodiscard]] int hourSize() const;
60
61 void setDayBegins(const QDateTime &dateTime);
62 [[nodiscard]] QDateTime dayBegins() const;
63
64 void setWorkingHoursStart(const QDateTime &dateTime);
65 [[nodiscard]] QDateTime workingHoursStart() const;
66
67 void setWorkingHoursEnd(const QDateTime &dateTime);
68 [[nodiscard]] QDateTime workingHoursEnd() const;
69
70 void setSelectionStartsEditor(bool startEditor);
71 [[nodiscard]] bool selectionStartsEditor() const;
72
73 void setUseSystemColor(bool useSystemColor);
74 [[nodiscard]] bool useSystemColor() const;
75
76 void setAgendaGridWorkHoursBackgroundColor(const QColor &color);
77 [[nodiscard]] QColor agendaGridWorkHoursBackgroundColor() const;
78
79 void setAgendaGridHighlightColor(const QColor &color);
80 [[nodiscard]] QColor agendaGridHighlightColor() const;
81
82 void setAgendaGridBackgroundColor(const QColor &color);
83 [[nodiscard]] QColor agendaGridBackgroundColor() const;
84
85 void setEnableAgendaItemIcons(bool enable);
86 [[nodiscard]] bool enableAgendaItemIcons() const;
87
88 void setTodosUseCategoryColors(bool useColors);
89 [[nodiscard]] bool todosUseCategoryColors() const;
90
91 void setAgendaHolidaysBackgroundColor(const QColor &color) const;
92 [[nodiscard]] QColor agendaHolidaysBackgroundColor() const;
93
94 void setAgendaViewColors(int colors);
95 [[nodiscard]] int agendaViewColors() const;
96
97 void setAgendaViewFont(const QFont &font);
98 [[nodiscard]] QFont agendaViewFont() const;
99
100 void setMonthViewFont(const QFont &font);
101 [[nodiscard]] QFont monthViewFont() const;
102
103 [[nodiscard]] QColor monthGridBackgroundColor() const;
104 void setMonthGridBackgroundColor(const QColor &color);
105
106 [[nodiscard]] QColor monthGridWorkHoursBackgroundColor() const;
107 void monthGridWorkHoursBackgroundColor(const QColor &color);
108
109 void setMonthViewColors(int colors) const;
110 [[nodiscard]] int monthViewColors() const;
111
112 [[nodiscard]] bool enableMonthItemIcons() const;
113 void setEnableMonthItemIcons(bool enable);
114
115 [[nodiscard]] bool showTimeInMonthView() const;
116 void setShowTimeInMonthView(bool show);
117
118 [[nodiscard]] bool showTodosMonthView() const;
119 void setShowTodosMonthView(bool show);
120
121 [[nodiscard]] bool showJournalsMonthView() const;
122 void setShowJournalsMonthView(bool show);
123
124 [[nodiscard]] bool fullViewMonth() const;
125 void setFullViewMonth(bool fullView);
126
127 [[nodiscard]] bool sortCompletedTodosSeparately() const;
128 void setSortCompletedTodosSeparately(bool sort);
129
130 void setEnableToolTips(bool enable);
131 [[nodiscard]] bool enableToolTips() const;
132
133 void setShowTodosAgendaView(bool show);
134 [[nodiscard]] bool showTodosAgendaView() const;
135
136 void setAgendaTimeLabelsFont(const QFont &font);
137 [[nodiscard]] QFont agendaTimeLabelsFont() const;
138
139 KConfigSkeleton::ItemFont *fontItem(const QString &name) const;
140
141 void setResourceColor(const QString &, const QColor &);
142 [[nodiscard]] QColor resourceColor(const QString &);
143 [[nodiscard]] QColor resourceColorKnown(const QString &) const;
144
145 [[nodiscard]] QTimeZone timeZone() const;
146
147 [[nodiscard]] QStringList timeScaleTimezones() const;
148 void setTimeScaleTimezones(const QStringList &list);
149
150 [[nodiscard]] QStringList selectedPlugins() const;
151 void setSelectedPlugins(const QStringList &);
152
153 [[nodiscard]] QStringList decorationsAtAgendaViewTop() const;
154 void setDecorationsAtAgendaViewTop(const QStringList &);
155
156 [[nodiscard]] QStringList decorationsAtAgendaViewBottom() const;
157 void setDecorationsAtAgendaViewBottom(const QStringList &);
158
159 [[nodiscard]] bool colorAgendaBusyDays() const;
160 void setColorAgendaBusyDays(bool enable);
161
162 [[nodiscard]] bool colorMonthBusyDays() const;
163 void setColorMonthBusyDays(bool enable);
164
165 [[nodiscard]] QColor viewBgBusyColor() const;
166 void setViewBgBusyColor(const QColor &);
167
168 [[nodiscard]] QColor holidayColor() const;
169 void setHolidayColor(const QColor &color);
170
171 [[nodiscard]] QColor agendaViewBackgroundColor() const;
172 void setAgendaViewBackgroundColor(const QColor &color);
173
174 [[nodiscard]] QColor workingHoursColor() const;
175 void setWorkingHoursColor(const QColor &color);
176
177 [[nodiscard]] QColor todoDueTodayColor() const;
178 void setTodoDueTodayColor(const QColor &color);
179
180 [[nodiscard]] QColor todoOverdueColor() const;
181 void setTodoOverdueColor(const QColor &color);
182
183 [[nodiscard]] QSet<EventViews::EventView::ItemIcon> agendaViewIcons() const;
184 void setAgendaViewIcons(const QSet<EventViews::EventView::ItemIcon> &icons);
185
186 [[nodiscard]] QSet<EventViews::EventView::ItemIcon> monthViewIcons() const;
187 void setMonthViewIcons(const QSet<EventViews::EventView::ItemIcon> &icons);
188
189 void setFlatListTodo(bool);
190 [[nodiscard]] bool flatListTodo() const;
191
192 void setFullViewTodo(bool);
193 [[nodiscard]] bool fullViewTodo() const;
194
195 [[nodiscard]] bool enableTodoQuickSearch() const;
196 void setEnableTodoQuickSearch(bool enable);
197
198 [[nodiscard]] bool enableQuickTodo() const;
199 void setEnableQuickTodo(bool enable);
200
201 [[nodiscard]] bool highlightTodos() const;
202 void setHighlightTodos(bool);
203
204 void setFirstDayOfWeek(const int day);
205 [[nodiscard]] int firstDayOfWeek() const;
206
207 KConfig *config() const;
208
209private:
210 std::unique_ptr<PrefsPrivate> const d;
211};
212
213using PrefsPtr = QSharedPointer<Prefs>;
214}
Namespace EventViews provides facilities for displaying incidences, including events,...
Definition agenda.h:33
EVENTVIEWS_EXPORT QColor resourceColor(const Akonadi::Collection &collection, const PrefsPtr &preferences)
This method returns the proper resource / subresource color for the view.
Definition helper.cpp:56
EVENTVIEWS_EXPORT void setResourceColor(const Akonadi::Collection &collection, const QColor &color, const PrefsPtr &preferences)
This method sets the resource color as an Akonadi collection attribute and in the local preferences.
Definition helper.cpp:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.