selection.h
author insilmaril
Tue, 08 Apr 2008 08:28:37 +0000
changeset 681 4e558a15a804
parent 642 d35bd2241fd1
child 721 12958f987bcf
permissions -rw-r--r--
1.11.7: Fixed hanging find function
     1 #ifndef SELECTION_H
     2 #define SELECTION_H
     3 
     4 #include <QString>
     5 #include <QList>
     6 #include <QGraphicsScene>
     7 
     8 
     9 class BranchObj;
    10 class FloatImageObj;
    11 class MapCenterObj;
    12 class LinkableMapObj;
    13 class VymModel;
    14 
    15 
    16 class Selection 
    17 {
    18 public:
    19 	enum Type {Undefined,Branch,MapCenter,FloatImage};
    20 	Selection ();
    21 	~Selection();
    22 	void copy(const Selection&);
    23 	void clear();
    24 	void setModel (VymModel *);
    25 	void update();
    26 	void setColor (QColor c);
    27 	QColor getColor ();
    28 	bool select (LinkableMapObj*);
    29 	bool select (const QString &);
    30 	bool reselect ();
    31 	void unselect ();
    32 	bool isEmpty();
    33 	uint count();
    34 	Type type();
    35 	LinkableMapObj * first();		// first in selection list
    36 	LinkableMapObj * single();		// NULL, if multiple selected
    37 	BranchObj* getBranch();
    38 	FloatImageObj* getFloatImage();
    39 
    40 	QString getSelectString();
    41 
    42 private:
    43 	void init();
    44 	QList <LinkableMapObj*> selectList;
    45 	QList <LinkableMapObj*> lastSelectList;
    46 	QList <QGraphicsRectItem*> selboxList;
    47 	VymModel *model;
    48 	QGraphicsScene *scene;
    49 
    50 	QColor color;
    51 };
    52 #endif
    53