author | insilmaril |
Sat Mar 31 09:28:27 2007 +0000 (2007-03-31) | |
changeset 442 | dfbc371b7280 |
parent 424 | d886c77ac0fe |
child 492 | cf60b90369a4 |
permissions | -rw-r--r-- |
1 #ifndef SELECTION_H
2 #define SELECTION_H
4 #include <QString>
5 #include <QList>
6 #include <QGraphicsScene>
9 class MapEditor;
10 class BranchObj;
11 class FloatImageObj;
12 class MapCenterObj;
13 class LinkableMapObj;
17 enum SelectionType {Undefined,Branch,MapCenter,FloatImage};
19 class Selection
20 {
21 public:
22 Selection ();
23 ~Selection();
24 void copy(const Selection&);
25 void clear();
26 void setMapEditor (MapEditor *);
27 void update();
28 void setColor (QColor c);
29 QColor getColor ();
30 bool select (LinkableMapObj*);
31 bool select (const QString &);
32 bool reselect ();
33 void unselect ();
34 bool isEmpty();
35 uint count();
36 SelectionType type();
37 LinkableMapObj * first(); // first in selection list
38 LinkableMapObj * single(); // NULL, if multiple selected
39 BranchObj* getBranch();
40 FloatImageObj* getFloatImage();
42 QString getSelectString();
44 private:
45 void init();
46 QList <LinkableMapObj*> selectList;
47 QList <LinkableMapObj*> lastSelectList;
48 QList <QGraphicsRectItem*> selboxList;
49 MapEditor *mapEditor;
50 MapCenterObj *mapCenter;
51 QGraphicsScene *scene;
53 QColor color;
54 };
55 #endif