9#include "eventviews_export.h"
11#include <Akonadi/CollectionCalendar>
12#include <Akonadi/Item>
13#include <KCalendarCore/Incidence>
20class MonthGraphicsItem;
31 explicit MonthItem(MonthScene *monthWidget);
34 [[nodiscard]]
QWidget *parentWidget()
const;
54 virtual bool greaterThanFallback(
const MonthItem *other)
const;
60 [[nodiscard]]
QDate startDate()
const;
66 [[nodiscard]]
QDate endDate()
const;
71 [[nodiscard]]
int daySpan()
const;
91 void updateGeometry();
100 void updatePosition();
150 void moveBy(
int offsetFromPreviousDate);
156 void moveTo(
QDate date);
162 bool resizeBy(
int offsetFromPreviousDate);
205 void updateMonthGraphicsItems();
212 mSelected = selected;
261 EVENTVIEWS_NO_EXPORT
void setZValue(qreal z);
265 MonthScene *mMonthScene =
nullptr;
267 bool mSelected =
false;
268 bool mMoving =
false;
269 bool mResizing =
false;
270 QDate mOverrideStartDate;
271 int mOverrideDaySpan;
276class EVENTVIEWS_EXPORT IncidenceMonthItem :
public MonthItem
281 IncidenceMonthItem(MonthScene *monthScene,
287 ~IncidenceMonthItem()
override;
294 bool greaterThanFallback(
const MonthItem *other)
const override;
296 QDate realStartDate()
const override;
297 QDate realEndDate()
const override;
298 bool allDay()
const override;
300 bool isMoveable()
const override;
301 bool isResizable()
const override;
303 QString text(
bool end)
const override;
306 QColor bgColor()
const override;
307 QColor frameColor()
const override;
312 void finalizeMove(
const QDate &newStartDate)
override;
313 void finalizeResize(
const QDate &newStartDate,
const QDate &newEndDate)
override;
324 EVENTVIEWS_NO_EXPORT
void updateDates(
int startOffset,
int endOffset);
337 bool mIsEvent, mIsTodo, mIsJournal;
340class EVENTVIEWS_EXPORT HolidayMonthItem :
public MonthItem
345 HolidayMonthItem(MonthScene *monthScene,
QDate date,
const QString &name);
346 HolidayMonthItem(MonthScene *monthScene,
QDate startDate,
QDate endDate,
const QString &name);
347 ~HolidayMonthItem()
override;
349 bool greaterThanFallback(
const MonthItem *other)
const override;
351 QDate realStartDate()
const override
356 QDate realEndDate()
const override
361 bool allDay()
const override
366 bool isMoveable()
const override
371 bool isResizable()
const override
376 QString text(
bool end)
const override
387 QColor bgColor()
const override;
388 QColor frameColor()
const override;
393 void finalizeMove(
const QDate &newStartDate)
override;
394 void finalizeResize(
const QDate &newStartDate,
const QDate &newEndDate)
override;
A month item manages different MonthGraphicsItems.
int position() const
Returns the position of the item ( > 0 ).
void setSelected(bool selected)
Sets the selection state of this item.
virtual void finalizeResize(const QDate &newStartDate, const QDate &newEndDate)=0
Called after a resize operation.
bool isMoving() const
Returns true if the item is being moved.
virtual QColor frameColor() const =0
Returns the frame color of the item.
MonthScene * monthScene() const
Returns the associated month scene to this item.
virtual bool allDay() const =0
True if this item last all the day.
virtual bool isMoveable() const =0
Returns true if the item can be moved.
virtual QDate realEndDate() const =0
This is the real end date, usually the end date of the incidence.
virtual QColor bgColor() const =0
Returns the background color of the item.
virtual QString toolTipText(const QDate &date) const =0
Returns the text for the tooltip of the item.
bool selected() const
Returns true if this item is selected.
virtual QList< QPixmap > icons() const =0
Returns a list of pixmaps to draw next to the items.
bool isResizing() const
Returns true if the item is being resized.
virtual QString text(bool end) const =0
Returns the text to draw in an item.
virtual void finalizeMove(const QDate &newStartDate)=0
Called after a move operation.
virtual bool isResizable() const =0
Returns true if the item can be resized.
virtual QDate realStartDate() const =0
This is the real start date, usually the start date of the incidence.
Namespace EventViews provides facilities for displaying incidences, including events,...