2 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 Copyright (C) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
5 Author: Kevin Krammer, krake@kdab.com
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution.
25 #ifndef EVENTVIEWS_PREFS_H
26 #define EVENTVIEWS_PREFS_H
28 #include "eventviews_export.h"
29 #include "eventview.h"
31 #include <KConfigSkeleton>
37 class EVENTVIEWS_EXPORT Prefs
41 Creates an instance of Prefs with just base config
46 Creates an instance of Prefs with base config and application Q_DECL_OVERRIDE config
48 The passed @p appConfig will be queried for matching items whenever one of the
49 accessors is called. If one is found it is used for setting/getting the value
50 otherwise the one from the eventviews base config is used.
52 explicit Prefs(KCoreConfigSkeleton
*appConfig
);
60 void setMarcusBainsShowSeconds(bool showSeconds
);
61 bool marcusBainsShowSeconds() const;
63 void setAgendaMarcusBainsLineLineColor(const QColor
&color
);
64 QColor
agendaMarcusBainsLineLineColor() const;
66 void setMarcusBainsEnabled(bool enabled
);
67 bool marcusBainsEnabled() const;
69 void setAgendaMarcusBainsLineFont(const QFont
&font
);
70 QFont
agendaMarcusBainsLineFont() const;
72 void setHourSize(int size
);
75 void setDayBegins(const QDateTime
&dateTime
);
76 QDateTime
dayBegins() const;
78 void setWorkingHoursStart(const QDateTime
&dateTime
);
79 QDateTime
workingHoursStart() const;
81 void setWorkingHoursEnd(const QDateTime
&dateTime
);
82 QDateTime
workingHoursEnd() const;
84 void setSelectionStartsEditor(bool startEditor
);
85 bool selectionStartsEditor() const;
87 void setAgendaGridWorkHoursBackgroundColor(const QColor
&color
);
88 QColor
agendaGridWorkHoursBackgroundColor() const;
90 void setAgendaGridHighlightColor(const QColor
&color
);
91 QColor
agendaGridHighlightColor() const;
93 void setAgendaGridBackgroundColor(const QColor
&color
);
94 QColor
agendaGridBackgroundColor() const;
96 void setEnableAgendaItemIcons(bool enable
);
97 bool enableAgendaItemIcons() const;
99 void setTodosUseCategoryColors(bool useColors
);
100 bool todosUseCategoryColors() const;
102 void setAgendaHolidaysBackgroundColor(const QColor
&color
) const;
103 QColor
agendaHolidaysBackgroundColor() const;
105 void setAgendaViewColors(int colors
);
106 int agendaViewColors() const;
108 void setAgendaViewFont(const QFont
&font
);
109 QFont
agendaViewFont() const;
111 void setMonthViewFont(const QFont
&font
);
112 QFont
monthViewFont() const;
114 QColor
monthGridBackgroundColor() const;
115 void setMonthGridBackgroundColor(const QColor
&color
);
117 QColor
monthGridWorkHoursBackgroundColor() const;
118 void monthGridWorkHoursBackgroundColor(const QColor
&color
);
120 void setMonthViewColors(int colors
) const;
121 int monthViewColors() const;
123 bool enableMonthItemIcons() const;
124 void setEnableMonthItemIcons(bool enable
);
126 bool showTimeInMonthView() const;
127 void setShowTimeInMonthView(bool show
);
129 bool showTodosMonthView() const;
130 void setShowTodosMonthView(bool show
);
132 bool showJournalsMonthView() const;
133 void setShowJournalsMonthView(bool show
);
135 bool fullViewMonth() const;
136 void setFullViewMonth(bool fullView
);
138 bool sortCompletedTodosSeparately() const;
139 void setSortCompletedTodosSeparately(bool sort
);
141 void setEnableToolTips(bool enable
);
142 bool enableToolTips() const;
144 void setShowTodosAgendaView(bool show
);
145 bool showTodosAgendaView() const;
147 void setAgendaTimeLabelsFont(const QFont
&font
);
148 QFont
agendaTimeLabelsFont() const;
150 KConfigSkeleton::ItemFont
*fontItem(const QString
&name
) const;
152 void setResourceColor(const QString
&, const QColor
&);
153 QColor
resourceColor(const QString
&);
154 QColor
resourceColorKnown(const QString
&) const;
156 void setTimeSpec(const KDateTime::Spec
&spec
);
157 KDateTime::Spec
timeSpec() const;
159 QStringList
timeScaleTimezones() const;
160 void setTimeScaleTimezones(const QStringList
&list
);
162 QStringList
selectedPlugins() const;
163 void setSelectedPlugins(const QStringList
&);
165 QStringList
decorationsAtAgendaViewTop() const;
166 void setDecorationsAtAgendaViewTop(const QStringList
&);
168 QStringList
decorationsAtAgendaViewBottom() const;
169 void setDecorationsAtAgendaViewBottom(const QStringList
&);
171 bool colorAgendaBusyDays() const;
172 void setColorAgendaBusyDays(bool enable
);
174 bool colorMonthBusyDays() const;
175 void setColorMonthBusyDays(bool enable
);
177 QColor
viewBgBusyColor() const;
178 void setViewBgBusyColor(const QColor
&);
180 QColor
holidayColor() const;
181 void setHolidayColor(const QColor
&color
);
183 QColor
agendaViewBackgroundColor() const;
184 void setAgendaViewBackgroundColor(const QColor
&color
);
186 QColor
workingHoursColor() const;
187 void setWorkingHoursColor(const QColor
&color
);
189 QColor
todoDueTodayColor() const;
190 void setTodoDueTodayColor(const QColor
&color
);
192 QColor
todoOverdueColor() const;
193 void setTodoOverdueColor(const QColor
&color
);
195 QSet
<EventViews::EventView::ItemIcon
> agendaViewIcons() const;
196 void setAgendaViewIcons(const QSet
<EventViews::EventView::ItemIcon
> &icons
);
198 QSet
<EventViews::EventView::ItemIcon
> monthViewIcons() const;
199 void setMonthViewIcons(const QSet
<EventViews::EventView::ItemIcon
> &icons
);
201 void setFlatListTodo(bool);
202 bool flatListTodo() const;
204 void setFullViewTodo(bool);
205 bool fullViewTodo() const;
207 bool enableTodoQuickSearch() const;
208 void setEnableTodoQuickSearch(bool enable
);
210 bool enableQuickTodo() const;
211 void setEnableQuickTodo(bool enable
);
213 bool highlightTodos() const;
214 void setHighlightTodos(bool);
216 KConfig
*config() const;
217 void createNewColor(QColor
&defColor
, int seed
);
224 typedef QSharedPointer
<Prefs
> PrefsPtr
;