/*
* 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 "OE_document.h"
class OE_curve;

class OE_actions
{
	public:
		/** Default constructor */
		OE_actions(OE_document* doc);
		/** Default destructor */
		virtual ~OE_actions();

		/** \brief undo the action
		 * \param document -> the document we're working on
		 */
		virtual void undo() = 0;

		/** \brief redo the action
		 * \param document -> the document we're working on
		 */
		virtual void redo() = 0;

		OE_curve* switchVal(OE_pointcurve* Original, OE_pointcurve** storage);
		std::list<OE_pointcurve*> switchVal(std::list<OE_pointcurve*> Original, std::list<OE_pointcurve*>* storage);
		OE_stitchs* switchVal(OE_stitchs* Original, OE_stitchs** storage);
		std::list<OE_stitchs*> switchVal(std::list<OE_stitchs*> Original, std::list<OE_stitchs*>* storage);
		float switchVal(float Original, float* storage);
		unsigned switchVal(unsigned Original, unsigned* storage);
		bool switchVal(bool Original, bool* storage);

	protected:
		bool active;
		OE_document* document;
};

class OE_actionsMeta : public OE_actions
{
	public:
		/** Default constructor */
		OE_actionsMeta(OE_document* doc);
		/** Default destructor */
		virtual ~OE_actionsMeta();
		virtual void undo();
		virtual void redo();
	protected:
		std::list<OE_actions*> actions;
};

