selection.h
author insilmaril
Mon, 06 Oct 2008 11:10:20 +0000
changeset 726 7f43b93242aa
parent 721 12958f987bcf
child 728 a8a98a94899a
permissions -rw-r--r--
Various fixes, also from 1.12. branch
     1 #ifndef SELECTION_H
     2 #define SELECTION_H
     3 
     4 #include <QString>
     5 #include <QList>
     6 #include <QGraphicsScene>
     7 
     8 #include "treeitem.h"
     9 
    10 class BranchObj;
    11 class FloatImageObj;
    12 class MapCenterObj;
    13 class LinkableMapObj;
    14 class VymModel;
    15 
    16 
    17 class Selection 
    18 {
    19 public:
    20 	enum Type {Undefined,Branch,MapCenter,FloatImage};
    21 	Selection ();
    22 	~Selection();
    23 	void copy(const Selection&);
    24 	void clear();
    25 	void setModel (VymModel *);
    26 	void update();
    27 	void setColor (QColor c);
    28 	QColor getColor ();
    29 	bool select (LinkableMapObj*);
    30 	bool select (const QString &);
    31 	bool reselect ();
    32 	void unselect ();
    33 	bool isBlocked ();
    34 	void block();
    35 	void unblock();
    36 	bool isEmpty();
    37 	uint count();
    38 	Type type();
    39 	LinkableMapObj * first();		// first in selection list
    40 	LinkableMapObj * single();		// NULL, if multiple selected
    41 	BranchObj* getBranch();
    42 	TreeItem* getBranchItem();		
    43 	FloatImageObj* getFloatImage();
    44 
    45 	QString getSelectString();
    46 
    47 private:
    48 	void init();
    49 	QList <LinkableMapObj*> selectList;
    50 	QList <LinkableMapObj*> lastSelectList;
    51 	QList <QGraphicsRectItem*> selboxList;
    52 	VymModel *model;
    53 	QGraphicsScene *scene;
    54 
    55 	QColor color;
    56 	bool blocked;					//!< if true, no new selection possible
    57 };
    58 
    59 #endif
    60