/*
* This file is part of project OpenEmbroidery. It's copyrighted by
* the contributors recorded in the version control history of the file.
* Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
*
* SPDX-License-Identifier: CECILL-2.1
* License-Filename: Licence_CeCILL_V2.1-en.txt
*/

#pragma once

#include "actions/OE_actions.h"
#include "curves/OE_curve.h"
#include "curves/OE_joincurve.h"
#include "curves/OE_subcurve.h"
#include "curves/OE_pointcurve.h"

class OE_actionSelectionAddCurves : public OE_actions
{
	public:
		OE_actionSelectionAddCurves(OE_document* doc, std::list<OE_pointcurve*> curves, bool replace);

		virtual ~OE_actionSelectionAddCurves();

		virtual void undo();
		virtual void redo();

	protected:
		std::list<OE_pointcurve*> actionCurves;
};

class OE_actionSelectionRemoveCurves : public OE_actions
{
	public:
		OE_actionSelectionRemoveCurves(OE_document* doc, std::list<OE_pointcurve*> curves);

		virtual ~OE_actionSelectionRemoveCurves();

		virtual void undo();
		virtual void redo();

	protected:
		std::list<OE_pointcurve*> actionCurves;
};

class OE_actionSelectionClearCurves : public OE_actions
{
	public:
		OE_actionSelectionClearCurves(OE_document* doc);

		virtual ~OE_actionSelectionClearCurves();

		virtual void undo();
		virtual void redo();

	protected:
		std::list<OE_pointcurve*> actionCurves;
};

class OE_actionSelectionAddStitches : public OE_actions
{
    public:
		OE_actionSelectionAddStitches(OE_document* doc, std::list<OE_stitchs*> stitches, bool replace);

		virtual ~OE_actionSelectionAddStitches();

		virtual void undo();
		virtual void redo();

	protected:
		std::list<OE_stitchs*> actionStitches;
};


class OE_actionSelectionRemoveStitches : public OE_actions
{
	public:
		OE_actionSelectionRemoveStitches(OE_document* doc, std::list<OE_stitchs*> stitches);

		virtual ~OE_actionSelectionRemoveStitches();

		virtual void undo();
		virtual void redo();

	protected:
		std::list<OE_stitchs*> actionStitches;
};

class OE_actionSelectionClearStitches : public OE_actions
{
	public:
		OE_actionSelectionClearStitches(OE_document* doc);

		virtual ~OE_actionSelectionClearStitches();

		virtual void undo();
		virtual void redo();

	protected:
		std::list<OE_stitchs*> actionStitches;
};

class OE_actionSelectionClear : public OE_actions
{
	public:
		OE_actionSelectionClear(OE_document* doc);

		virtual ~OE_actionSelectionClear();

		virtual void undo();
		virtual void redo();

	protected:
		OE_actions* actionClearCurves;
		OE_actions* actionClearStitches;
};

class OE_actionMoveSelection : public OE_actions
{
	public:
		OE_actionMoveSelection(OE_document* doc, vector_2d offset);

		virtual ~OE_actionMoveSelection();

		virtual void undo();
		virtual void redo();

		void setMove(vector_2d offset);

	protected:
		vector_2d oldCoord;
		vector_2d offset;
};

class OE_actionScaleSelection : public OE_actions
{
	public:
		OE_actionScaleSelection(OE_document* doc, vector_2d ratio, vector_2d pos);

		virtual ~OE_actionScaleSelection();

		virtual void undo();
		virtual void redo();

		void setScale(vector_2d ratio);

	protected:
		vector_2d oldCoord;
		vector_2d ratio;
		vector_2d pos;
};

