| 1 | /* |
| 2 | * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved. |
| 3 | * |
| 4 | * This file is part of the KGantt library. |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 7 | */ |
| 8 | |
| 9 | #ifndef KGANTTGRAPHICSSCENE_H |
| 10 | #define KGANTTGRAPHICSSCENE_Hcxx . . $ `src/KGantt/kganttgraphicsscene.h:10:9`! |
| 11 | |
| 12 | #include <QDateTime> |
| 13 | #include <QList> |
| 14 | #include <QGraphicsScene> |
| 15 | #include <QModelIndex> |
| 16 | |
| 17 | #include "kganttglobal.h"cxx . . $ `<file>/src/KGantt/kganttglobal.h`/ |
| 18 | |
| 19 | QT_BEGIN_NAMESPACEcxx . . $ `<external>/7770798561591309169/qtconfigmacros.h:103:10`! |
| 20 | class QAbstractProxyModelcxx . . $ QAbstractProxyModel#; |
| 21 | class QItemSelectionModelcxx . . $ QItemSelectionModel#; |
| 22 | class QItemSelectioncxx . . $ QItemSelection#; |
| 23 | class QPrintercxx . . $ QPrinter#; |
| 24 | class QAbstractItemModelcxx . . $ QAbstractItemModel#; |
| 25 | |
| 26 | |
| 27 | /*!\class KGantt::GraphicsScene |
| 28 | * \internal |
| 29 | */ |
| 30 | class QGraphicsSceneMouseEventcxx . . $ QGraphicsSceneMouseEvent#; |
| 31 | QT_END_NAMESPACEcxx . . $ `<external>/7770798561591309169/qtconfigmacros.h:104:10`! |
| 32 | |
| 33 | namespace KGanttcxx . . $ KGantt/ { |
| 34 | class AbstractGridcxx . . $ KGantt/AbstractGrid#; |
| 35 | class AbstractRowControllercxx . . $ KGantt/AbstractRowController#; |
| 36 | class GraphicsItemcxx . . $ KGantt/GraphicsItem#; |
| 37 | class Constraintcxx . . $ KGantt/Constraint#; |
| 38 | class ConstraintModelcxx . . $ KGantt/ConstraintModel#; |
| 39 | class ConstraintGraphicsItemcxx . . $ KGantt/ConstraintGraphicsItem#; |
| 40 | class ItemDelegatecxx . . $ KGantt/ItemDelegate#; |
| 41 | class PrintingContextcxx . . $ KGantt/PrintingContext#; |
| 42 | |
| 43 | class KGANTT_EXPORTcxx . . $ `build/src/KGantt/kgantt_export.h:12:15`! GraphicsScenecxx . . $ KGantt/GraphicsScene# : public QGraphicsScenecxx . . $ QGraphicsScene# { |
| 44 | Q_OBJECTcxx . . $ KGantt/GraphicsScene#tr(75d9f1c324b4579d). |
| 45 | KGANTT_DECLARE_PRIVATE_BASE_POLYMORPHICcxx . . $ KGantt/GraphicsScene#_d.( GraphicsScene ) |
| 46 | public: |
| 47 | explicit GraphicsScenecxx . . $ KGantt/GraphicsScene#GraphicsScene(749de1b6ae65bddd).( QObjectcxx . . $ QObject#* parent = nullptr ); |
| 48 | ~cxx . . $ KGantt/GraphicsScene#`~GraphicsScene`(49f6e7a06ebc5aa8).GraphicsScenecxx . . $ KGantt/GraphicsScene#() override; |
| 49 | |
| 50 | //qreal dateTimeToSceneX( const QDateTime& dt ) const; |
| 51 | //QDateTime sceneXtoDateTime( qreal x ) const; |
| 52 | |
| 53 | static QModelIndexcxx . . $ QModelIndex# mainIndexcxx . . $ KGantt/GraphicsScene#mainIndex(129557fdb51bbc1f).( const QModelIndexcxx . . $ QModelIndex#& idx ); |
| 54 | |
| 55 | /*! Returns the index pointing to the last column |
| 56 | * in the same row as idx. This can be thought of |
| 57 | * as in "inverse" of mainIndex() |
| 58 | */ |
| 59 | static QModelIndexcxx . . $ QModelIndex# dataIndexcxx . . $ KGantt/GraphicsScene#dataIndex(129557fdb51bbc1f).( const QModelIndexcxx . . $ QModelIndex#& idx ); |
| 60 | |
| 61 | QAbstractItemModelcxx . . $ QAbstractItemModel#* modelcxx . . $ KGantt/GraphicsScene#model(c9c1e11e7bd96493).() const; |
| 62 | QAbstractProxyModelcxx . . $ QAbstractProxyModel#* summaryHandlingModelcxx . . $ KGantt/GraphicsScene#summaryHandlingModel(9bbfcb9703c07bc5).() const; |
| 63 | QModelIndexcxx . . $ QModelIndex# rootIndexcxx . . $ KGantt/GraphicsScene#rootIndex(a394cbc57608ce34).() const; |
| 64 | ConstraintModelcxx . . $ KGantt/ConstraintModel#* constraintModelcxx . . $ KGantt/GraphicsScene#constraintModel(90825f1931beb5a4).() const; |
| 65 | QItemSelectionModelcxx . . $ QItemSelectionModel#* selectionModelcxx . . $ KGantt/GraphicsScene#selectionModel(cc7a226abaf79c2f).() const; |
| 66 | |
| 67 | void insertItemcxx . . $ KGantt/GraphicsScene#insertItem(c582df381df1786a).( const QPersistentModelIndexcxx . . $ QPersistentModelIndex#&, GraphicsItemcxx . . $ KGantt/GraphicsItem#* ); |
| 68 | void removeItemcxx . . $ KGantt/GraphicsScene#removeItem(87a6de385263c395).( const QModelIndexcxx . . $ QModelIndex#& ); |
| 69 | using QGraphicsScenecxx . . $ QGraphicsScene#::removeItemcxx . . $ KGantt/GraphicsScene#removeItem(af50d9c5bfd58279).; |
| 70 | GraphicsItemcxx . . $ KGantt/GraphicsItem#* findItemcxx . . $ KGantt/GraphicsScene#findItem(9b1a06b73b84cb83).( const QModelIndexcxx . . $ QModelIndex#& ) const; |
| 71 | GraphicsItemcxx . . $ KGantt/GraphicsItem#* findItemcxx . . $ KGantt/GraphicsScene#findItem(e327fa95911435dc).( const QPersistentModelIndexcxx . . $ QPersistentModelIndex#& ) const; |
| 72 | |
| 73 | void updateItemscxx . . $ KGantt/GraphicsScene#updateItems(49f6e7a06ebc5aa8).(); |
| 74 | void clearItemscxx . . $ KGantt/GraphicsScene#clearItems(49f6e7a06ebc5aa8).(); |
| 75 | void deleteSubtreecxx . . $ KGantt/GraphicsScene#deleteSubtree(87a6de385263c395).( const QModelIndexcxx . . $ QModelIndex#& ); |
| 76 | |
| 77 | ConstraintGraphicsItemcxx . . $ KGantt/ConstraintGraphicsItem#* findConstraintItemcxx . . $ KGantt/GraphicsScene#findConstraintItem(188519f6c985676c).( const Constraintcxx . . $ KGantt/Constraint#& ) const; |
| 78 | QListcxx . . $ QList#<ConstraintGraphicsItemcxx . . $ KGantt/ConstraintGraphicsItem#*> findConstraintItemscxx . . $ KGantt/GraphicsScene#findConstraintItems(13c6ce99dae7d420).( const QModelIndexcxx . . $ QModelIndex#& idx ) const; |
| 79 | |
| 80 | void setItemDelegatecxx . . $ KGantt/GraphicsScene#setItemDelegate(9e436ff417ea0033).( ItemDelegatecxx . . $ KGantt/ItemDelegate#* ); |
| 81 | ItemDelegatecxx . . $ KGantt/ItemDelegate#* itemDelegatecxx . . $ KGantt/GraphicsScene#itemDelegate(3122617d39517061).() const; |
| 82 | |
| 83 | void setRowControllercxx . . $ KGantt/GraphicsScene#setRowController(2073ec49a57a8f52).( AbstractRowControllercxx . . $ KGantt/AbstractRowController#* rc ); |
| 84 | AbstractRowControllercxx . . $ KGantt/AbstractRowController#* rowControllercxx . . $ KGantt/GraphicsScene#rowController(2679d36ca1e65992).() const; |
| 85 | |
| 86 | /** |
| 87 | * Set the grid to @p grid. |
| 88 | * The current grid (if set) is deleted. |
| 89 | * If @p grid is nullptr, the scene reverts to use the default_grid |
| 90 | */ |
| 91 | void setGridcxx . . $ KGantt/GraphicsScene#setGrid(413d216891ff5df1).( AbstractGridcxx . . $ KGantt/AbstractGrid#* grid ); |
| 92 | /** |
| 93 | * @return the grid set with setGrid(). |
| 94 | * Note: Returns nullptr if no grid has been set. |
| 95 | */ |
| 96 | AbstractGridcxx . . $ KGantt/AbstractGrid#* gridcxx . . $ KGantt/GraphicsScene#grid(77dfb56cbae8a51c).() const; |
| 97 | /** |
| 98 | * @return the current grid. |
| 99 | */ |
| 100 | const AbstractGridcxx . . $ KGantt/AbstractGrid# *getGridcxx . . $ KGantt/GraphicsScene#getGrid(cbb1e7ba2dfae9c1).() const; |
| 101 | /** |
| 102 | * @return the grid set with setGrid() |
| 103 | * Note: Returns nullptr if no grid has been set. |
| 104 | * The scene reverts to use the default_grid. |
| 105 | */ |
| 106 | AbstractGridcxx . . $ KGantt/AbstractGrid# *takeGridcxx . . $ KGantt/GraphicsScene#takeGrid(b17cac45d78147c4).(); |
| 107 | |
| 108 | bool isReadOnlycxx . . $ KGantt/GraphicsScene#isReadOnly(50ce9a9e25b4a850).() const; |
| 109 | |
| 110 | void updateRowcxx . . $ KGantt/GraphicsScene#updateRow(87a6de385263c395).( const QModelIndexcxx . . $ QModelIndex#& idx ); |
| 111 | |
| 112 | /*! Creates a new item of type type. |
| 113 | */ |
| 114 | GraphicsItemcxx . . $ KGantt/GraphicsItem#* createItemcxx . . $ KGantt/GraphicsScene#createItem(98c621195fc11694).( ItemTypecxx . . $ KGantt/ItemType# type ) const; |
| 115 | |
| 116 | /* used by GraphicsItem */ |
| 117 | void itemEnteredcxx . . $ KGantt/GraphicsScene#itemEntered(87a6de385263c395).( const QModelIndexcxx . . $ QModelIndex#& ); |
| 118 | void itemPressedcxx . . $ KGantt/GraphicsScene#itemPressed(faa58b626b3af8e0).( const QModelIndexcxx . . $ QModelIndex#& idx, QGraphicsSceneMouseEventcxx . . $ QGraphicsSceneMouseEvent# *event ); |
| 119 | void itemClickedcxx . . $ KGantt/GraphicsScene#itemClicked(87a6de385263c395).( const QModelIndexcxx . . $ QModelIndex#& ); |
| 120 | void itemDoubleClickedcxx . . $ KGantt/GraphicsScene#itemDoubleClicked(87a6de385263c395).( const QModelIndexcxx . . $ QModelIndex#& ); |
| 121 | void setDragSourcecxx . . $ KGantt/GraphicsScene#setDragSource(29f09e9d9e83e6a5).( GraphicsItemcxx . . $ KGantt/GraphicsItem#* item ); |
| 122 | GraphicsItemcxx . . $ KGantt/GraphicsItem#* dragSourcecxx . . $ KGantt/GraphicsScene#dragSource(f6f13862824617f8).() const; |
| 123 | |
| 124 | /* Printing */ |
| 125 | |
| 126 | /*! Print the Gantt chart using \a printer. If \a drawRowLabels |
| 127 | * is true (the default), each row will have it's label printed |
| 128 | * on the left side. If \a drawColumnLabels is true (the |
| 129 | * default), each column will have it's label printed at the |
| 130 | * top side. |
| 131 | * |
| 132 | * This version of print() will print multiple pages. |
| 133 | */ |
| 134 | void printcxx . . $ KGantt/GraphicsScene#print(530d2eb81f1aef45).( QPrintercxx . . $ QPrinter#* printer, bool drawRowLabels = true, bool drawColumnLabels = true ); |
| 135 | |
| 136 | /*! Print part of the Gantt chart from \a start to \a end using \a printer. |
| 137 | * If \a drawRowLabels is true (the default), each row will have it's |
| 138 | * label printed on the left side. If \a drawColumnLabels is true (the |
| 139 | * default), each column will have it's label printed at the |
| 140 | * top side. |
| 141 | * |
| 142 | * This version of print() will print multiple pages. |
| 143 | * |
| 144 | * To print a certain range of a chart with a DateTimeGrid, use |
| 145 | * qreal DateTimeGrid::mapFromDateTime( const QDateTime& dt) const |
| 146 | * to figure out the values for \a start and \a end. |
| 147 | */ |
| 148 | void printcxx . . $ KGantt/GraphicsScene#print(49fc9698420090ad).( QPrintercxx . . $ QPrinter#* printer, qrealcxx . . $ qreal# start, qrealcxx . . $ qreal# end, bool drawRowLabels = true, bool drawColumnLabels = true ); |
| 149 | |
| 150 | /*! Render the GanttView inside the rectangle \a target using the painter \a painter. |
| 151 | * If \a drawRowLabels is true (the default), each row will have it's |
| 152 | * label printed on the left side. If \a drawColumnLabels is true (the |
| 153 | * default), each column will have it's label printed at the |
| 154 | * top side. |
| 155 | */ |
| 156 | void printcxx . . $ KGantt/GraphicsScene#print(fedf25d7f121f7b4).( QPaintercxx . . $ QPainter#* painter, const QRectFcxx . . $ QRectF#& target = QRectFcxx . . $ QRectF#QRectF(ced63f7c635d850d).(), bool drawRowLabels=true, bool drawColumnLabels = true ); |
| 157 | |
| 158 | /*! Render the GanttView inside the rectangle \a target using the painter \a painter. |
| 159 | * If \a drawRowLabels is true (the default), each row will have it's |
| 160 | * label printed on the left side. If \a drawColumnLabels is true (the |
| 161 | * default), each column will have it's label printed at the |
| 162 | * top side. |
| 163 | * |
| 164 | * To print a certain range of a chart with a DateTimeGrid, use |
| 165 | * qreal DateTimeGrid::mapFromDateTime( const QDateTime& dt) const |
| 166 | * to figure out the values for \a start and \a end. |
| 167 | */ |
| 168 | void printcxx . . $ KGantt/GraphicsScene#print(98ed7165408d8d9d).( QPaintercxx . . $ QPainter#* painter, qrealcxx . . $ qreal# start, qrealcxx . . $ qreal# end, const QRectFcxx . . $ QRectF#& target = QRectFcxx . . $ QRectF#QRectF(ced63f7c635d850d).(), bool drawRowLabels=true, bool drawColumnLabels = true ); |
| 169 | |
| 170 | /*! Print the Gantt chart on the \a printer in accordance with the PrintingContext \a context |
| 171 | * |
| 172 | * \see PrintingContext |
| 173 | * |
| 174 | * \since 2.8.0 |
| 175 | */ |
| 176 | void printDiagramcxx . . $ KGantt/GraphicsScene#printDiagram(b76bf4b8e6c67261).( QPrintercxx . . $ QPrinter# *printer, const PrintingContextcxx . . $ KGantt/PrintingContext# &context ); |
| 177 | |
| 178 | Q_SIGNALScxx . . $ `<external>/4830994369567095248/qtmetamacros.h:47:10`!: |
| 179 | void gridChangedcxx . . $ KGantt/GraphicsScene#gridChanged(49f6e7a06ebc5aa8).(); |
| 180 | |
| 181 | void clickedcxx . . $ KGantt/GraphicsScene#clicked(87a6de385263c395).( const QModelIndexcxx . . $ QModelIndex# & index ); |
| 182 | void qrealClickedcxx . . $ KGantt/GraphicsScene#qrealClicked(87a6de385263c395).( const QModelIndexcxx . . $ QModelIndex# & index ); |
| 183 | void enteredcxx . . $ KGantt/GraphicsScene#entered(87a6de385263c395).( const QModelIndexcxx . . $ QModelIndex# & index ); |
| 184 | void pressedcxx . . $ KGantt/GraphicsScene#pressed(87a6de385263c395).( const QModelIndexcxx . . $ QModelIndex# & index ); |
| 185 | |
| 186 | protected: |
| 187 | /*reimp*/ void helpEventcxx . . $ KGantt/GraphicsScene#helpEvent(cb7089a595dd1b77).( QGraphicsSceneHelpEventcxx . . $ QGraphicsSceneHelpEvent# *helpEvent ) override; |
| 188 | /*reimp*/ void drawBackgroundcxx . . $ KGantt/GraphicsScene#drawBackground(72d49ac8d58e3e57).( QPaintercxx . . $ QPainter#* painter, const QRectFcxx . . $ QRectF#& rect ) override; |
| 189 | /*reimp*/ void drawForegroundcxx . . $ KGantt/GraphicsScene#drawForeground(72d49ac8d58e3e57).( QPaintercxx . . $ QPainter#* painter, const QRectFcxx . . $ QRectF#& rect ) override; |
| 190 | |
| 191 | public Q_SLOTScxx . . $ `<external>/4830994369567095248/qtmetamacros.h:46:10`!: |
| 192 | void setModelcxx . . $ KGantt/GraphicsScene#setModel(c6e1f1e42522b780).( QAbstractItemModelcxx . . $ QAbstractItemModel#* ); |
| 193 | void setSummaryHandlingModelcxx . . $ KGantt/GraphicsScene#setSummaryHandlingModel(caa88226a3432de8).( QAbstractProxyModelcxx . . $ QAbstractProxyModel#* ); |
| 194 | void setConstraintModelcxx . . $ KGantt/GraphicsScene#setConstraintModel(a5a989666b54f8cc).( KGanttcxx . . $ KGantt/::ConstraintModelcxx . . $ KGantt/ConstraintModel#* ); |
| 195 | void setRootIndexcxx . . $ KGantt/GraphicsScene#setRootIndex(87a6de385263c395).( const QModelIndexcxx . . $ QModelIndex#& idx ); |
| 196 | void setSelectionModelcxx . . $ KGantt/GraphicsScene#setSelectionModel(3b183ae407394ab8).( QItemSelectionModelcxx . . $ QItemSelectionModel#* selectionmodel ); |
| 197 | void setReadOnlycxx . . $ KGantt/GraphicsScene#setReadOnly(b45ddcbc8423892c).( bool ); |
| 198 | |
| 199 | private Q_SLOTScxx . . $ `<external>/4830994369567095248/qtmetamacros.h:46:10`!: |
| 200 | /* slots for ConstraintModel */ |
| 201 | void slotConstraintAddedcxx . . $ KGantt/GraphicsScene#slotConstraintAdded(897b3d58236881e3).( const KGanttcxx . . $ KGantt/::Constraintcxx . . $ KGantt/Constraint#& ); |
| 202 | void slotConstraintRemovedcxx . . $ KGantt/GraphicsScene#slotConstraintRemoved(897b3d58236881e3).( const KGanttcxx . . $ KGantt/::Constraintcxx . . $ KGantt/Constraint#& ); |
| 203 | void slotGridChangedcxx . . $ KGantt/GraphicsScene#slotGridChanged(49f6e7a06ebc5aa8).(); |
| 204 | void slotSelectionChangedcxx . . $ KGantt/GraphicsScene#slotSelectionChanged(fda080a95bde17c6).(const QItemSelectioncxx . . $ QItemSelection# &selected, const QItemSelectioncxx . . $ QItemSelection# &deselected); |
| 205 | void selectionModelChangedcxx . . $ KGantt/GraphicsScene#selectionModelChanged(c6e1f1e42522b780).(QAbstractItemModelcxx . . $ QAbstractItemModel# *); |
| 206 | |
| 207 | private: |
| 208 | /*\internal |
| 209 | */ |
| 210 | void doPrintcxx . . $ KGantt/GraphicsScene#doPrint(556f2736f1093881).( QPaintercxx . . $ QPainter#* painter, const QRectFcxx . . $ QRectF#& targetRect, |
| 211 | qrealcxx . . $ qreal# start, qrealcxx . . $ qreal# end, |
| 212 | QPrintercxx . . $ QPrinter#* printer, bool drawRowLabels, bool drawColumnLabels ); |
| 213 | |
| 214 | void doPrintScenecxx . . $ KGantt/GraphicsScene#doPrintScene(e565dbf9772d50d0).( QPrintercxx . . $ QPrinter# *printer, QPaintercxx . . $ QPainter# *painter, const QRectFcxx . . $ QRectF#& targetRect, const PrintingContextcxx . . $ KGantt/PrintingContext# &context ); |
| 215 | |
| 216 | void drawLabelsHeadercxx . . $ KGantt/GraphicsScene#drawLabelsHeader(818e35c5881e17).( QPaintercxx . . $ QPainter# *painter, const QRectFcxx . . $ QRectF# &sourceRect, const QRectFcxx . . $ QRectF# &targetRect ); |
| 217 | }; |
| 218 | } |
| 219 | |
| 220 | #endif /* KGANTTGRAPHICSSCENE_H */ |