author | insilmaril |
Wed Feb 27 16:09:06 2008 +0000 (2008-02-27) | |
changeset 674 | 94cf31acc272 |
parent 492 | cf60b90369a4 |
child 721 | 12958f987bcf |
permissions | -rw-r--r-- |
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@0 | 32 |
bool isEmpty(); |
insilmaril@0 | 33 |
uint count(); |
insilmaril@492 | 34 |
Type type(); |
insilmaril@424 | 35 |
LinkableMapObj * first(); // first in selection list |
insilmaril@424 | 36 |
LinkableMapObj * single(); // NULL, if multiple selected |
insilmaril@424 | 37 |
BranchObj* getBranch(); |
insilmaril@424 | 38 |
FloatImageObj* getFloatImage(); |
insilmaril@0 | 39 |
|
insilmaril@364 | 40 |
QString getSelectString(); |
insilmaril@364 | 41 |
|
insilmaril@0 | 42 |
private: |
insilmaril@364 | 43 |
void init(); |
insilmaril@364 | 44 |
QList <LinkableMapObj*> selectList; |
insilmaril@421 | 45 |
QList <LinkableMapObj*> lastSelectList; |
insilmaril@440 | 46 |
QList <QGraphicsRectItem*> selboxList; |
insilmaril@642 | 47 |
VymModel *model; |
insilmaril@440 | 48 |
QGraphicsScene *scene; |
insilmaril@440 | 49 |
|
insilmaril@440 | 50 |
QColor color; |
insilmaril@0 | 51 |
}; |
insilmaril@0 | 52 |
#endif |
insilmaril@0 | 53 |