/**
     *\file creatingSelector.h
     *
     *\brief 用来实现图元创建的selector
     *
     *\author dsc
     */

#ifndef CREATINGSELECTOR_H
#define CREATINGSELECTOR_H

#include "baseSelector.h"
#include "global.h"

enum CreatingMethod
{
    CM_drag,  // drag-to-create (rect, roundRect)
    CM_click, // click-to-place points (polygon)
    CM_place  // single click to place (text)
};

class GraphicsBaseItem;
class CreatingSelector : public BaseSelector
{
    Q_OBJECT

public:
    explicit CreatingSelector(QObject *parent = 0);
    virtual ~CreatingSelector();

public:
    virtual void mousePressEvent(QGraphicsSceneMouseEvent*, DesignerScene*);
    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*, DesignerScene*);
    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*, DesignerScene*);

    void setCreatingItem(GraphicsItemType& type) { m_creatingItemType=type; }

private:
    CreatingMethod       m_creatingMethod;
    GraphicsItemType     m_creatingItemType;
    GraphicsBaseItem*    m_pCreatingItem;
};

#endif
