selection.h
author insilmaril
Fri Feb 01 15:28:35 2008 +0000 (2008-02-01)
changeset 664 01c028006e6d
parent 492 cf60b90369a4
child 721 12958f987bcf
permissions -rw-r--r--
Added brasilian translation by Amadeu Júnior
     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