9#include <Akonadi/Collection>
10#include <Akonadi/CollectionCalendar>
11#include <Akonadi/Item>
15#include <QGraphicsScene>
16#include <QGraphicsView>
21class IncidenceChanger;
31class MonthScene :
public QGraphicsScene
47 explicit MonthScene(MonthView *
parent);
48 ~MonthScene()
override;
50 [[nodiscard]]
int columnWidth()
const;
51 [[nodiscard]]
int rowHeight()
const;
53 MonthCell *firstCellForMonthItem(MonthItem *manager);
54 [[nodiscard]]
int height(MonthItem *manager);
55 [[nodiscard]]
int itemHeight();
56 [[nodiscard]]
int itemHeightIncludingSpacing();
57 QList<MonthItem *> mManagerList;
58 MonthView *mMonthView =
nullptr;
60 [[nodiscard]] MonthView *monthView()
const
65 QMap<QDate, MonthCell *> mMonthCellMap;
67 [[nodiscard]]
bool initialized()
const
72 void setInitialized(
bool i)
78 Akonadi::IncidenceChanger *incidenceChanger()
const;
80 [[nodiscard]]
int totalHeight();
86 [[nodiscard]]
int cellVerticalPos(
const MonthCell *cell)
const;
91 [[nodiscard]]
int cellHorizontalPos(
const MonthCell *cell)
const;
98 void selectItem(MonthItem *);
99 [[nodiscard]]
int maxRowCount();
101 MonthCell *selectedCell()
const;
102 MonthCell *previousCell()
const;
107 [[nodiscard]]
int getRightSpan(QDate date)
const;
112 [[nodiscard]]
int getLeftSpan(QDate date)
const;
117 [[nodiscard]] QDate firstDateOnRow(
int row)
const;
122 void updateGeometry();
129 [[nodiscard]]
int startHeight()
const
139 void setStartHeight(
int height)
141 mStartHeight = height;
147 [[nodiscard]] ResizeType resizeType()
const
155 MonthItem *selectedItem()
157 return mSelectedItem;
160 [[nodiscard]] QPixmap birthdayPixmap()
const
162 return mBirthdayPixmap;
165 [[nodiscard]] QPixmap anniversaryPixmap()
const
167 return mAnniversaryPixmap;
170 [[nodiscard]] QPixmap alarmPixmap()
const
175 [[nodiscard]] QPixmap recurPixmap()
const
180 [[nodiscard]] QPixmap readonlyPixmap()
const
182 return mReadonlyPixmap;
185 [[nodiscard]] QPixmap replyPixmap()
const
190 [[nodiscard]] QPixmap holidayPixmap()
const
192 return mHolidayPixmap;
198 void removeIncidence(
const QString &uid);
201 void incidenceSelected(
const Akonadi::Item &incidence,
const QDate &);
203 void newEventSignal();
204 void showNewEventPopupSignal();
207 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *mouseEvent)
override;
208 void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent)
override;
209 void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)
override;
210 void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent)
override;
211 void wheelEvent(QGraphicsSceneWheelEvent *wheelEvent)
override;
212 void timerEvent(QTimerEvent *e)
override;
213 void helpEvent(QGraphicsSceneHelpEvent *helpEvent)
override;
217 virtual void scrollCellsUp();
222 virtual void scrollCellsDown();
228 virtual void clickOnScrollIndicator(ScrollIndicator *scrollItem);
238 bool lastItemFit(MonthCell *cell);
244 [[nodiscard]]
int headerHeight()
const;
246 [[nodiscard]]
int availableWidth()
const;
251 [[nodiscard]]
int availableHeight()
const;
257 [[nodiscard]]
int sceneXToMonthGridX(
int xScene);
263 int sceneYToMonthGridY(
int yScene);
269 MonthCell *getCellFromPos(QPointF pos);
274 bool isInMonthGrid(
int x,
int y)
const;
279 MonthItem *mClickedItem =
nullptr;
280 MonthItem *mActionItem =
nullptr;
281 bool mActionInitiated;
283 MonthItem *mSelectedItem =
nullptr;
284 QDate mSelectedCellDate;
285 MonthCell *mStartCell =
nullptr;
286 MonthCell *mPreviousCell =
nullptr;
288 ActionType mActionType;
289 ResizeType mResizeType;
296 QPixmap mEventPixmap;
297 QPixmap mBirthdayPixmap;
298 QPixmap mAnniversaryPixmap;
300 QPixmap mTodoDonePixmap;
301 QPixmap mJournalPixmap;
302 QPixmap mAlarmPixmap;
303 QPixmap mRecurPixmap;
304 QPixmap mReadonlyPixmap;
305 QPixmap mReplyPixmap;
306 QPixmap mHolidayPixmap;
307 QBasicTimer repeatTimer;
308 ScrollIndicator *mCurrentIndicator =
nullptr;
309 friend class MonthGraphicsView;
326 void setScene(MonthScene *
scene);
337 MonthScene *mScene =
nullptr;
Keeps information about a month cell.
void setActionCursor(MonthScene::ActionType actionType)
Change the cursor according to actionType.
void drawBackground(QPainter *painter, const QRectF &rect) override
Draws the cells.
A month item manages different MonthGraphicsItems.
QSharedPointer< Calendar > Ptr
Namespace EventViews provides facilities for displaying incidences, including events,...
qreal height() const const
QGraphicsView(QGraphicsScene *scene, QWidget *parent)
QGraphicsScene * scene() const const
QObject * parent() const const