author | insilmaril |
Mon Aug 04 13:35:54 2008 +0000 (2008-08-04) | |
changeset 724 | cf14046909cd |
parent 642 | d35bd2241fd1 |
child 726 | 7f43b93242aa |
permissions | -rw-r--r-- |
1 #ifndef SELECTION_H
2 #define SELECTION_H
4 #include <QString>
5 #include <QList>
6 #include <QGraphicsScene>
9 class BranchObj;
10 class FloatImageObj;
11 class MapCenterObj;
12 class LinkableMapObj;
13 class VymModel;
16 class Selection
17 {
18 public:
19 enum Type {Undefined,Branch,MapCenter,FloatImage};
20 Selection ();
21 ~Selection();
22 void copy(const Selection&);
23 void clear();
24 void setModel (VymModel *);
25 void update();
26 void setColor (QColor c);
27 QColor getColor ();
28 bool select (LinkableMapObj*);
29 bool select (const QString &);
30 bool reselect ();
31 void unselect ();
32 bool isBlocked ();
33 void block();
34 void unblock();
35 bool isEmpty();
36 uint count();
37 Type type();
38 LinkableMapObj * first(); // first in selection list
39 LinkableMapObj * single(); // NULL, if multiple selected
40 BranchObj* getBranch();
41 FloatImageObj* getFloatImage();
43 QString getSelectString();
45 private:
46 void init();
47 QList <LinkableMapObj*> selectList;
48 QList <LinkableMapObj*> lastSelectList;
49 QList <QGraphicsRectItem*> selboxList;
50 VymModel *model;
51 QGraphicsScene *scene;
53 QColor color;
54 bool blocked; //!< if true, no new selection possible
55 };
57 #endif