author | insilmaril |
Wed May 02 15:31:17 2007 +0000 (2007-05-02) | |
changeset 481 | 31196a98699c |
parent 424 | d886c77ac0fe |
child 492 | cf60b90369a4 |
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 MapEditor; |
insilmaril@440 | 10 |
class BranchObj; |
insilmaril@440 | 11 |
class FloatImageObj; |
insilmaril@440 | 12 |
class MapCenterObj; |
insilmaril@440 | 13 |
class LinkableMapObj; |
insilmaril@440 | 14 |
|
insilmaril@440 | 15 |
|
insilmaril@0 | 16 |
|
insilmaril@421 | 17 |
enum SelectionType {Undefined,Branch,MapCenter,FloatImage}; |
insilmaril@421 | 18 |
|
insilmaril@0 | 19 |
class Selection |
insilmaril@0 | 20 |
{ |
insilmaril@0 | 21 |
public: |
insilmaril@0 | 22 |
Selection (); |
insilmaril@0 | 23 |
~Selection(); |
insilmaril@0 | 24 |
void copy(const Selection&); |
insilmaril@0 | 25 |
void clear(); |
insilmaril@440 | 26 |
void setMapEditor (MapEditor *); |
insilmaril@440 | 27 |
void update(); |
insilmaril@440 | 28 |
void setColor (QColor c); |
insilmaril@440 | 29 |
QColor getColor (); |
insilmaril@0 | 30 |
bool select (LinkableMapObj*); |
insilmaril@364 | 31 |
bool select (const QString &); |
insilmaril@421 | 32 |
bool reselect (); |
insilmaril@364 | 33 |
void unselect (); |
insilmaril@0 | 34 |
bool isEmpty(); |
insilmaril@0 | 35 |
uint count(); |
insilmaril@421 | 36 |
SelectionType type(); |
insilmaril@424 | 37 |
LinkableMapObj * first(); // first in selection list |
insilmaril@424 | 38 |
LinkableMapObj * single(); // NULL, if multiple selected |
insilmaril@424 | 39 |
BranchObj* getBranch(); |
insilmaril@424 | 40 |
FloatImageObj* getFloatImage(); |
insilmaril@0 | 41 |
|
insilmaril@364 | 42 |
QString getSelectString(); |
insilmaril@364 | 43 |
|
insilmaril@0 | 44 |
private: |
insilmaril@364 | 45 |
void init(); |
insilmaril@364 | 46 |
QList <LinkableMapObj*> selectList; |
insilmaril@421 | 47 |
QList <LinkableMapObj*> lastSelectList; |
insilmaril@440 | 48 |
QList <QGraphicsRectItem*> selboxList; |
insilmaril@440 | 49 |
MapEditor *mapEditor; |
insilmaril@364 | 50 |
MapCenterObj *mapCenter; |
insilmaril@440 | 51 |
QGraphicsScene *scene; |
insilmaril@440 | 52 |
|
insilmaril@440 | 53 |
QColor color; |
insilmaril@0 | 54 |
}; |
insilmaril@0 | 55 |
#endif |
insilmaril@0 | 56 |