EventViews Namespace
| Header: | #include <EventViews> |
| CMake: | find_package(KPim6 REQUIRED COMPONENTS EventViews)target_link_libraries(mytarget PRIVATE KPim6::EventViews) |
Namespaces
| namespace | CalendarDecoration |
Classes
| class | AgendaView |
| class | EventView |
| class | JournalView |
| class | ListView |
| class | MonthItem |
| class | MonthView |
| class | MultiAgendaView |
| class | Prefs |
| class | TimelineView |
| class | TodoView |
| class | ViewCalendar |
| class | WhatsNextView |
Functions
| QPixmap | cachedSmallIcon(const QString &name) |
| QColor | getTextColor(const QColor &c) |
| bool | isColorDark(const QColor &color) |
| QColor | resourceColor(const Akonadi::Collection &collection, const EventViews::PrefsPtr &preferences) |
| void | setResourceColor(const Akonadi::Collection &collection, const QColor &color, const EventViews::PrefsPtr &preferences) |
| int | yearDiff(QDate start, QDate end) |
Detailed Description
Namespace EventViews provides facilities for displaying incidences, including events, to-dos, and journal entries.
Namespaces
namespace EventViews::CalendarDecoration
Classes
class AgendaView
class EventView
Abstract class from which all event views are derived. Author: Preston Brown <pbrown@kde.org>. More...
class JournalView
View for Journal components. Author: Cornelius Schumacher <schumacher@kde.org>, Reinhold Kainhofer <reinhold@kainhofer.com>. More...
class ListView
multi-column list view of various events. Author: Preston Brown <pbrown@kde.org>. More...
class MonthItem
class MonthView
class MultiAgendaView
class Prefs
The Prefs class. More...
class TimelineView
class TodoView
View for Todo components. * Author: Cornelius Schumacher <schumacher@kde.org>, Reinhold Kainhofer <reinhold@kainhofer.com> *. More...
class ViewCalendar
The ViewCalendar class. More...
class WhatsNextView
Function Documentation
QPixmap EventViews::cachedSmallIcon(const QString &name)
Equivalent to SmallIcon( name ), but uses QPixmapCache. KIconLoader already uses a cache, but it's 20x slower on my tests.
Returns A new pixmap if it isn't yet in cache, otherwise returns the cached one.
QColor EventViews::getTextColor(const QColor &c)
Returns a nice QColor for text, give the input color &c.
bool EventViews::isColorDark(const QColor &color)
Determines if the color is "dark" or "light" by looking at its luminance. idea taken from: https://stackoverflow.com/questions/9780632/how-do-i-determine-if-a-color-is-closer-to-white-or-black
Returns true if the specified color is closer to black than white.
QColor EventViews::resourceColor(const Akonadi::Collection &collection, const EventViews::PrefsPtr &preferences)
This method returns the proper resource / subresource color for the view. If a value is stored in the preferences, we use it, else we try to find a CollectionColorAttribute in the collection. If everything else fails, a random color can be set. It is preferred to use this function instead of the EventViews::Prefs::resourceColor function. Returns The resource color for the incidence. If the incidence belongs to a subresource, the color for the subresource is returned (if set). calendar the calendar for which the resource color should be obtained incidence the incidence for which the color is needed (to determine which subresource needs to be used)
See also setResourceColor().
void EventViews::setResourceColor(const Akonadi::Collection &collection, const QColor &color, const EventViews::PrefsPtr &preferences)
This method sets the resource color as an Akonadi collection attribute and in the local preferences. It is preferred to use this instead of the EventViews::Prefs::setResourceColor function. collection the collection for which the resource color should be stored color the color to stored preferences a pointer to the EventViews::Prefs to use
See also resourceColor().
int EventViews::yearDiff(QDate start, QDate end)
Returns the number of years between the start QDate and the end QDate (i.e. the difference in the year number of both dates)