4 #include <QGraphicsView>
5 #include <QItemSelectionModel>
8 #include "ornamentedobj.h"
13 /*! \brief Main widget in vym to display and edit a map */
15 class MapEditor : public QGraphicsView {
19 MapEditor(VymModel *vm);
22 QGraphicsScene * getScene();
25 void print(); //!< Print the map
26 void setAntiAlias (bool); //!< Set or unset antialiasing
27 void setSmoothPixmap(bool); //!< Set or unset smoothing of pixmaps
29 TreeItem *findMapItem (QPointF p,TreeItem *exclude); //! find item in map at position p. Ignore item exclude
31 AttributeTable* attributeTable();
32 void testFunction1(); // just testing new stuff
33 void testFunction2(); // just testing new stuff
37 void editHeadingFinished();
43 virtual void contextMenuEvent ( QContextMenuEvent *e );
44 virtual void keyPressEvent(QKeyEvent*);
45 virtual void keyReleaseEvent(QKeyEvent*);
46 virtual void mousePressEvent(QMouseEvent*);
47 virtual void mouseMoveEvent(QMouseEvent*);
48 virtual void mouseReleaseEvent(QMouseEvent*);
49 virtual void mouseDoubleClickEvent(QMouseEvent*);
50 virtual void resizeEvent( QResizeEvent * );
52 void dragEnterEvent (QDragEnterEvent *);
53 void dragMoveEvent (QDragMoveEvent *);
54 void dragLeaveEvent (QDragLeaveEvent *);
55 void dropEvent (QDropEvent *);
59 QGraphicsScene *mapScene;
60 VymModel *model; //!< Vym Map, includding several mapCenters
62 bool adjustCanvasRequested; // collect requests until end of user event
63 BranchObj *editingBO; // entering Text into BO
65 QCursor HandOpenCursor; // cursor while moving canvas view
66 QCursor PickColorCursor; // cursor while picking color
67 QCursor CopyCursor; // cursor while picking color
68 QCursor XLinkCursor; // cursor while picking color
70 bool drawingLink; // true while creating a link
71 bool copyingObj; // true while creating a link
74 MapObj* movingObj; // moving a MapObj
75 MapObj* linkingObj_src; // part of a link
76 QPointF movingObj_orgPos; // org. pos of mouse before move
77 QPointF movingObj_orgRelPos; // org. relative pos of mouse before move
78 QPointF movingObj_start; // rel. pos of mouse to absPos
79 QPointF movingCont_start; // inital pos of moving Content or
80 QPointF movingVec; // how far has Content moved
82 QPointF contextMenuPos; // position where context event was triggered
84 QPrinter* printer; // Printing
86 AttributeTable *attrTable;
88 bool printFrame; // Print frame around map
89 bool printFooter; // Print footer below map
91 QPoint exportOffset; // set before export, used in save
93 //////////// Selection related
95 void selectionChanged(const QItemSelection &, const QItemSelection &);
98 QList <QGraphicsRectItem*> selboxList;
99 QColor selectionColor;
102 void updateSelection(const QItemSelection &,const QItemSelection &); // update selection
103 void updateData (const QModelIndex&); // update data
105 void setSelectionColor (QColor c);
106 QColor getSelectionColor ();