9#include <Akonadi/Collection>
10#include <Akonadi/CollectionCalendar>
11#include <Akonadi/Item>
15#include <QGraphicsScene>
16#include <QGraphicsView>
21class IncidenceChanger;
35 enum ActionType { None, Move, Resize };
38 enum ResizeType { ResizeLeft, ResizeRight };
41 ~MonthScene()
override;
43 [[nodiscard]]
int columnWidth()
const;
44 [[nodiscard]]
int rowHeight()
const;
46 MonthCell *firstCellForMonthItem(MonthItem *manager);
47 [[nodiscard]]
int height(MonthItem *manager);
48 [[nodiscard]]
int itemHeight();
49 [[nodiscard]]
int itemHeightIncludingSpacing();
53 [[nodiscard]]
MonthView *monthView()
const
60 [[nodiscard]]
bool initialized()
const
65 void setInitialized(
bool i)
71 Akonadi::IncidenceChanger *incidenceChanger()
const;
73 [[nodiscard]]
int totalHeight();
79 [[nodiscard]]
int cellVerticalPos(
const MonthCell *cell)
const;
84 [[nodiscard]]
int cellHorizontalPos(
const MonthCell *cell)
const;
91 void selectItem(MonthItem *);
92 [[nodiscard]]
int maxRowCount();
94 MonthCell *selectedCell()
const;
95 MonthCell *previousCell()
const;
100 [[nodiscard]]
int getRightSpan(
QDate date)
const;
105 [[nodiscard]]
int getLeftSpan(
QDate date)
const;
110 [[nodiscard]]
QDate firstDateOnRow(
int row)
const;
115 void updateGeometry();
122 [[nodiscard]]
int startHeight()
const
132 void setStartHeight(
int height)
140 [[nodiscard]] ResizeType resizeType()
const
148 MonthItem *selectedItem()
150 return mSelectedItem;
153 [[nodiscard]]
QPixmap birthdayPixmap()
const
155 return mBirthdayPixmap;
158 [[nodiscard]]
QPixmap anniversaryPixmap()
const
160 return mAnniversaryPixmap;
163 [[nodiscard]]
QPixmap alarmPixmap()
const
168 [[nodiscard]]
QPixmap recurPixmap()
const
173 [[nodiscard]]
QPixmap readonlyPixmap()
const
175 return mReadonlyPixmap;
178 [[nodiscard]]
QPixmap replyPixmap()
const
183 [[nodiscard]]
QPixmap holidayPixmap()
const
185 return mHolidayPixmap;
191 void removeIncidence(
const QString &uid);
195 void showIncidencePopupSignal(
const Akonadi::CollectionCalendar::Ptr &,
const Akonadi::Item &,
const QDate &);
196 void newEventSignal();
197 void showNewEventPopupSignal();
210 virtual void scrollCellsUp();
215 virtual void scrollCellsDown();
221 virtual void clickOnScrollIndicator(ScrollIndicator *scrollItem);
231 bool lastItemFit(MonthCell *cell);
237 [[nodiscard]]
int headerHeight()
const;
239 [[nodiscard]]
int availableWidth()
const;
244 [[nodiscard]]
int availableHeight()
const;
250 [[nodiscard]]
int sceneXToMonthGridX(
int xScene);
256 int sceneYToMonthGridY(
int yScene);
262 MonthCell *getCellFromPos(
QPointF pos);
267 bool isInMonthGrid(
int x,
int y)
const;
272 MonthItem *mClickedItem =
nullptr;
273 MonthItem *mActionItem =
nullptr;
274 bool mActionInitiated;
276 MonthItem *mSelectedItem =
nullptr;
277 QDate mSelectedCellDate;
278 MonthCell *mStartCell =
nullptr;
279 MonthCell *mPreviousCell =
nullptr;
281 ActionType mActionType;
282 ResizeType mResizeType;
301 ScrollIndicator *mCurrentIndicator =
nullptr;
302 friend class MonthGraphicsView;
319 void setScene(MonthScene *
scene);
330 MonthScene *mScene =
nullptr;
void setActionCursor(MonthScene::ActionType actionType)
Change the cursor according to actionType.
void drawBackground(QPainter *painter, const QRectF &rect) override
Draws the cells.
Namespace EventViews provides facilities for displaying incidences, including events,...
qreal height() const const
QGraphicsScene * scene() const const
QObject * parent() const const