File indexing completed on 2024-04-28 05:11:38

0001 /*
0002   SPDX-FileCopyrightText: 2010 Casey Link <unnamedrambler@gmail.com>
0003   SPDX-FileCopyrightText: 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
0004 
0005   SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include <QDateTime>
0011 #include <QWidget>
0012 
0013 namespace KGantt
0014 {
0015 class DateTimeGrid;
0016 class GraphicsView;
0017 }
0018 
0019 namespace CalendarSupport
0020 {
0021 class FreeBusyItemModel;
0022 }
0023 
0024 class QComboBox;
0025 class QTreeView;
0026 
0027 namespace IncidenceEditorNG
0028 {
0029 class FreeBusyGanttProxyModel;
0030 class RowController;
0031 
0032 class VisualFreeBusyWidget : public QWidget
0033 {
0034     Q_OBJECT
0035 public:
0036     explicit VisualFreeBusyWidget(CalendarSupport::FreeBusyItemModel *model, int spacing = 8, QWidget *parent = nullptr);
0037     ~VisualFreeBusyWidget() override;
0038 
0039 public Q_SLOTS:
0040     void slotUpdateIncidenceStartEnd(const QDateTime &, const QDateTime &);
0041 
0042 Q_SIGNALS:
0043     void dateTimesChanged(const QDateTime &, const QDateTime &);
0044     void manualReload();
0045 
0046 protected Q_SLOTS:
0047     void slotScaleChanged(int);
0048     void slotCenterOnStart();
0049     void slotZoomToTime();
0050     void slotPickDate();
0051     void showAttendeeStatusMenu();
0052     void slotIntervalColorRectangleMoved(const QDateTime &start, const QDateTime &end);
0053 
0054 private:
0055     void splitterMoved();
0056     KGantt::GraphicsView *mGanttGraphicsView = nullptr;
0057     QTreeView *mLeftView = nullptr;
0058     RowController *mRowController = nullptr;
0059     KGantt::DateTimeGrid *mGanttGrid = nullptr;
0060 
0061     QComboBox *mScaleCombo = nullptr;
0062     FreeBusyGanttProxyModel *mModel = nullptr;
0063 
0064     QDateTime mDtStart, mDtEnd;
0065 };
0066 }