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 void toggleStandardFlag(QString); //FIXME-2 still needed?
30 TreeItem *findMapItem (QPointF p,TreeItem *exclude); //! find item in map at position p. Ignore item exclude
32 AttributeTable* attributeTable();
33 void testFunction1(); // just testing new stuff
34 void testFunction2(); // just testing new stuff
38 void editHeadingFinished();
44 virtual void contextMenuEvent ( QContextMenuEvent *e );
45 virtual void keyPressEvent(QKeyEvent*);
46 virtual void keyReleaseEvent(QKeyEvent*);
47 virtual void mousePressEvent(QMouseEvent*);
48 virtual void mouseMoveEvent(QMouseEvent*);
49 virtual void mouseReleaseEvent(QMouseEvent*);
50 virtual void mouseDoubleClickEvent(QMouseEvent*);
51 virtual void resizeEvent( QResizeEvent * );
53 void dragEnterEvent (QDragEnterEvent *);
54 void dragMoveEvent (QDragMoveEvent *);
55 void dragLeaveEvent (QDragLeaveEvent *);
56 void dropEvent (QDropEvent *);
60 QGraphicsScene *mapScene;
61 VymModel *model; //!< Vym Map, includding several mapCenters
63 bool adjustCanvasRequested; // collect requests until end of user event
64 BranchObj *editingBO; // entering Text into BO
66 QCursor HandOpenCursor; // cursor while moving canvas view
67 QCursor PickColorCursor; // cursor while picking color
68 QCursor CopyCursor; // cursor while picking color
69 QCursor XLinkCursor; // cursor while picking color
71 bool drawingLink; // true while creating a link
72 bool copyingObj; // true while creating a link
75 MapObj* movingObj; // moving a MapObj
76 MapObj* linkingObj_src; // part of a link
77 QPointF movingObj_orgPos; // org. pos of mouse before move
78 QPointF movingObj_orgRelPos; // org. relative pos of mouse before move
79 QPointF movingObj_start; // rel. pos of mouse to absPos
80 QPointF movingCont_start; // inital pos of moving Content or
81 QPointF movingVec; // how far has Content moved
83 QPointF contextMenuPos; // position where context event was triggered
85 QPrinter* printer; // Printing
87 AttributeTable *attrTable;
89 bool printFrame; // Print frame around map
90 bool printFooter; // Print footer below map
92 QPoint exportOffset; // set before export, used in save
94 //////////// Selection related
96 void selectionChanged(const QItemSelection &, const QItemSelection &);
99 QList <QGraphicsRectItem*> selboxList;
100 QColor selectionColor;
103 void updateSelection(const QItemSelection &,const QItemSelection &); // update selection
104 void updateData (const QModelIndex&); // update data
106 void setSelectionColor (QColor c);
107 QColor getSelectionColor ();