#ifndef BLOCKBASE_H
#define BLOCKBASE_H

#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QGraphicsObject>
#include <QGraphicsEllipseItem>
#include <QGraphicsSceneHoverEvent>
#include <QGraphicsSceneMouseEvent>
#include <QStack>
#include "propertystorage.h"


/// data:
/// 1002 - flag for move parent (true)
/// 1003 - flag for visualize selection (true)
/// 1004 - BlockItemPin ("pin")
/// 1005 - BlockBusItem ("connection")
/// 1006 - BlockItem ("item")
/// 1007 - BlockItem selection ("item_selection")
/// 1008 - item is NOT decor, ignore for function decors() (true)
/// 1009 - item is scene decor ("decor")
/// 1010 - BlockItem decor (src text for QGraphicsSimpleTextItem)
/// 1011 - item is BlockItem decor ("decor")
/// 1100 - flag for correct move (true)

static const int _blockitem_current_version_ = 1;


QDataStream & operator <<(QDataStream & s, const QGraphicsItem * item);
QDataStream & operator >>(QDataStream & s, QGraphicsItem *& item);


class BlockItemBase: public QObject
{
	Q_OBJECT
	Q_ENUMS(Action)
public:
	
	enum Action {
		BlockAdd = 1,
		BlockMove,
		BlockRemove,
		BlockCopy,
		BusAdd,
		BusRemove,
		BusPointAdd,
		BusPointMove,
		BusPointRemove,
		BusSegmentAdd,
		BusSegmentMove,
		BusSegmentRemove,
		Paste
	};
	
};

#endif // BLOCKBASE_H
