selection.h
author insilmaril
Thu, 07 May 2009 08:48:53 +0000
changeset 766 7a71a914afdb
parent 735 84ae10f6e3a3
permissions -rw-r--r--
Started to reanimate flags
     1 #ifndef SELECTION_H
     2 #define SELECTION_H
     3 
     4 #include <QString>
     5 #include <QList>
     6 #include <QGraphicsScene>
     7 #include <QItemSelectionModel>
     8 
     9 #include "treeitem.h"
    10 
    11 class BranchObj;
    12 class FloatImageObj;
    13 class MapCenterObj;
    14 class LinkableMapObj;
    15 class VymModel;
    16 
    17 
    18 class Selection 
    19 {
    20 public:
    21 	enum Type {Undefined,Branch,MapCenter,FloatImage};
    22 	Selection ();
    23 	~Selection();
    24 	void setModel (VymModel *);
    25 	void update();      
    26 	bool select (LinkableMapObj*);
    27 	bool select (const QString &);
    28 	bool reselect ();
    29 	void unselect ();
    30 	bool isBlocked ();
    31 	void block();
    32 	void unblock();
    33 	bool isEmpty();
    34 //	uint count();
    35 //	Type type();
    36 //	LinkableMapObj * first();		// first in selection list
    37 //	LinkableMapObj * single();		// NULL, if multiple selected
    38 //	BranchObj* getBranch();
    39 //	TreeItem* getBranchItem();		
    40 //	QModelIndex getBranchIndex();	//!< Returns index of first selected branch or mapcenter
    41 	FloatImageObj* getFloatImage();
    42 
    43 	QString getSelectString();
    44 
    45 private:
    46 	QList <LinkableMapObj*> selectList;
    47 	QList <LinkableMapObj*> lastSelectList;
    48 
    49 	VymModel *model;
    50 
    51 	QColor color;
    52 	bool blocked;					//!< if true, no new selection possible
    53 };
    54 
    55 #endif
    56