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