selection.h
author insilmaril
Mon Aug 04 10:43:06 2008 +0000 (2008-08-04)
changeset 723 11f9124c1cca
parent 642 d35bd2241fd1
child 726 7f43b93242aa
permissions -rw-r--r--
Adding/moving MCO works again
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 BranchObj;
insilmaril@440
    10
class FloatImageObj;
insilmaril@440
    11
class MapCenterObj;
insilmaril@440
    12
class LinkableMapObj;
insilmaril@642
    13
class VymModel;
insilmaril@0
    14
insilmaril@421
    15
insilmaril@0
    16
class Selection 
insilmaril@0
    17
{
insilmaril@0
    18
public:
insilmaril@492
    19
	enum Type {Undefined,Branch,MapCenter,FloatImage};
insilmaril@0
    20
	Selection ();
insilmaril@0
    21
	~Selection();
insilmaril@0
    22
	void copy(const Selection&);
insilmaril@0
    23
	void clear();
insilmaril@642
    24
	void setModel (VymModel *);
insilmaril@440
    25
	void update();
insilmaril@440
    26
	void setColor (QColor c);
insilmaril@440
    27
	QColor getColor ();
insilmaril@0
    28
	bool select (LinkableMapObj*);
insilmaril@364
    29
	bool select (const QString &);
insilmaril@421
    30
	bool reselect ();
insilmaril@364
    31
	void unselect ();
insilmaril@721
    32
	bool isBlocked ();
insilmaril@721
    33
	void block();
insilmaril@721
    34
	void unblock();
insilmaril@0
    35
	bool isEmpty();
insilmaril@0
    36
	uint count();
insilmaril@492
    37
	Type type();
insilmaril@424
    38
	LinkableMapObj * first();		// first in selection list
insilmaril@424
    39
	LinkableMapObj * single();		// NULL, if multiple selected
insilmaril@424
    40
	BranchObj* getBranch();
insilmaril@424
    41
	FloatImageObj* getFloatImage();
insilmaril@0
    42
insilmaril@364
    43
	QString getSelectString();
insilmaril@364
    44
insilmaril@0
    45
private:
insilmaril@364
    46
	void init();
insilmaril@364
    47
	QList <LinkableMapObj*> selectList;
insilmaril@421
    48
	QList <LinkableMapObj*> lastSelectList;
insilmaril@440
    49
	QList <QGraphicsRectItem*> selboxList;
insilmaril@642
    50
	VymModel *model;
insilmaril@440
    51
	QGraphicsScene *scene;
insilmaril@440
    52
insilmaril@440
    53
	QColor color;
insilmaril@721
    54
	bool blocked;					//!< if true, no new selection possible
insilmaril@0
    55
};
insilmaril@721
    56
insilmaril@0
    57
#endif
insilmaril@0
    58