selection.h
author insilmaril
Tue Oct 16 09:53:22 2007 +0000 (2007-10-16)
changeset 601 54475d6f006a
parent 440 c6a8651e6bbc
child 642 d35bd2241fd1
permissions -rw-r--r--
included <typeinfo>
     1 #ifndef SELECTION_H
     2 #define SELECTION_H
     3 
     4 #include <QString>
     5 #include <QList>
     6 #include <QGraphicsScene>
     7 
     8 
     9 class MapEditor;
    10 class BranchObj;
    11 class FloatImageObj;
    12 class MapCenterObj;
    13 class LinkableMapObj;
    14 
    15 
    16 
    17 
    18 class Selection 
    19 {
    20 public:
    21 	enum Type {Undefined,Branch,MapCenter,FloatImage};
    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 	Type type();
    37 	LinkableMapObj * first();		// first in selection list
    38 	LinkableMapObj * single();		// NULL, if multiple selected
    39 	BranchObj* getBranch();
    40 	FloatImageObj* getFloatImage();
    41 
    42 	QString getSelectString();
    43 
    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;
    52 
    53 	QColor color;
    54 };
    55 #endif
    56