selection.h
author insilmaril
Tue, 06 Nov 2007 13:54:41 +0000
changeset 615 497f19b3c1fe
parent 492 cf60b90369a4
child 642 d35bd2241fd1
permissions -rw-r--r--
1.11.1 fixed undo/redo sorting of branches
insilmaril@364
     1
#ifndef SELECTION_H
insilmaril@364
     2
#define SELECTION_H
insilmaril@364
     3
insilmaril@440
     4
#include <QString>
insilmaril@440
     5
#include <QList>
insilmaril@440
     6
#include <QGraphicsScene>
insilmaril@440
     7
insilmaril@440
     8
insilmaril@440
     9
class MapEditor;
insilmaril@440
    10
class BranchObj;
insilmaril@440
    11
class FloatImageObj;
insilmaril@440
    12
class MapCenterObj;
insilmaril@440
    13
class LinkableMapObj;
insilmaril@440
    14
insilmaril@440
    15
insilmaril@0
    16
insilmaril@421
    17
insilmaril@0
    18
class Selection 
insilmaril@0
    19
{
insilmaril@0
    20
public:
insilmaril@492
    21
	enum Type {Undefined,Branch,MapCenter,FloatImage};
insilmaril@0
    22
	Selection ();
insilmaril@0
    23
	~Selection();
insilmaril@0
    24
	void copy(const Selection&);
insilmaril@0
    25
	void clear();
insilmaril@440
    26
	void setMapEditor (MapEditor *);
insilmaril@440
    27
	void update();
insilmaril@440
    28
	void setColor (QColor c);
insilmaril@440
    29
	QColor getColor ();
insilmaril@0
    30
	bool select (LinkableMapObj*);
insilmaril@364
    31
	bool select (const QString &);
insilmaril@421
    32
	bool reselect ();
insilmaril@364
    33
	void unselect ();
insilmaril@0
    34
	bool isEmpty();
insilmaril@0
    35
	uint count();
insilmaril@492
    36
	Type type();
insilmaril@424
    37
	LinkableMapObj * first();		// first in selection list
insilmaril@424
    38
	LinkableMapObj * single();		// NULL, if multiple selected
insilmaril@424
    39
	BranchObj* getBranch();
insilmaril@424
    40
	FloatImageObj* getFloatImage();
insilmaril@0
    41
insilmaril@364
    42
	QString getSelectString();
insilmaril@364
    43
insilmaril@0
    44
private:
insilmaril@364
    45
	void init();
insilmaril@364
    46
	QList <LinkableMapObj*> selectList;
insilmaril@421
    47
	QList <LinkableMapObj*> lastSelectList;
insilmaril@440
    48
	QList <QGraphicsRectItem*> selboxList;
insilmaril@440
    49
	MapEditor *mapEditor;
insilmaril@364
    50
	MapCenterObj *mapCenter;
insilmaril@440
    51
	QGraphicsScene *scene;
insilmaril@440
    52
insilmaril@440
    53
	QColor color;
insilmaril@0
    54
};
insilmaril@0
    55
#endif
insilmaril@0
    56